ApsaraDB for MongoDB allows one or more databases to be restored. This topic describes how to restore one or more databases of an ApsaraDB for MongoDB instance.

Prerequisites

  • The instance must meet the following requirements:
    • The instance is a replica set instance.
    • The instance is deployed in the China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Hangzhou), China (Shanghai), China (Shenzhen), or Singapore (Singapore) region. Databases in other regions cannot be restored.
    • The database version of the instance is 3.4, 4.0, or 4.2. If the database version of the instance is outdated, you can upgrade the database version. 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 storage engine of the instance is WiredTiger.
  • Backup files contain the databases to be restored. For example, if you want to restore the test database, the test database must be included in the backup files.

Precautions

  • You can restore one or more databases only from physical backups, but not from logical backups. If your instance runs MongoDB 3.4 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 time required to restore one or more databases 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.
  • ApsaraDB for MongoDB automatically updates the minor version of the instance to the latest version if the minor version of an ApsaraDB for MongoDB instance expires or is not included in the maintenance list and when you perform some operations. This ensures that the ApsaraDB for MongoDB instance can provide higher performance and stability. For more information, see Database version upgrade, Data migration, Overview, Restore backup data to a new ApsaraDB for MongoDB instance by backup point, Restore backup data to a new ApsaraDB for MongoDB instance by point in time, and Restore one or more databases of an ApsaraDB for MongoDB instance.

Billing

When you restore one or more databases, the system creates an instance and you are charged for this instance. For more information, see Billable items and pricing.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the left-side navigation pane, click Replica set instances.
  3. In the upper-left corner of the page, select the resource group and region to which the instance belongs.
  4. On the page that appears, find the instance that you want to manage and click its ID.
  5. In the left-side navigation pane, click Backup and Recovery.
  6. On the page that appears, click the Full Backup tab.
  7. Use one of the following methods to restore databases:
    • Create an instance by point in time
      1. Click Create Instance By Time Point.
      2. In the Create Instance By Time Point panel, specify the following parameters.
        Parameter Description
        Select recovery time point Selects a point in time from which you want to restore data. Points in time from the last seven days can be selected.
        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 Selects Select Databases and then select the names of the databases that you want to restore.
        Note You can also click Enter Databases to enter the names of the databases that you want to restore.
      3. Click OK.
    • Create an instance from a backup point
      1. Click More icon in the Actions column corresponding to a backup file and select Create Instance from Backup Point.
      2. In the Create Instance from Backup Point panel, select Select Databases and then select the names of the databases that you want to restore.
        Note You can also click Enter Databases to enter the names of the databases that you want to restore.
      3. Click OK.
  8. Create an instance.
    1. On the Clone Instance page, set Product Type.
      • Replica Set (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. Larger discounts are provided for longer subscription periods.
      • Replica Set (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.
    2. Configure the new instance. For more information, see Create a replica set instance.
      Note
      • You cannot change the Region, Engine Version, Storage Engine, or Nodes settings for the new instance.
      • To make sure that the new instance has sufficient space for restoration, we recommend that you set the storage capacity to a value that is larger than or equal to that of the source instance.
  9. Confirm the order and complete the payment.
    1. Read and select the MongoDB Terms of Service and click Buy Now.
    2. On the Purchase page, click Purchase.
    3. Complete the payment.