All Products
Search
Document Center

Data Management:Logical backup and restore for ApsaraDB for MongoDB

Last Updated:Jun 22, 2026

Data Disaster Recovery (DBS) supports single-collection restoration, geo-redundancy, full or incremental backups, and long-term archiving for ApsaraDB for MongoDB databases. You can use DBS to automate backups and restore data for an ApsaraDB for MongoDB database.

Features

Feature

Description

Backup file format

Uses the logical backup method to create backup files in JSON format.

Geo-redundancy

Back up your ApsaraDB for MongoDB database to an Object Storage Service (OSS) bucket in a destination region. You can then restore the data to an ApsaraDB for MongoDB database in the source region, the destination region, or a different region.

Long-term archiving

Retain backup sets for up to 10 years. Backup sets are automatically moved to archive storage.

Granular backups

Back up a single collection, a single database, multiple databases, or an entire database instance.

Single-collection restoration

Restore a single collection without restoring the entire ApsaraDB for MongoDB database, reducing recovery time. When you configure objects to restore, you can select the target collection.

Create a backup schedule

To create a backup schedule, see Create a backup schedule.

Note
  • When you purchase a backup schedule, select MongoDB as the database type and Logical Backup as the backup method.

  • For details on the backup and restoration granularity that DBS supports for ApsaraDB for MongoDB, see Supported database types and features.

Configure a backup schedule

  1. Log on to the Data Management Service (DMS) 5.0 console.

  2. In the top navigation bar, choose Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

    Note

    If you use the DMS console in simple mode, move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner of the DMS console and choose All Features > Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

  3. Find the target backup schedule and click Configure Backup Schedule in the Actions column.

  4. On the Configure Backup Source and Destination page, configure the backup source and destination information, and then click Next.

    Section

    Parameter

    Description

    N/A

    Schedule Name

    DBS automatically generates a schedule name. We recommend that you specify a descriptive name for easy identification. The name does not have to be unique.

    Backup source information

    Backup Mode

    Currently, only logical backup is supported.

    Database Location

    ApsaraDB for MongoDB

    Region

    Select the region of the source instance.

    Note

    This parameter is displayed only when Database Location is set to Self-managed database on an ECS instance, ApsaraDB for MongoDB, or Self-managed database without a public IP, accessed through Database Gateway (DG).

    MongoDB Instance ID

    Select the ID of the ApsaraDB for MongoDB instance that you want to back up.

    Note

    This parameter is displayed only when Database Location is set to ApsaraDB for MongoDB.

    Database Name

    Enter the database name.

    Database Account

    Enter the database account.

    Note

    Ensure that the account has read permissions on the local database.

    Password

    The password of the account that is used to connect to the database that you want to back up.

    After you enter the username and password of the database account, click Test Connection next to the password to check whether the information about the database that you want to back up is valid. If the specified parameters are valid, the Test Passed message is displayed. If the Test Failed message is displayed, click Check next to Test Failed. Modify the information about the database that you want to back up based on the check results.

    Compliance warranty regarding cross-border data transfers

    Read and agree to the compliance commitment by selecting the check box.

    Backup Destination Information

    Backup Storage Type

    The storage type for backup data. The following options are available:

    • DBS Storage (recommended): You do not need to create a bucket. Data is automatically stored in DBS Storage. You are charged for the amount of data stored. For more information about billing, see Storage fees.

    • OSS For User: You must create a bucket in OSS in advance. For more information, see Create a bucket.

    Note
    • This example uses DBS Storage. If you select Object Storage Service (OSS), you must also configure the OSS Bucket Name parameter. Only the OSS Standard storage class is supported.

    • If you store large amounts of data, we recommend purchasing a subscription storage plan to reduce costs. Subscription plans are more cost-effective than pay-as-you-go billing.

    Storage Encryption

    The encryption method for backup storage. The following options are available:

    • Encrypted (recommended): Uses the industry-standard AES-256 algorithm for encryption.

      OSS supports server-side encryption. When you upload an object, OSS encrypts it before saving it. When you download the object, OSS automatically decrypts it for you. For more information, see Server-side encryption.

    • Non-encrypted: Encryption is not enabled.

  5. On the Edit Backup Objects page, move the databases or collections that you want to back up to the Selected pane, and then click Next.

    Note
    • You can back up specific databases or collections. To back up all existing databases, click Select All. The supported backup objects depend on the database type. For more information, see Supported database types and features.

    • Backup tasks do not include newly created databases by default. To back up a new database, you must add it to the backup schedule configuration. For more information, see Modify backup objects.

  6. On the Configure Backup Time page, configure the backup time and other settings, and then click Next.

    Parameter

    Description

    Full backup frequency

    The frequency of the backup schedule. Valid values: Periodic Backup and Single Backup.

    Note

    If you select Periodic Backup, you must configure the Full Data Backup Recurrence and Start At parameters.

    Full backup recurrence

    The days of the week on which DBS runs the backup schedule. You can select one or more days of a week. Select at least one day of the week.

    Start at

    The start time of the backup. We recommend that you set a point in time within off-peak hours. Example: 01:00.

    Note

    If a previous full data backup is not finished at the start time of the next backup, DBS skips the next backup.

    Incremental backup

    Specifies whether to enable incremental backup.

    This parameter is displayed only if you set the Full-scale Backup Frequency parameter to Periodic Backup.

    Maximum concurrent threads for full backup

    The maximum number of concurrent threads available for a full backup. You can set this parameter to adjust the backup speed. For example, you can reduce the number of backup threads to minimize impacts on the database.

  7. On the Edit Lifecycle page, specify the retention period for full backup data in DBS Storage.

    If you enabled Incremental Backup in the previous step, you must also configure the retention period for incremental backups. For more information about the backup data lifecycle, see Manage the lifecycle of backup data.

  8. After the preceding configurations are complete, click Precheck in the lower-right corner of the page.

  9. In the Precheck dialog box, after the precheck is passed, click Start Task.

    Note
    • Wait for the Status of the backup schedule to change to Running. This status indicates the schedule is active.

    • If an error occurs, troubleshoot and resolve it promptly. For more information, see How to fix an abnormal backup schedule. If the issue persists after you follow the suggestions, contact us for technical support through the DingTalk group (ID: 35585947).

