Migrating DDS Instance to MongoDB Databases

DRS enables you to migrate data out of the cloud for data rollback.

This section describes how to migration DDS DB instances to your local MonogoDB database over the public network.

Currently, you can create up to five real-time migration tasks.

Prerequisites

  • You have logged in to the DRS console.
  • Your account balance is greater than or equal to ¥0.
  • For details about real-time migration, see Real-Time Migration.
  • For details about constraints on DRS usage, see Before You Start.

Procedure

  1. On the Online Migration Management page, click Create Migration Task.
  2. On the Select Scenario page, select Source Database Type and Destination Database Type and click Next.

    • In this example, the source database can be Databases on the current cloud. The destination database can be On-premises databases, Self-built databases on ECS, Databases on the current cloud, or Databases on other cloud.
    • You cannot use DRS to migrate from an on-premises database to another on-premises database.

  3. On the Create Replication Instance page, configure task details, recipients, description, and the replication instance, and click Next.

    Figure 1 Migration task information
    Table 1 Task and recipient description

    Parameter

    Description

    Task Name

    The task name consists of 4 to 50 characters, starts with a letter, and can contain only letters (case-insensitive), digits, hyphens (-), and underscores (_).

    Send Notifications

    This parameter is optional. If this function is enabled, DRS will send notifications to specified recipients based on the mobile numbers and email addresses you provided. If an exception occurs during migration, the system will send a notification to the specified recipients.

    NOTE:

    Recipients must handle exceptions within 48 hours of receiving an SMS message or email. Otherwise, the notification subscription is invalid.

    Synchronization Delay Threshold

    During an incremental migration, a synchronization delay indicates a time difference (in seconds) of synchronization between the source and destination database.

    If the synchronization delay exceeds the threshold you specify, DRS will send alarms to the specified recipients. The value ranges from 1 to 3,600. To avoid repeated alarms caused by the fluctuation of delay, an alarm is sent only after the delay has exceeded the threshold for six minutes.

    NOTE:
    • In the early stages of an incremental migration, there is more delay because more data is waiting to be synchronized. In this situation, no notifications will be sent.
    • Before setting the delay threshold, you need to enter the recipient's mobile number or email address.

    Description

    The description consists of a maximum of 256 characters and cannot contain the following special characters: !=<>'&"

    Figure 2 Replication instance information
    Table 2 Replication instance information

    Parameter

    Description

    Data Flow

    Select Out of the cloud.

    The source database is an RDS database on the current cloud or a DDS DB instance. It is required that either the source database or the destination database is on the current cloud.

    Source DB Engine

    Select DDS.

    Destination DB Engine

    Select MongoDB.

    Network Type

    Currently, public network, VPC, VPN, and Direct Connect are supported. You can set this parameter based on site requirements.

    • VPC: is suitable for migrations of cloud databases.
    • VPN and Direct Connect: are suitable for migrations from on-premises self-built databases to cloud databases or between cloud databases across regions.
    • Public network: is suitable for migrations from on-premises or external cloud databases to destination databases.

    Source DB Instance

    Select the DDS DB instance to be migrated.

    Replication Instance Subnet

    Specifies the subnet where the replication instance resides. You can also click View Subnet to go to the network console to view the subnet where the instance resides.

    By default, the DRS instance and the destination DB instance are in the same subnet. You need to select the subnet where the DRS instance resides and ensure that there are available IP addresses. To ensure that the replication instance is successfully created, only subnets with DHCP enabled are displayed.

    Migration Type

    • Full: This migration type is suitable for scenarios where service interruption is permitted. It migrates all objects and data in non-system databases to the destination database at one time. The objects include collections and indexes.
      NOTE:

      If you perform a full migration, you are advised to stop operations on the source database. Otherwise, data generated in the source database during the migration will not be synchronized to the destination database.

    • Full+Incremental: This migration type allows you to migrate data without interrupting services. After a full migration initializes the destination database, an incremental migration initiates and parses logs to ensure data consistency between the source and destination databases.
    NOTE:

    If you select the Full+Incremental migration type, data generated during the full migration will be synchronized to the destination database with zero downtime, ensuring that both the source and destination databases remain accessible.

  4. On the Configure Source and Destination Databases page, wait until the replication instance is created. Then, specify source and destination database information and click Test Connection for both the source and destination databases to check whether they have been connected to the replication instance. After the connection tests are successful, select the check box before the agreement and click Next.

    Figure 3 Source database information
    Table 3 Source database information

    Parameter

    Description

    DB Instance Name

    By default, this parameter is set to the DB instance you have selected when you create the migration task and cannot be changed.

    Database Username

    Enter the username of the source database.

    Database Password

    Enter the password of the source database user.

    NOTE:

    The database username and password are encrypted and stored in the system and will be cleared after the task is deleted.

    Figure 4 Destination database information
    Table 4 Destination database information

    Parameter

    Description

    IP Address or Domain Name

    IP address or domain name of the source database in the IP address/Domain name:Port format. Enter an integer ranging from 1 to 65534, which indicates the port number of the source database.

    You can enter a maximum of three groups of IP addresses or domain names of the source database. Separate multiple values with commas (,). For example: 192.168.0.1:8080,192.168.0.2:8080. Ensure that the entered IP addresses or domain names belong to the same instance.

    NOTE:

    If multiple IP addresses or domain names are entered, the test connection is successful as long as one IP address or domain name is accessible. Therefore, you must ensure that the IP address or domain name is correct.

    Authentication Database

    The name of the authentication database. For example: The default authentication database of HUAWEI CLOUD DDS instance is admin.

    Database Username

    Enter the username of the destination database.

    Database Password

    Enter the password of the destination database user.

    SSL Connection

    SSL helps you encrypt the connections between the source and destination databases. If SSL is enabled, you need to upload the SSL CA root certificate.

    NOTE:
    • The maximum size of a single certificate file that can be uploaded is 500 KB.
    • If the SSL certificate is not used, your data may be at risk.

    The IP address, domain name, username, and password of the destination database are encrypted and stored in DRS and will be cleared after the task is deleted.

  5. On the Set Task page, select migration objects and click Next.

    Figure 5 Setting migration objects
    Table 5 Migration objects

    Parameter

    Description

    Migrate Object

    After the objects are migrated to the destination database, the object names will remain the same as those in the source database and cannot be modified.

    You can migrate all objects or specified objects based on your service requirements.

    • All: All objects in the source database are migrated to the destination database.
    • Self-defined: Only self-defined objects are migrated to the destination database. If the source database is changed, click in the upper right corner before selecting migration objects to ensure that the objects to be selected are from the changed source database.
      NOTE:

      When you select an object, the spaces before and after the object name are not displayed. If there are multiple spaces in the middle of the object name, only one space is displayed.

  6. On the Check Task page, check the migration task.

    • If any check fails, review the cause and rectify the fault. After the fault is rectified, click Check Again.

      For details about how to handle check failures, see the Checking Whether the Source Database Is Connected section in the Data Replication Service User Guide.

    • If all check items are successful, click Next.
      Figure 6 Task Check

      You can proceed to the next step only when all check items are successful. If any alarms are generated, view and confirm the alarm details first before proceeding to the next step.

  7. On the Confirm Task page, specify Start Time, confirm that the configured information is correct and click Submit to submit the task.

    • Set Start Time to Start upon task creation or Start at a specified time based on site requirements.
    • After a migration task is started, the performance of the source and destination databases may be affected. You are advised to start a migration task during off-peak hours.

  8. After the task is submitted, view and manage it on the Online Migration Management page.

    • You can view the task status. For more information about task status, see Task Status.
    • You can click in the upper-right corner to view the latest task status.