tencent cloud

Feedback

Data Backup

Last updated: 2022-02-25 18:27:52

    To avoid data loss caused by system crashes or other problems, TencentDB for MongoDB supports data backup and rollback after system recovery to ensure data integrity.

    Background

    Backup types

    • Auto backup: data is automatically backed up as scheduled according to the system's default backup policy (such as default backup interval and mode).
    • Manual backup: you can run a backup task at any time to meet your business Ops and troubleshooting requirements.

    Backup modes

    • Physical backup: in this mode, physical database files in an instance are backed up, which is fast and easy to restore with a high success rate. However, it has no portability, and the backup environment and restoration environment must be completely the same.
    • Logical backup: in this mode, the database instance is connected to, and the mongodump tool is used to save the operation logs to a logical backup file to back up the data, which can be restored by replaying the operation logs. This mode is slow but has a high portability. You can restore the logical backup of a database to database on different versions.

    Use Limits

    • Physical backups cannot be used to roll back databases/tables.
    • A backup can contain up to 7 days of continuous data; that is, you can roll back data to any time point in the last 7 days.

    Notes

    • Instance backup doesn't affect your business.
    • Backup files are stored in COS without using the storage space of TencentDB for MongoDB instances. For more information on COS, see Cloud Object Storage.

    Version Description

    VersionInstance TypeAuto BackupManual Backup
    3.2Replica set
    • Default backup mode: logical backup
    • Supported backup modes: logical backup and physical backup
    • Default backup mode: logical backup
    • Supported backup modes: logical backup and physical backup
    Sharded cluster
    • Default backup mode: logical backup
    • Supported backup modes: logical backup and physical backup
    • Default backup mode: logical backup
    • Supported backup modes: logical backup and physical backup
    3.6Replica set
    • Default backup mode: logical backup
    • Supported backup modes: logical backup
    • Default backup mode: logical backup
    • Supported backup modes: logical backup
    Sharded cluster
    • Default backup mode: logical backup
    • Supported backup modes: logical backup
    • Default backup mode: logical backup
    • Supported backup modes: logical backup
    4.0 Replica set
    • Default backup mode: logical backup
    • Supported backup modes: logical backup
    • Default backup mode: logical backup
    • Supported backup modes: logical backup
    Sharded cluster
    • Default backup mode: logical backup
    • Supported backup modes: logical backup and physical backup
    • Default backup mode: logical backup
    • Supported backup modes: logical backup and physical backup
    4.2 Replica set
    • Default backup mode: logical backup
    • Supported backup modes: logical backup and physical backup
    • Default backup mode: logical backup
    • Supported backup modes: logical backup and physical backup
    Sharded cluster
    • Default backup mode: logical backup
    • Supported backup modes: logical backup and physical backup
    • Default backup mode: logical backup
    • Supported backup modes: logical backup and physical backup

    Billing Description

    Currently, backup is free of charge. We will notify you when billing for the backup space officially starts.

    Prerequisites

    Directions

    Adjusting auto backup policy

    1. Log in to the TencentDB for MongoDB console.
    2. In the MongoDB drop-down list on the left sidebar, select Replica Set Instance or Sharded Instance. The directions for the two types of instances are similar.
    3. Above the instance list on the right, select the region.
    4. In the instance list, find the target instance.
    5. Click the target instance ID to enter the Instance Details page.
    6. Select the Backup and Rollback > Backup Task List page.
    7. Select the Auto-Backup Settings tab and click Edit.
    8. Edit Backup Mode, Backup Interval, and Backup Exception Alert according to the parameter descriptions in the following table.
    9. Click Save, and the backup task will start after 1 minute.
      ParameterDescription
      Data Backup RetentionData backup files can be retained for 7 days by default.
      Backup Mode
      • Select a backup mode optionally.
      • TencentDB for MongoDB 3.6 and 4.0 replica set instances don't support this parameter.
      Backup Interval
      • The data is backed up once every 24 hours (i.e., once every day) by default.
      • You can choose to back up the data once every 12 hours or 24 hours.
      Backup Start Time
      • The default start time is 01:00–02:00; that is, the system starts the backup task between 01:00 and 02:00 every day.
      • You can select a different time period to start data backup as needed by your business.
      • The specific start time varies by the specific scheduling of the backup task.
      Backup Exception Alert
      • It specifies whether to notify users through CM events if an exception occurs while executing a backup task.
      • Currently, only users in the allowlist can use the CM events. To get allowed, submit a ticket.
      • For more information on the supported TencentDB MongoDB events, seeProduct Event List.

    Manual backup

    1. Log in to the TencentDB for MongoDB console.
    2. In the MongoDB drop-down list on the left sidebar, select Replica Set Instance or Sharded Instance. The directions for the two types of instances are similar.
    3. Above the instance list on the right, select the region.
    4. In the instance list, find the target instance.
    5. Click the target instance ID to enter the Instance Details page.
    6. In the top-right corner of the Instance Details page, click Manual Backup.
    7. (Optional) In the pop-up window, select a backup mode. TencentDB for MongoDB 3.6 and 4.0 replica set instances don't support this parameter.
    8. Add remarks and click OK.

    Downloading backup file

    1. Log in to the TencentDB for MongoDB console.
    2. In the MongoDB drop-down list on the left sidebar, select Replica Set Instance or Sharded Instance. The directions for the two types of instances are similar.
    3. Above the instance list on the right, select the region.
    4. In the instance list, find the target instance.
    5. Click the target instance ID to enter the Instance Details page.
    6. Select the Backup and Rollback > Backup Task List page.
    7. In the Backup Task List, find the target file and click Download in the Operation column.
    8. In the Generate Backup File pop-up window, read the backup prompt carefully and click OK.
    9. Select the File Download List tab and view the backup task progress.
    10. After the task execution is completed, you can back up the data to your local device and view it as follows:
    • Over public network: click Download from Public Network in the Operation column and directly use the browser to download the backup to your local device.
    • Over private network: copy the private network address and run a wget command wget -c 'private network address' -O backup.tar in a CVM instance to download the backup at a high speed over the private network. For detailed directions on how to log in to CVM, see Customizing Linux CVM Configurations.
    API Description
    DescribeDBBackups Queries instance backup list
    CreateBackupDBInstance Backs up instance
    DescribeBackupDownloadTask Queries backup download task information
    CreateBackupDownloadTask Creates backup download task
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support