Restore data

  1. Log on to the Data Management Service (DMS) 5.0 console.

  2. In the top navigation bar, choose Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

    Note

    If you use the DMS console in simple mode, move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner of the DMS console and choose All Features > Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

  3. On the Backup Schedules page, find the backup schedule that you want to manage and click Manage in the Actions column.

  4. On the Configure Task page, click Restore Database in the upper-right corner.

  5. On the Configure Restore Time Point page, configure the following information and click Next.

    For the destination database, you also need to configure Region, MongoDB Instance ID, Database Name, Database Account, and Password. You can click Test Connection to verify connectivity. Then, select the Data Cross-border Compliance Commitment and click Next.

    Section

    Parameter

    Description

    N/A

    Task Name

    A task name is automatically generated. We recommend that you specify a descriptive name for easy identification. The name does not have to be unique.

    Restore time point

    Restorable Time Range

    Displays the time range within which data can be restored.

    Selected Restore Time Point

    Select a restore point within the available time range.

    Destination database

    Database Location

    The location of the destination database. The following options are available:

    • No public network IP: Port's self-built database (accessed through the database gateway): Restores data to a self-managed database by using Database Gateway (DG). You must configure a database gateway for the destination instance in advance and select the Gateway Instance ID in this step.

    • User-Created Database with Public IP Address <IP Address:Port Number>: Restores data to a self-managed database that is accessible over the internet. You must also configure the public endpoint and port of the destination database.

    • ECS-Hosted Database: Restores data to a database on an ECS instance. You must also configure the ECS Instance ID and port of the destination database instance.

    • ApsaraDB for MongoDB

    • Express Connect DB/VPN Gateway/Intelligent Gateway: Restores data to a self-managed database over a VPC. You must configure the VPC for the destination instance in advance and select the target Peer VPC in this step.

    Database Type

    Defaults to the database type you selected when creating the backup schedule.

    Note

    This parameter is not displayed when Database Location is set to ApsaraDB for MongoDB.

    Region

    Select the region of the destination instance.

    Note

    This parameter is displayed only when Database Location is set to Self-managed database on an ECS instance, ApsaraDB for MongoDB, or Self-managed database without a public IP, accessed through Database Gateway (DG).

    Endpoint

    The public endpoint of the destination database.

    Note

    This parameter is displayed only when Database Location is set to Self-managed database with a public IP, Self-managed database connected over Express Connect, VPN Gateway, or Smart Access Gateway, or Self-managed database without a public IP, accessed through Database Gateway (DG).

    Port

    The connection port of the destination database.

    Note

    This parameter is not displayed when Database Location is set to ApsaraDB for MongoDB.

    ECS Instance ID

    Select the ID of the ECS instance to which you want to restore data.

    Note

    This parameter is displayed only when Database Location is set to Self-managed database on an ECS instance.

    MongoDB Instance ID

    Select the ID of the ApsaraDB for MongoDB instance to which you want to restore data.

    Note

    This parameter is displayed only when Database Location is set to ApsaraDB for MongoDB.

    Peer VPC

    Select the VPC.

    Note

    This parameter is displayed only when Database Location is set to Self-managed database connected over Express Connect, VPN Gateway, or Smart Access Gateway.

    Gateway Instance ID

    Select the Database Gateway (DG) instance.

    Note

    This parameter is displayed only when Database Location is set to Self-managed database without a public IP, accessed through Database Gateway (DG).

    Database Name

    Enter the database name.

    Database Account

    Enter the database account.

    Password

    Enter the password for the database account.

    Note

    After you enter the account credentials, you can click Test Connection to verify if the database information is correct. If the connection is successful, a success message appears. If the connection fails, click Diagnose next to the failure message and adjust the settings as prompted.

    Compliance warranty regarding cross-border data transfers

    Read and agree to the compliance commitment by selecting the check box.

  6. On the Configure Objects to Restore page, configure the following information, and then click Precheck.

    Parameter

    Description

    Conflict handling

    By default, Conflict Handling is set to Rename Object with the Same Name. For example, if you restore a collection named job_info to a destination that already has a collection with the same name, the system renames the restored collection to job_info_dbs_<RestoreTaskID>_<Timestamp>.

    Objects to restore

    In the Source Database Objects pane, select the databases or collections you want to restore and move them to the Selected Database Objects pane.

    Note

    Some database engines support restoring at the single-collection or single-database level. This reduces the amount of data to restore and shortens the recovery time objective (RTO). For details on the supported restoration granularity, see Supported database types and features.

  7. In the Precheck dialog box, after the Precheck Passed message is displayed, click Start Task.

    You can monitor the restoration progress on the Restore Tasks tab.

    Note

    Restoration time depends on the backup schedule specifications and database size. Higher specifications result in faster restoration. For more information, see Performance tests on logical backup and restoration.

Related operations