Migrating MongoDB Databases to DDS
You can create a migration task that will walk you through each step of the process. After a migration task is created, you can manage it on the DRS console.
This section describes how to create an online migration task to migrate MongoDB databases in a public network. You can also migrate the MongoDB sharded cluster to the DDS Enhanced Edition cluster by referring to operations in this section.
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.
- The migration requirements are met. For details, see Real-Time Migration.
- The constraints on DRS usage are met. For details, see Before You Start.
Procedure
- On the Online Migration Management page, click Create Migration Task.
- On the Select Scenario page, select Source Database Type and Destination Database Type and click Next.
- In this example, the source database is On-premises databases, Databases on the current cloud, Self-built databases on ECS, or Databases on other cloud. The destination database is Databases on the current cloud.
- You cannot use DRS to migrate from an on-premises database to another on-premises database.
- 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 confirm the subscription on the SMN console within 48 hours of receiving an SMS message or email. Otherwise, they cannot receive notifications from DRS.
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 settings Parameter
Description
Data Flow
Select To the cloud.
The destination database must be a database on the current cloud.
Source DB Engine
Select MongoDB.
Destination DB Engine
Select DDS.
Network Type
Available options: VPC, VPN or Direct Connect, and Public network. By default, the value is Public network.
- VPC is suitable for migrations of cloud databases.
- Public network is suitable for migrations from on-premises or external cloud databases to the destination databases bound with an EIP.
- VPN is suitable for migrations from on-premises databases to cloud databases or between cloud databases across regions.
- Direct Connect is suitable for migrations from on-premises databases to cloud databases or between cloud databases across regions. NOTE:
The full plus incremental migration of a sharded cluster cannot be performed in a VPC network.
Destination DB Instance
Select the DB instance you created.
Replication Instance Subnet
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 there are available IP addresses for the subnet. 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 acceptable. All objects in non-system databases are migrated 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.
Source DB Instance Type
Set this parameter based on the source database.
- If the source database is a cluster instance, set this parameter to Cluster instances.
- If the source database is a replica set or a single node instance, set this parameter to Non-cluster.
Source Shard Quantity
If Source DB Instance Type is set to Cluster instances, enter the number of source database instances.
The default minimum number of source DB instances is 2 and the maximum number is 32. You can set this parameter based on the number of source database shards.
- On the Configure Source and Destination Databases page, wait until the replication instance is created, and then configure the source and destination database details. You need to click Test Connection in the Source Database and Destination Database areas to check that both the source and destination databases are connected. Then, select the check box before the agreement and click Next. Figure 3 Source database information
Table 3 Source database information Parameter
Description
mongos Address
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 DDS instance is admin.
mongos Username
The username for accessing the source database.
mongos Password
The password for the database username.
SSL Connection
SSL encrypts the connections between the source and destination databases. If SSL is enabled, 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.
Sharded Database
Enter the information about the sharded databases in the source database.
The IP address, domain name, username, and password of the source database are encrypted and stored in DRS and will be cleared after the task is deleted.
- Destination database configuration Figure 4 Destination database information
Table 4 Destination database information Parameter
Description
DB Instance Name
The DB instance you selected when creating the migration task and cannot be changed.
Database Username
The username for accessing the destination database.
Database Password
The password for the database username.
The database username and password are encrypted and stored in the system and will be cleared after the task is deleted.
- On the Set Task page, select migration objects and click Next. Figure 5 Migration object
Table 5 Migration object Parameter
Description
Migrate Account
There are accounts that can be migrated completely and accounts that cannot be migrated. You can choose whether or not to migrate the accounts. Accounts that cannot be migrated or accounts that are not selected will not exist in the destination database. Ensure that your services will not be affected by these accounts.- Yes
If you choose to migrate accounts, see section Migrating Accounts in the Data Replication Service User Guide to migrate database users and roles.
- No
During the migration, accounts and roles are not migrated.
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 two or more consecutive spaces in the middle of the object name, only one space is displayed.
- Yes
- 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.
Figure 6 Task Check
- If the check is complete and the check success rate is 100%, click Next.
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.
- If any check fails, review the cause and rectify the fault. After the fault is rectified, click Check Again.
- On the Confirm Task page, specify Start Time, confirm that the configured information is correct and click Submit to submit the task.
- 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.
- After the migration task is created, complete data service cutover by referring to Process in the Getting Started with Data Replication Service.
Last Article: Migrating On-Premises Oracle Database to RDS MySQL
Next Article: Migrating DDS Instance to MongoDB Databases
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.