All Products
Search
Document Center

Data Transmission Service:Migrate data between ApsaraDB for MongoDB instances across regions

Last Updated:Feb 27, 2026

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 typeFull data migrationIncremental data migration
Standalone instanceSupportedNot supported
Replica set instanceSupportedSupported
Sharded cluster instanceNot 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 typeDescription
Full data migrationMigrates all existing databases, collections, and indexes from the source to the destination.
Incremental data migrationAfter 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 typeTask configuration feeInternet traffic fee
Full data migrationFreeCharged only when data is migrated from Alibaba Cloud over the Internet. For more information, see Billing overview.
Incremental data migrationCharged. 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

DatabaseFull data migrationIncremental data migration
Source instanceRead permissions on the source databaseRead permissions on the source, admin, and local databases
Destination instanceRead and write permissions on the destination databaseRead 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:

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.

Migrate data between ApsaraDB for MongoDB instances across regions

Step 1: Start the migration

  1. Log on to the ApsaraDB for MongoDB console.

  2. In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances.

  3. In the upper-left corner, select the resource group and region of the source instance.

  4. Click the instance ID of the source instance.

  5. 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:

Configure the source and destination databases
SectionParameterDescription
--Task NameDTS automatically generates a task name. Specify a descriptive name for easy identification. You do not need to specify a unique task name.
Source DatabaseInstance TypeSelect ApsaraDB for MongoDB.
Instance RegionSelect the region of the source instance. In this example, select China (Qingdao).
MongoDB Instance IDSelect the source instance ID.
Database NameEnter the name of the authentication database. To use the root account, enter admin.
Database AccountEnter the username for the source instance. For required permissions, see Required permissions.
Database PasswordEnter the password. Click Test Connectivity to verify. A Passed message indicates a successful connection. If a Failed message appears, click Check to troubleshoot.
Destination DatabaseInstance TypeSelect MongoDB Instance.
Instance RegionSelect the region of the destination instance. In this example, select China (Hangzhou).
MongoDB Instance IDSelect the destination instance ID.
Database NameEnter the name of the authentication database. To use the root account, enter admin.
Database AccountEnter the username for the destination instance. For required permissions, see Required permissions.
Database PasswordEnter 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.

Warning

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

Select the migration types and the objects to be migrated
SettingDescription
Select the migration typesSelect 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 migratedSelect 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 objectsRename objects in the destination using object name mapping.
Specify the retry time range for a failed connection to the source or destination databaseDTS 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

  1. 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.

  2. After the precheck passes, click Next.

  3. In the Confirm Settings dialog box, select the Instance Class and read and accept the Data Transmission Service (Pay-As-You-Go) Service Terms.

  4. 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:

    1. Wait until the progress bar shows Incremental Data Migration and the status The migration task is not delayed.

    2. Stop writing data to the source instance for a few minutes.

    3. Wait until the status returns to The migration task is not delayed.

    4. 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.