You can migrate data from a self-managed MongoDB database to an ApsaraDB for MongoDB instance, but you must pay close attention to the limits of ApsaraDB for MongoDB.

Standalone instances

Operation Limit
Deploy an instance Standalone instances can be created only in the China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), and China (Shenzhen) regions.
Configure the database version The MongoDB version must be 3.4.
Configure the storage engine

The storage engine must be WiredTiger.

Connect to an instance by using its public endpoint It is risky to connect to ApsaraDB for MongoDB instances over the Internet. By default, only an internal endpoint is provided after an instance is activated. If you need to connect to an instance over the Internet, apply for a public endpoint. For more information, see Apply for a public endpoint for an ApsaraDB for MongoDB instance.
Restart an instance You must restart an instance by using the ApsaraDB for MongoDB console or by calling the RestartDBInstance operation.
Migrate data You can use the built-in commands of MongoDB or Data Transmission Service (DTS) to migrate data. For more information, see Migrate user-created databases to Alibaba Cloud by using tools provided by MongoDB or Migrate self-managed standalone MongoDB databases to Alibaba Cloud by using DTS.
Back up data Standalone instances are backed up in snapshot mode due to their special architecture.
Note A snapshot backup retains the status of disk data at a specific point in time.
Restore data You can create instances based only on backup data. For more information, see Create an instance from a backup.
Modify the parameters of an instance For security and stability reasons, some parameters cannot be modified. For more information, see Configure database parameters for an ApsaraDB for MongoDB instance.

Replica set instances

Operation Limit
Deploy an instance The database version must match the storage engine. For more information, see MongoDB versions and storage engines.
Build replica set nodes
Upgrade the minor version of an ApsaraDB for MongoDB instance To ensure better performance and stability of the instance, the system will upgrade the minor version to the latest version by default. If the minor version of your instance expires or is not included in the maintenance list and the instance is upgraded, migrated, changed, Created from a backup, Created by point-in-time, or performed Restore data to a new ApsaraDB for MongoDB instance.
Restart an instance You must restart an instance by using the ApsaraDB for MongoDB console or by calling the RestartDBInstance operation.
Migrate data You can use the built-in commands of MongoDB or Data Transmission Service (DTS) to migrate data. For more information, see Migrate the replica set of a user-created MongoDB database to ApsaraDB for MongoDB by using DTS or Migrate self-managed databases to Alibaba Cloud by using tools provided by MongoDB.
Back up data Automatic backup supports only physical backup. Manual backup supports both physical and logical backup. For more information, see Configure automatic backup for an ApsaraDB for MongoDB instance and Manually back up an ApsaraDB for MongoDB instance.
Note If the database version of an instance is 3.2 or 3.4, the number of collections and indexes in the instance cannot exceed 10,000. Otherwise, physical backup may fail. If you want to increase this limit, we recommend that you upgrade the database version to 4.0 or 4.2. For more information, see Upgrade MongoDB versions. Alternatively, you can set the database version to 4.0 or 4.2 when you create an instance.
Restore data
Modify the parameters of an instance For security and stability reasons, some parameters cannot be modified. For more information, see Configure database parameters for an ApsaraDB for MongoDB instance.

Sharded cluster instances

Operation Limit
Deploy an instance The database version must match the storage engine. For more information, see MongoDB versions and storage engines.
Build cluster components
  • When you create a sharded cluster instance, you can specify the specifications and numbers of mongos and shards.
  • When the instance is running, you can add mongos and shards, but you cannot remove them. For more information, see Configuration change overview.
Upgrade the minor version of an ApsaraDB for MongoDB instance To ensure better performance and stability of the instance, the system will upgrade the minor version to the latest version by default. If the minor version of your instance expires or is not included in the maintenance list and the instance is upgraded, migrated, changed, Created from a backup, Created by point-in-time, or performed Restore data to a new ApsaraDB for MongoDB instance.
Restart an instance You must restart an instance by using the ApsaraDB for MongoDB console or by calling the RestartDBInstance operation.
Migrate data

You can use the built-in commands of MongoDB or Data Transmission Service (DTS) to migrate data. For more information, see Migrate user-created databases to Alibaba Cloud by using tools provided by MongoDB or Migrate the replica set of a user-created MongoDB database to ApsaraDB for MongoDB by using DTS.

Back up data Automatic backup supports only physical backup. Manual backup supports both physical and logical backup. For more information, see Configure automatic backup for an ApsaraDB for MongoDB instance and Manually back up an ApsaraDB for MongoDB instance.
Note If the database version of an instance is 3.2 or 3.4, the number of collections and indexes in the instance cannot exceed 10,000. Otherwise, physical backup may fail. If you want to increase this limit, we recommend that you upgrade the database version to 4.0. For more information, see Upgrade MongoDB versions.Alternatively, you can set the database version to 4.0 when you create an instance.
Restore data You can restore data only by point in time. For more information, see Restore data to a new ApsaraDB for MongoDB instance by point in time.
Modify the parameters of an instance For security and stability reasons, some parameters cannot be modified.
Read and write data You can only read data from the admin database of a sharded cluster instance, and you cannot write data to the admin database.