Source DB | Destination DB |
|---|---|
|
|
You can run the following command to query a database version.
db.version()
To start a migration task, the source and destination database users must have permissions listed in the following table. Different types of migration tasks require different permissions. For details, see Table 2. DRS automatically checks the database account permissions in the pre-check phase and provides handling suggestions.
Type | Full Migration | Full+Incremental Migration |
|---|---|---|
Source database user |
|
|
Destination database user | The user who connects to the destination database must have the dbAdminAnyDatabase permission of the admin database and the readWrite permission of the destination database. If the destination database is a cluster instance, the database user must have the clusterManager permission for the admin database. | |
db.grantRolesToUser("Username",[{role:"readAnyDatabase",db:"admin"}, {role:"read",db:"local"}])
db.grantRolesToUser("Username",[{role:"readAnyDatabase",db:"admin"}, {role:"read",db:"config"}])
Different types of migration tasks support different migration objects. For details, see Table 3. DRS will automatically check the objects you selected before the migration.
Type | Precautions |
|---|---|
Migration objects |
|
During an incremental migration, Oplog of the source database must be enabled. If the storage space is sufficient, store the source database Oplog for as long as possible. The recommended retention period is at least three days.
To ensure tasks can run normally, DRS provides automatic pre-check. Before starting a DRS task, DRS checks the configurations and conditions of the source and destination databases. For details about the main check items and handling suggestions, see DRS Pre-Check Items. In addition to the pre-check items, you need to pay attention to the items listed in Table 4.
Type | Restrictions |
|---|---|
Restrictions on the source database |
|
Restrictions on usage | General
Full migration
Incremental migration
Data comparison
|
Other restrictions |
|
This section uses a MongoDB sharded cluster as an example to describe how to configure a task for migrating data from MongoDB to DDS over a public network.
Parameter | Description |
|---|---|
Task Name | The task name must start with a letter and consist of 4 to 50 characters. It can contain only letters, digits, hyphens (-), and underscores (_). |
Description | The description can contain up to 256 characters and cannot contain special characters !=<>&'\" |
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.
|
Destination DB Instance | Select the DB instance you have created. |
Replication Instance Subnet | The subnet where the replication instance resides. You can also click View Subnets 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 |
|
Source DB Instance Type | If you select Full+Incremental for Migration Type, set this parameter based on the source database.
|
Obtain Incremental Data | If Source DB Instance Type is set to Cluster and Migration Mode is set to Full+Incremental, you need to determine how to capture data changes during the incremental synchronization. Also, the balancer of the source database must be disabled and orphaned documents must be deleted. For details, see
|
Source Shard Quantity | If Source DB Instance Type is set to Cluster and Obtain Incremental Data is set to oplog, you need to enter the number of source database shards. The number of source shards ranges from 2 to 64. Specify this parameter based on the actual number of shards in the source DB. |
Specify EIP | This parameter is available when you select Public network for Network Type. Select an EIP to be bound to the DRS instance. DRS will automatically bind the specified EIP to the DRS instance and unbind the EIP after the task is complete. If Source DB Instance Type is set to Cluster and Obtain Incremental Data is set to oplog, the number of specified EIPs must be consistent with that of source shards. |
Parameter | Description |
|---|---|
AZ | Select the AZ where you want to create the DRS task. Selecting the one housing the source or destination database can provide better performance. |
Parameter | Description |
|---|---|
Enterprise Project | An enterprise project you would like to use to centrally manage your cloud resources and members. Select an enterprise project from the drop-down list. The default project is default. |
Tags |
|
If a task fails to be created, DRS retains the task for three days by default. After three days, the task automatically stops.
Parameter | Description |
|---|---|
mongos IP Address or Domain Name | IP address or domain name of the source database in the IP address/Domain name:Port format. The port of the source database. Range: 1 - 65535 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 sharded cluster. 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 of the source MongoDB database user. For example: The default authentication database of DDS instance is admin. |
mongos Username | The username of the mongos node of the source MongoDB database. For example, the default mongos username of a DDS instance is rwuser. |
Database 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:
|
Sharded Database | Enter shard node information of the MongoDB database based on the number of cluster shard nodes 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.
Parameter | Description |
|---|---|
DB Instance Name | The DB instance you selected when creating the migration task. This parameter cannot be changed. |
Authentication Database | The name of the authentication database. For example: The default authentication database of DDS instance is admin. |
Database Username | The username for accessing the destination database. |
Database 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 username and password of the destination database are encrypted and stored in the database and the replication instance during the migration. After the task is deleted, the username and password are permanently deleted.
Parameter | Description |
|---|---|
Flow Control | You can choose whether to control the flow. Flow Control takes effect in the full phase only.
|
Migrate Account | Accounts to be migrated can be classified into the following types: accounts that can be migrated and accounts that cannot be migrated. You can choose whether 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.
|
Migrate Object | The left pane displays the source database objects, and the right pane displays the selected objects. You can choose to migrate all objects, tables, or databases based on your service requirements.
If the source database is changed, click NOTE:
|
You can proceed to the next step only when all checks are successful. If there are any items that require confirmation, view and confirm the details first before proceeding to the next step.
Parameter | Description |
|---|---|
Start Time | Set Start Time to Start upon task creation or Start at a specified time based on site requirements. The Start at a specified time option is recommended. NOTE: The migration task may affect the performance of the source and destination databases. You are advised to start the task in off-peak hours and reserve two to three days for data verification. |
Send Notifications | This parameter is optional. If the status, latency metric, or data of the migration task is abnormal, DRS will send you a notification. |
SMN Topic | This parameter is available only after you enable Send Notifications and create a topic on the SMN console and add a subscriber. |
in the upper right corner to view the latest task status.