Database Backup (DBS) provides a variety of features such as single-table restoration, remote backup, full backup, incremental backup, and long-term archiving to back up and restore MongoDB instances.

Features

Feature Description
SQL file backup DBS logically backs up data in the JSON format.
Backup data query DBS allows you to query backup data by using SQL statements without the need to restore data. For more information, see Query backup sets by using SQL statements.
Remote backup DBS can back up a MongoDB instance to an Object Storage Service (OSS) bucket that is deployed in the destination region. DBS allows you to restore the backup data to a MongoDB instance in the source, the destination, or a different region.
Long-term archiving DBS can retain your backup data for up to five years. After five years, DBS transfers the backup sets to Archive storage.
Fine-grained backup DBS allows you to back up a single table, a single database, multiple databases, or an entire MongoDB instance.
Backup speed limit DBS allows you to limit the backup speed to reduce the negative impact of backup operations on database performance.
Single-table restoration DBS allows you to restore a single table without the need to restore the entire MongoDB instance. This way, the restoration time is reduced.

Create a backup schedule

Create a backup schedule. For more information, see Purchase a backup schedule.
Note When you purchase a backup schedule, set Database Type to MongoDB and Backup Method to Logical Backup.

Configure a backup schedule

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Schedules. On the Backup Schedules page, select a region in the upper-left corner.
    Select a region
  3. On the Backup Schedules page, click Configure Backup Schedule in the Actions column corresponding to the backup schedule that you purchased.
  4. In the Configure Backup Source and Destination step of the Configure Backup Schedule wizard, set the parameters as described in the following table to configure the backup source and destination.
    Section Parameter Description
    None Schedule Name The name of the backup schedule. DBS generates a backup schedule name. We recommend that you set a descriptive name that is easy to identify. Backup schedule names do not have to be unique.
    Backup Source Information Backup Mode The method that is used to back up data. Default value: Logical Backup.
    Database Location The location of the database that you want to back up. Valid values:
    • User-Created Database with Public IP Address <IP Address:Port Number>
    • ECS-Hosted Database
    • ApsaraDB for MongoDB
    • Express Connect DB/VPN Gateway/Intelligent Gateway
    • No public network IP: Port's self-built database (accessed through the database gateway)
    Note
    • If you set Database Location to ApsaraDB for MongoDB, DBS automatically reads data from the secondary database to perform a full backup.
    • If you set Database Location to User-Created Database with Public IP Address <IP Address:Port Number> or Express Connect DB/VPN Gateway/Intelligent Gateway, you can choose whether to configure the connection address of the secondary database.
    Configuration of connection address of standby database Specifies whether to configure the connection address of the secondary database. This way, DBS can read data from the secondary database to perform a full backup.
    Database Type The type of the database to be backed up. By default, the database type selected when the backup schedule is created is used.

    If you set Database Location to ApsaraDB for MongoDB, this parameter is unavailable.

    Instance Region The region where the database that you want to back up resides.

    This parameter is available only when you set Database Location to ECS-Hosted Database, ApsaraDB for MongoDB, or No public network IP: Port's self-built database (accessed through the database gateway).

    Address The public endpoint used to connect to the database that you want to back up.

    This parameter is available only when you set Database Location to User-Created Database with Public IP Address <IP Address:Port Number>, Express Connect DB/VPN Gateway/Intelligent Gateway, or No public network IP: Port's self-built database (accessed through the database gateway).

    Port Number The port number used to connect to the database that you want to back up.

    If you set Database Location to ApsaraDB for MongoDB, this parameter is unavailable.

    ECS Instance ID The ID of the Elastic Compute Service (ECS) instance where the database that you want to back up resides.

    This parameter is available only when you set Database Location to ECS-Hosted Database.

    MongoDB Instance ID The ID of the MongoDB instance that you want to back up. This parameter is available only when you select ApsaraDB for MongoDB.

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

    Peer VPC The virtual private cloud (VPC) where the database that you want to back up resides.

    This parameter is available only when you set Database Location to Express Connect DB/VPN Gateway/Intelligent Gateway.

    Database gateway instance ID The ID of the database gateway instance.

    This parameter is available only when you set Database Location to No public network IP: Port's self-built database (accessed through the database gateway).

    Database Name The name of the database that you want to back up.
    Database Account The username of the account used to connect to the database that you want to back up.
    Password The password of the account 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 of the database that you want to back up is correct. If the specified parameters are valid, the Test Passed message appears. If the Test Failed message appears, click Check next to Test Failed. Modify the information about the database that you want to back up based on the check results.

    Backup Destination Information Backup Storage Type The storage type of the backup data. Valid values:
    • DBS built-in storage
    • OSS for user
    Note In this example, DBS built-in storage is selected. If you select OSS for user, you must set the OSS Bucket Name parameter.
    OSS Bucket Name The name of the OSS bucket that you want to use to store data.

    This parameter is available only when you set Backup Storage Type to OSS for user.

    Storage Encryption The method used to encrypt the stored data. Valid values:
  5. In the lower-right corner of the page, click Next.
  6. In the Edit Backup Objects step, find the database or table that you want to back up in the Available section. Click the right arrow to add the selected database or table to the Selected section. Then, click Next.
    Note If you back up an entire database, the permission data and stored procedures are also backed up.
  7. In the Configure Backup Time step, set the parameters as described in the following table and click Next.
    Parameter Description
    Full-scale Backup Frequency The frequency of the backup schedule. Valid values: Periodic Backup and Single Backup.
    Note If you select Periodic Backup, you must set the Full Data Backup Recurrence and Full Data Backup Start At parameters.
    Full Data Backup Recurrence The days of the week on which DBS runs the backup schedule.
    Full Data Backup Start At The start time of the backup.
    Note If the time required to complete a full data backup is longer than the backup interval, DBS skips the next backup.
    Real-Time Transaction Log Backup Specifies whether to enable incremental backup.
    Maximum Concurrent Threads for Full Data Backup The maximum number of concurrent threads available for a full data backup.
    Note This value varies with the instance type of the purchased backup schedule.
  8. In the Edit Lifecycle step, configure the lifecycle for a full data backup in the Configure Full Data Backup Lifecycle section.
    Note If you select Enable for the Real-Time Transaction Log Backup parameter, you must configure the backup time for incremental backup data.
  9. After the configuration is complete, click Precheck in the lower-right corner of the page.
  10. If the Precheck Passed message appears, click Start Task.
    Note When the status of the backup schedule changes to Running, the backup schedule takes effect.
    After data is backed up, you can view the backup schedule and restore the backup data. For more information, see View backup schedules and Restore MongoDB databases.