This topic describes how to restore data to a new ApsaraDB for MongoDB instance by point in time. This method is ideal for data restoration and verification.
- Replica set or sharded cluster instances of MongoDB 4.0 or 4.2 are created.
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.
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.
This method creates an instance and you are charged for the new instance. For more information, see Billable items and pricing.
- 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.
- On the Backup and Recovery page, click Create Instance By Time Point.
- In the Create Instance By Time Point panel, select a time point for restoration and select one of the following options:
- All Databases: restores data of all databases in the source instance to the destination instance.
- Select Databases: restores data of some databases in the source instance to the destination instance.
You can select the databases that you want to restore or click Enter Databases to enter the names of the databases.Note
- By default, all databases are restored for sharded cluster instances. You can skip this step.
- If you enter the names of the databases, separate the database names with commas (,).
- 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.
- After the database version is upgraded, the backup files of the original version cannot be used to restore data of the new version.
- Click OK.
- On the instance buy page, select a billing method for the new instance.
- Subscription: You must pay for the subscription when you create an instance. We recommend that you select this billing method for long-term use, because it is more cost-effective than pay-as-you-go billing. Longer subscription periods have larger discounts.
- Pay-as-you-go: You are billed on an hourly basis based on the used resources. 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 you no longer need the instance.
- Configure the new instance. For more information, see Create replica set instances or Create a sharded cluster instance.
- Replica set instance: The storage capacity of the new instance must be larger than or equal to that of the source instance.
- Sharded cluster instance:
- The number of shard nodes in the new instance must be larger than or equal to that in the source instance.
- The storage capacity of each shard node in the new instance must be larger than or equal to those in the source instance.
- Click Buy Now.
- Read and select ApsaraDB for MongoDB Agreement of Service and complete the payment.
Note The time required to restore data to a new instance by backup set varies based on factors such as the data volume, task queue status, and network conditions. When the status of the new instance changes to Running, the restoration is complete.