This topic describes how to migrate the data of a standalone instance or a replica set instance across regions by using Data Transmission Service (DTS). DTS supports both full data migration and incremental data migration. You can use these two methods together to migrate the data of an ApsaraDB for MongoDB instance across regions without interruptions to your business.
Prerequisites
- The source instance is a standalone instance or a replica set instance. If the source
instance is a sharded cluster instance, we recommend that you use the built-in commands
of MongoDB to migrate data. For more information, see Migrate a self-managed MongoDB database to ApsaraDB for MongoDB by using tools provided by MongoDB.
Note You cannot use DTS to incrementally migrate the data of a standalone instance. For more information, see Migrate the data of an ApsaraDB for MongoDB instance across regions.
- The destination instance is created in the destination region. For more information,
see Create a standalone instance, Create a replica set instance, or Create a sharded cluster instance.
Note The storage capacity of the destination instance must be larger than the occupied storage space of the source instance.
Background information
You may need to migrate the data of an ApsaraDB for MongoDB instance across regions in the following situations:
- You want to restructure your business.
- You want to use the ApsaraDB for MongoDB instance to provide database services for applications deployed on an ECS instance, but the two instances are in different regions.
In the following example, an ApsaraDB for MongoDB instance in the China (Qingdao) region is migrated to an instance in the China (Hangzhou) region.

Precautions
- DTS uses resources of the source and destination instances during full data migration. This may increase the load of the database server. If the data volume is large or the specification is low, the database server may become unavailable. We recommend that you migrate your data during off-peak hours to avoid business interruptions.
- To ensure data consistency, we recommend that you do not write data to the source instance when full data migration of a standalone instance is in progress.
- If the source and destination instances run different database versions or storage engines, make sure that the instances do not have compatibility issues between them before you start the migration. For more information about the database versions and storage engines supported by ApsaraDB for MongoDB, see MongoDB versions and storage engines.
Billing
Migration type | Instance configuration | Internet traffic |
---|---|---|
Full data migration | Free of charge. | Charged only when data is migrated from Alibaba Cloud over the Internet. For more information, see DTS pricing. |
Incremental data migration | Charged. For more information, see DTS pricing. |
Migration types
Migration type | Description |
---|---|
Full data migration | DTS migrates all historical data of the required objects from the source MongoDB database
to the destination MongoDB database.
Note The following types of objects are supported: database, collection, and index.
|
Incremental data migration | After full data migration is complete, DTS synchronizes incremental data from the
source MongoDB database to the destination MongoDB database.
Note
|
Required database account permissions
Data source | Full data migration | Incremental data migration |
---|---|---|
Source ApsaraDB for MongoDB instance | Read permissions on the source database | Read permissions on the source database, admin database, and local database |
Destination ApsaraDB for MongoDB instance | Read/write permissions on the destination database | Read/write permissions on the destination database |
Procedure
Subsequent operations
Determine whether to release the source instance.
- If the source instance uses pay-as-you-go billing, release it. For more information, see Release an ApsaraDB for MongoDB instance.
- If the source instance uses subscription billing, you cannot release it.