All Products
Search
Document Center

ApsaraDB for MongoDB:Restore one or more databases of an ApsaraDB for MongoDB instance

Last Updated:Feb 06, 2024

To restore a collection or document that was accidentally deleted, you can restore one or more databases of an ApsaraDB for MongoDB instance.

Prerequisites

  • The instance must meet the following requirements:
    • The instance was created after March 26, 2019.
    • The instance is a replica set instance.
    • The instance uses local disks to store data.
    • The instance belongs to the China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Hangzhou), China (Shanghai), China (Shenzhen), or Singapore region.
    • The instance runs MongoDB 3.4, 4.0, or 4.2.
      Note
    • The storage engine of the instance is WiredTiger.
  • Backup files contain the data of the databases to be restored. For example, if you want to restore the test database, the data of the test database must be included in the backup files.

Precautions

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.

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. Click the ID of an instance, or click More icon in the Actions column corresponding to the instance and select Manage.
  5. In the left-side navigation pane, click Backup and Recovery.
  6. 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, configure the parameters described in the following table.
        ParameterDescription
        Select recovery time pointSelect a point in time from the last seven days from which to restore data.
        Note The point in time you select must be earlier than the current time and later than the time when the source instance was created.
        Select databases to recoverSelect Select Databases and then select the names of the databases that you want to restore.
        Note You can also click Enter Databases and enter the names of the databases that you want to restore.
      3. Click OK.
    • Create an instance from a backup point
      1. Find the backup file that you want to restore and click Create Instance from Backup Point in the Actions column.
      2. In the Create Instance from Backup Point panel, select Select Databases and then select the databases that you want to restore.
        Note You can also click Enter Databases and enter the names of the databases that you want to restore.
      3. Click OK.
  8. Configure the new 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. For long-term usage, the subscription billing method is more cost-effective than the pay-as-you-go billing method. You are provided with larger discounts 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 the pay-as-you-go billing method for short-term usage. If you no longer require a pay-as-you-go instance, you can release it to reduce costs.
    2. Configure the new instance. For more information, see Create a replica set instance.
      Note
      • When you create the instance, the Region, Engine Version, Active-standby Nodes, Storage Engine, Storage Type, or Network Type parameter cannot be changed.
      • To ensure that the new instance has sufficient capacity for restoration, we recommend that you set the storage capacity to a value that is greater than or equal to that of the instance that you want to restore.
  9. Confirm the order and complete the payment.
    Pay for the instance based on the its billing method.
    • Subscription:
      1. Read and select the ApsaraDB for MongoDB Terms of Service and then click Buy Now.
      2. Click Pay. On the Purchase page, complete the payment.
    • Pay-as-you-go: After you click Buy Now, the system automatically deducts the amount in the next hour.