ApsaraDB for MongoDB allows you to create an instance at a point in time when the source instance is running, and restore the backup data at that point in time to the new instance. This method is ideal for data restoration and verification.
- The instance is a replica set or sharded cluster instance.
Notice Standalone instances do not support point-in-time data restoration to a new instance.
- You can select a point in time only from the last seven days.
- Individual databases can be restored only from physical backups, but not from logical
backups. If your instance runs a MongoDB version earlier than 4.0 and the total number
of collections and indexes in your instance exceeds 10,000, physical backups may fail.
Before you implement a physical backup, upgrade the database version of your instance
to MongoDB 4.0 or later. For more information about how to upgrade the database version,
see Upgrade MongoDB versions.
Note After the database version is upgraded, the backup files of the source instance cannot be used to restore data to the new instance.
- The amount of time required varies based on factors such as the data volume, task queue status, and network conditions. When the state of the new instance changes to Running, the restoration is complete.
- 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 one or more databases of an ApsaraDB for MongoDB instance.
- Log on to the ApsaraDB for MongoDB console.
- In the upper-left corner of the page, select the resource group and the region of the target instance.
- In the left-side navigation pane, click Replica Set Instances, or Sharded Cluster Instances based on the instance type.
- Find the target instance and click its ID.
- In the left-side navigation pane, click Backup and Recovery.
- Click the Full Backup tab.
- <database>: the source database that you want to restore.
- Click Create Instance By Time Point.
- In the Create Instance By Time Point panel, configure the following parameters.
Parameter Description Select recovery time point Select a point in time from which you want to restore data. You can select a point in time from the last seven days.Note The time you select must be earlier than the current time and later than the time when the source instance was created. Select databases to recover
- All Databases: restores data of all databases in the source instance to the new instance.
- Select Databases: restores data of some databases in the source instance to the new instance.
You can select the databases that you want to restore or click Enter Databases to enter the names of the databases.Note
- If you enter the names of the databases, separate the database names with commas (,).
- After the database version is upgraded, the backup files of the source instance cannot be used to restore data to the new instance.
- By default, all databases are restored for sharded cluster instances. You can skip this step.
- To ensure data integrity and accuracy, do not select the latest point in time (usually the latest hour) if the instance is a sharded cluster instance. Otherwise, restoration fails.
- You can select only All Databases for replica set instances that run MongoDB 5.0 or 4.4.
- Click OK.
- Create an instance.
- On the Clone Instance page, set Product Type.
- Replica Set (Subscription) or Sharded Cluster (Subscription): If you purchase a subscription instance, you must pay an upfront fee. We recommend that you select this billing method for long-term use, because it is more cost-effective than the pay-as-you-go billing method. You can receive larger discounts for longer subscription periods.
- Replica Set (Pay-as-you-go) or Sharded Cluster (Pay-as-you-go): A pay-as-you-go instance is charged on an hourly basis as per its configurations. Fees are automatically deducted from your Alibaba Cloud account. We recommend that you select this billing method for short-term use. You can reduce costs by releasing your pay-as-you-go instance after the instance is no longer needed.
- Configure the new instance. For more information, see Create a replica set instance or Create a sharded cluster instance. Note
- Replica set instance: The storage space of the new instance must be greater than or equal to that of the source instance.
- Sharded cluster instance:
- The number of shard nodes in the new instance must be equal to that in the source instance.
- The storage space of each shard node in the new instance must be greater than or equal to that in the source instance.
- On the Clone Instance page, set Product Type.
- Confirm the order and complete the payment.
- Read and select the MongoDB Terms of Service and click Buy Now.
- The Purchase page appears.
- Click Pay on the Purchase page.
- Complete the payment.