This topic describes how to migrate data from a replica set MongoDB instance to a sharded cluster instance by using Data Transmission Service (DTS). DTS supports full data migration and incremental data migration. When you migrate data between ApsaraDB for MongoDB instances, you can select both of the supported migration types to ensure service continuity.
Prerequisites
Precautions
- During full data migration, DTS uses read and write resources of the source and destination databases. This may increase the load of the database server. If you migrate a large volume of data or the server specifications cannot meet your requirements, database services may become unavailable. Before you migrate data, evaluate the impact of data migration on the performance of the source and destination databases. We recommend that you migrate data during off-peak hours.
- If the source and destination ApsaraDB for MongoDB instances have different versions or storage engines, make sure that the versions or storage engines are compatible. For more information, 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
|
Permissions required for database accounts
Instance | Full data migration | Incremental data migration |
---|---|---|
ApsaraDB for MongoDB replica set instance | The read permission on the source database | The read permission on the source database, admin database, and local database |
ApsaraDB for MongoDB sharded cluster instance | The read/write permissions on the destination database | The read/write permissions on the destination database |
Before you begin
Create databases and collections to be sharded in the destination ApsaraDB for MongoDB instance, and configure data sharding based on your business requirements. For more information, see Configure sharding to maximize the performance of shards.