Long-term backup retention

更新时间:
复制 MD 格式

You can retain backup files for your instances long-term to recover data when needed and protect your data assets.

Background

You might encounter the following scenarios:

  • Your data is accidentally deleted, but you have only backups from the last 7 days and cannot restore earlier data.

  • Your instance is released, either accidentally or due to a forgotten renewal. If the instance remains released for too long, you can no longer recover its data or backups.

  • You need to release an ApsaraDB for MongoDB instance but want to retain its backups long-term.

Method 1: Extend the backup retention period

You can extend the retention period of backup files to restore data from an earlier point in time when needed.

Important

Extending the backup retention period increases the storage space required for an instance's backups, leading to higher costs.

  1. Go to the MongoDB Replica Set Instances or MongoDB Sharded Cluster Instances page. In the upper-left corner of the page, select a resource group and a region. Then, click the ID of the target instance.

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

  3. Click Backup Settings.

  4. In the Backup Settings panel, increase the values for Full Backup Retention Period (Days) and Log Backup Retention Period (Days). For example, change the retention period from 7 days to 30 days.

    Note
  5. Click Confirm.

Method 2: Configure backup retention for released instances

Prerequisites

The ApsaraDB for MongoDB instance must meet the following requirements:

  • Instance type: a replica set or sharded cluster instance.

  • Instance storage type: ESSD.

Billing

Backup sets for released instances are stored free of charge for the first seven days, after which storage fees apply.

Storage region

Unit price (CNY/GB/day)

China (Beijing), China (Hohhot), China (Ulanqab), China (Hangzhou), China (Shanghai), China (Shenzhen), China (Heyuan), China (Chengdu), China (Qingdao), China (Guangzhou), China (Zhangjiakou)

0.006

China (Hong Kong), US (Silicon Valley), US (Virginia), Singapore, Japan (Tokyo), Germany (Frankfurt), Malaysia (Kuala Lumpur), Indonesia (Jakarta), Philippines (Manila), UK (London), South Korea (Seoul), Thailand (Bangkok)

0.0072

Procedure

  1. Go to the MongoDB Replica Set Instances or MongoDB Sharded Cluster Instances page. In the upper-left corner of the page, select a resource group and a region. Then, click the ID of the target instance.

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

  3. Click Backup Settings.

  4. In the Backup Settings panel, configure the Retention Policy.

    Policy

    Description

    Delete all backup sets when you release the instance

    For seven days after the instance is released, the last backup set is displayed in the recycle bin. You can restore the data to a new instance before this backup set is deleted.

    Automatically back up data when you release the instance and retain the final backup set long-term

    The final backup is retained long-term. This backup set appears in the recycle bin and can be used to restore data to a new instance.

    Automatically back up data when you release the instance and retain all backup sets for the instance long-term

    All backups are retained long-term. The recycle bin displays all backup sets of the instance. You can use them to restore data to a new instance.

    Note
    • Once you configure the backup retention policy, backup files are retained accordingly when the instance is released. You can go to the recycle bin to restore data or modify the backup retention policy.

    • For more information about other backup settings, see Automatically back up ApsaraDB for MongoDB data.

  5. Click Confirm.

Method 3: Download backup files

You can also download backup files to a local machine or an ECS instance for long-term storage.

Prerequisites

The ApsaraDB for MongoDB instance must meet the following requirements:

  • Major version: MongoDB 4.2 or earlier.

  • Instance storage type: local disk.

  • Backup method: physical backup.

Procedure

For detailed instructions on how to download backup files, see Download backup files.