Data Transmission Service (DTS) migrates data from an ApsaraDB for MongoDB instance in one region to another, supporting both full and incremental data migration for replica set instances and full data migration for standalone instances.
Supported migration paths
| Source instance type | Full data migration | Incremental data migration |
|---|---|---|
| Standalone instance | Supported | Not supported |
| Replica set instance | Supported | Supported |
| Sharded cluster instance | Not supported. Use mongodump and mongorestore instead. For more information, see Migrate data to a sharded cluster instance by using mongodump and mongorestore. | Not supported |
Migration types
| Migration type | Description |
|---|---|
| Full data migration | Migrates all existing databases, collections, and indexes from the source to the destination. |
| Incremental data migration | After full data migration completes, continuously syncs changes from the source to the destination. Supported operations: create and delete operations on databases, collections, and indexes; create, delete, and update operations on documents. |
Billing
| Migration type | Task configuration fee | Internet traffic fee |
|---|---|---|
| Full data migration | Free | Charged only when data is migrated from Alibaba Cloud over the Internet. For more information, see Billing overview. |
| Incremental data migration | Charged. For more information, see Billing overview. | Same as full data migration. Internet traffic fees apply to the entire data migration task type when the destination uses a public IP address. For more information, see Billable items. |
Required permissions
| Database | Full data migration | Incremental data migration |
|---|---|---|
| Source instance | Read permissions on the source database | Read permissions on the source, admin, and local databases |
| Destination instance | Read and write permissions on the destination database | Read and write permissions on the destination database |
For more information about how to create and authorize a database account, see Manage user permissions on MongoDB databases.
Prerequisites
Before you begin, make sure that:
The source instance is a standalone or replica set instance
A public endpoint is applied for the source instance. For more information, see Apply for a public endpoint
The destination instance is created in the target region. For more information, see Create a standalone instance, Create a replica set instance, or Create a sharded cluster instance
The available storage space of the destination instance is 10% larger than the total data size in the source instance. This is a recommended prerequisite
The source and destination instances use compatible MongoDB versions and storage engines. For more information, see MongoDB versions and storage engines
Before you begin
DTS consumes resources on both the source and destination instances during full data migration, which may increase the server loads. Migrate data during off-peak hours.
Standalone instances do not support incremental data migration. Do not write data to a standalone source instance during full data migration to maintain data consistency.
Data written concurrently to the destination occupies 5%--10% more storage space than the data in the source.
Make sure that the destination database does not have the same primary key as the source database. The default primary key is
_id. If duplicate primary keys exist, data loss may occur. Clear conflicting data in the destination database before you start the migration without interrupting DTS services.ApsaraDB for MongoDB automatically updates the minor version when the current version expires or is removed from the maintenance list. This may also occur during version upgrades, data migration, configuration changes, and backup restoration.
Create a migration task
The following example migrates a replica set instance from the China (Qingdao) region to the China (Hangzhou) region.

Step 1: Start the migration
Log on to the ApsaraDB for MongoDB console.
In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances.
In the upper-left corner, select the resource group and region of the source instance.
Click the instance ID of the source instance.
In the upper-right corner, click Migrate Databases.
Step 2: Configure the source and destination databases
On the Create Migration Task page, configure the following settings:

| Section | Parameter | Description |
|---|---|---|
| -- | Task Name | DTS automatically generates a task name. Specify a descriptive name for easy identification. You do not need to specify a unique task name. |
| Source Database | Instance Type | Select ApsaraDB for MongoDB. |
| Instance Region | Select the region of the source instance. In this example, select China (Qingdao). | |
| MongoDB Instance ID | Select the source instance ID. | |
| Database Name | Enter the name of the authentication database. To use the root account, enter admin. | |
| Database Account | Enter the username for the source instance. For required permissions, see Required permissions. | |
| Database Password | Enter the password. Click Test Connectivity to verify. A Passed message indicates a successful connection. If a Failed message appears, click Check to troubleshoot. | |
| Destination Database | Instance Type | Select MongoDB Instance. |
| Instance Region | Select the region of the destination instance. In this example, select China (Hangzhou). | |
| MongoDB Instance ID | Select the destination instance ID. | |
| Database Name | Enter the name of the authentication database. To use the root account, enter admin. | |
| Database Account | Enter the username for the destination instance. For required permissions, see Required permissions. | |
| Database Password | Enter the password. Click Test Connectivity to verify. A Passed message indicates a successful connection. If a Failed message appears, click Check to troubleshoot. |
Click Set Whitelist and Next.
DTS automatically or manually adds its CIDR blocks to the whitelist of the database instance or ECS security group rules. Before proceeding, take preventive measures such as strengthening username and password security, limiting exposed ports, authenticating API calls, and regularly reviewing whitelist entries. Alternatively, connect to DTS through Express Connect, VPN Gateway, or Smart Access Gateway (SAG).
Step 3: Select migration types and objects

| Setting | Description |
|---|---|
| Select the migration types | Select Full Data Migration only, or select both Full Data Migration and Incremental Data Migration to keep the destination in sync during migration. Note Standalone instances do not support Incremental Data Migration. If incremental migration is not selected, do not write data to the source during full data migration to maintain data consistency. |
| Select the objects to be migrated | Select objects from the Available section and click the right arrow icon to move them to the Selected section. Note DTS cannot migrate data from the admin or local database. Migratable objects include databases, collections, and functions. To rename objects in the destination, use the object name mapping feature. |
| Specify whether to rename objects | Rename objects in the destination using object name mapping. |
| Specify the retry time range for a failed connection to the source or destination database | DTS retries failed connections for up to 12 hours by default. Adjust this value based on your needs. DTS charges apply during the retry period. Release the DTS instance if the source or destination database is no longer available. |
Step 4: Run the precheck and start the migration
Click Precheck. DTS validates the configuration before starting the migration.
If the precheck fails, click View Details next to each failed item, fix the issues, and run the precheck again.
If a warning is triggered, the precheck can still pass. You can ignore the warning or fix the issue based on the provided solution. Ignoring warnings may affect the migration result.
After the precheck passes, click Next.
In the Confirm Settings dialog box, select the Instance Class and read and accept the Data Transmission Service (Pay-As-You-Go) Service Terms.
Click Buy and Start to start the migration task.
Step 5: Monitor the migration and perform the cutover
Full data migration: Do not manually stop the task. Wait until it completes automatically.
Incremental data migration: The task does not stop automatically. Perform the cutover as follows:
Wait until the progress bar shows Incremental Data Migration and the status The migration task is not delayed.
Stop writing data to the source instance for a few minutes.
Wait until the status returns to The migration task is not delayed.
Manually stop the migration task.
After the migration completes, switch your workloads to the destination instance.
Verify the migration
After the migration task is complete, verify the migration results:
Compare the document counts between the source and destination databases to check for data loss.
Validate that indexes are created correctly in the destination database.
Test application connectivity to the destination instance.
Next steps
If the source instance is no longer needed, release it:
Pay-as-you-go instance: Release the instance directly. For more information, see Release an ApsaraDB for MongoDB instance.
Subscription instance: The instance cannot be released before the billing cycle ends.