All Products
Search
Document Center

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

Last Updated:Mar 28, 2026

Recover accidentally deleted collections or documents by restoring specific databases from a backup, without replacing the entire instance.

Prerequisites

Before you begin, make sure that:

  • Your instance is one of the following types:

    • Replica set instance with cloud disks

    • Sharded cluster instance with cloud disks

    • Replica set instance with local disks

  • A valid backup exists for the instance.

Note

The database and collection restoration feature for cloud disk instances is not available to all users. If you want to use this feature, submit a ticket to technical support to enable it.

Which procedure applies to you?

Instance typeWhere data is restoredBilling
Replica set with cloud disksTo the original instanceFree (you pay only for backup storage)
Sharded cluster with cloud disksTo the original instanceFree (you pay only for backup storage)
Replica set with local disksTo a new instanceYou are billed for the new instance

Cloud disk instances (replica set and sharded cluster)

Limitations

  • Data can only be restored to the original instance, not to a new one.

  • The original instance must have enough storage space. If not, scale out the instance before proceeding.

  • During restoration, the system creates temporary tables in the original instance. After restoration completes, you can choose whether to overwrite the original tables.

  • Database and collection names must not contain special characters. Use only letters, numbers, and underscores (_).

  • Restoration time depends on data volume, the task queue, and network conditions. Wait until the instance status changes to Running.

Billing

The database and collection restoration feature is free. You pay only for backup file storage. For details, see Billing rules.

Step 1: Enable database and collection restoration

Enable this feature before using it. Once enabled, it cannot be disabled.

  1. Go to the ApsaraDB for MongoDB replica set instances page or the ApsaraDB for MongoDB sharded cluster instances page. In the upper-left corner, select a resource group and a region, then click the target instance ID.

  2. In the left-side navigation pane, click Backup and Restoration.

  3. Click Backup Settings, then click Edit next to Basic Backup.

  4. In the Backup Settings panel, under Advanced Features, select Database and Collection Restoration.

  5. Click OK.

Step 2: Perform a full backup

Database and collection metadata is included in full backups. After enabling the feature, run a full backup before restoring any data. The backup can be automatic (scheduled) or manual (on demand).

Step 3: Restore databases

  1. Go to the ApsaraDB for MongoDB replica set instances page or the ApsaraDB for MongoDB sharded cluster instances page. In the upper-left corner, select a resource group and a region, then click the target instance ID.

  2. In the left-side navigation pane, click Backup and Restoration.

  3. Click Create Instance by Time Point.

  4. In the Create Instance by Time Point panel, set Restoration Mode to Database and Collection Restoration.

  5. In the Database and Collection Restoration dialog box, select a Restoration Time and the Database and Collection to Restore, then click OK.

  6. The instance status changes to Restoring from Backup. Wait until it changes back to Running.

  7. (Optional) Decide whether to overwrite the original tables with the restored temporary tables.

Local disk replica set instances

Limitations

ConstraintRequirement
Instance creation dateAfter March 26, 2019
Supported regionsChina (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Hangzhou), China (Shanghai), China (Shenzhen), or Singapore
Database version4.0 or 4.2
Storage engineWiredTiger only
Backup typePhysical backups only — logical backups are not supported
Database/collection namesLetters, numbers, and underscores (_) only — no special characters
If your database version is earlier than 4.0, upgrade the major version first. After upgrading, backup files created before the upgrade cannot be used to create new instances.
If your instance runs MongoDB 3.4 and has more than 10,000 collections and indexes, physical backups may fail. Upgrade to MongoDB 4.0 or later before performing a physical backup.

Additional notes:

  • The backup must contain the specific database you want to restore. For example, to restore the test database, the backup file must include test.

  • Restoration time depends on data volume, the task queue, and network conditions. Wait until the new instance status changes to Running.

  • The new instance uses the latest minor database version by default.

Billing

Restoring databases creates a new instance, which you are billed for. For pricing details, see Billable items.

Restore databases

  1. Go to the ApsaraDB for MongoDB replica set instances page. In the upper-left corner, select a resource group and a region, then click the target instance ID.

  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Full Backup tab, choose a restoration method:

    Restore by time point

    1. Click Create Instance by Time Point.

    2. In the Create Instance by Time Point panel, set the following parameters.

      Parameter

      Description

      Select Time Point for Restoration

      Select a point in time to restore the instance data. You can select any point in time within the last seven days.

      Note

      The restoration time must be earlier than the current time and later than the instance creation time.

      Select Database for Restoration

      Select Partial Databases and select the names of the databases that you want to restore.

      Note

      You can also click Enter Databases to manually enter the database names.

    3. Click OK.

    Restore from a backup point

    1. In the backup file list, find the target backup file and click Create Instance from Backup in the Actions column.

    2. In the Create Instance from Backup panel, select Partial Databases, then select the database names. To enter names manually, click Enter Databases.

      Note

      You can also click Enter Databases to manually enter the database names.

    3. Click OK.

  4. On the Clone Instance page, configure the new instance. For configuration details, see Create a replica set instance.

    Important

    Set the storage capacity to at least the same size as the original instance to make sure the restored data fits.

  5. Click Buy Now and complete the payment.

What's next