This topic describes how to migrate data from a replica set instance to a sharded cluster instance by using Data Transmission Service (DTS). DTS supports both full data migration and incremental data migration. You can use these two types of migration together to migrate data between ApsaraDB for MongoDB instances without downtime.
Prerequisites
Precautions
- DTS uses specific resources of the source instance and destination instance during the full data migration process. This may increase the loads of the physical hosts on which these instances are deployed. If the data volume is large or the specifications of the physical hosts do not meet your requirements, the source instance and destination instance may become unavailable. We recommend that you migrate data during off-peak hours to prevent interruptions to your workloads.
- If the source instance and destination instance run different database engine versions or different storage engines, make sure that the database engine version or storage engine of the source instance is compatible with the database engine version or storage engine of the destination instance. For more information, see MongoDB versions and storage engines.
Billing
Migration type | Task 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 Pricing. |
Incremental data migration | Charged. For more information, see Pricing. |
Migration types
Migration type | Description |
---|---|
Full data migration | All existing data in the source instance is migrated to the destination instance.
Note Full data migration is supported for databases, collections, and indexes.
|
Incremental data migration | Only the incremental data in the source instance is migrated to the destination instance.
Note
|
Permissions required
Instance | Full data migration | Incremental data migration |
---|---|---|
Source instance | Read permissions on the source database | Read permissions on the source database, the database named admin, and the database named local |
Destination instance | Read and write permissions on the destination database | Read and write permissions on the destination database |
Preparations
Create databases and collections in the destination instance. Then, configure data sharding based on your business requirements. For more information, see Configure sharding to maximize the performance of shards.
Procedure
What to do next
If you no longer need the source instance, release the source instance.
- If the source instance is charged based on the pay-as-you-go billing method, you can release the source instance. For more information, see Release an ApsaraDB for MongoDB instance.
- If the source instance is charged based on the subscription billing method, you cannot release the source instance.