This topic describes how to retain the backup files of an ApsaraDB RDS for MySQL instance for a long period of time. The long-term retention of backup files helps you restore your data and protect your data assets.

Background information

When you use ApsaraDB RDS, you may encounter the following issues:
  • Your data is unexpectedly deleted. However, only the backup files that are generated over the most recent seven days are retained. As a result, you cannot restore the data that was generated seven days ago.
  • Your RDS instance has been released by mistake or due to overdue payments for a long period of time. As a result, you cannot recover your data or backup files.
  • You want to release your RDS instance but retain its backup files for future use.
Note If your RDS instance uses local SSDs and is unexpectedly deleted or released, the most recent backup file is retained by default. You can download the most recent backup file on the Backup for Deleted Instances tab and use the file to restore data. For more information, see Retain backup files after instance release.

Increase the backup retention period

You can increase the backup retention period to restore earlier data.
Note This operation increases the size of your backup files and may also increase the storage costs of your RDS instance. For more information, see View and manage the size of backup files for an ApsaraDB RDS for MySQL instance and Backup storage pricing of an ApsaraDB RDS for MySQL instance.
  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane of the page that appears, click Backup and Restoration.
  3. On the page that appears, click the Backup Strategy tab.
  4. In the Base Backup section, click Edit to shorten the retention period of a data backup file.
    • You can manually specify the number of days for which you want to retain data backup files. For example, you can increase the value from the default value 7 to 30.
    • If your RDS instance is equipped with local SSDs, you can select Long-term Retention. After you select Long-term Retention, you do not need to specify the data backup retention period. All data backup files are retained.
  5. Increase the log backup retention period.
    Note The retention period for log backup files cannot be longer than the retention period for data backup files.
  6. Click Confirm.

Retain backup files after instance release

In most cases, after your RDS instance expires or becomes overdue, ApsaraDB RDS retains your RDS instance and its backup files based on the retention period that you specify. After the retention period elapses, ApsaraDB RDS releases your RDS instance and deletes its backup files. For more information, see Expired and overdue ApsaraDB RDS instances.
Note This operation is supported only for RDS instances that run MySQL and use local SSDs.

Billing rules

If your RDS instance is deleted, the backup files of the RDS instance are retained free of charge within seven days. After the 7-day retention period elapses, you are charged fees for the storage of the backup files. The backup storage starts to generate fees in some regions on September 14, 2022 and in other regions on September 20, 2022. For more information about billing rules, see [Notice] Backup storage fees are generated for deleted ApsaraDB RDS instances from September 14, 2022 in some regions.

Usage notes

On the Details page of the Alibaba Cloud console, the ID of the Database Backup (DBS) backup schedule that you purchase to back up an RDS instance is displayed in one of the following formats:
  1. A string that starts with dbs. Example: dbsrkzlXXXXXXXX.

    If the ID is in this format, you cannot identify the RDS instance for which the DBS backup schedule is purchased.

  2. A string that starts with dbs and contains the name of an RDS instance. Example: dbs:rm-bpXXXXXX.

    If the ID is in this format, you can identify the RDS instance for which the DBS backup schedule is purchased.

Procedure

  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane of the page that appears, click Backup and Restoration.
  3. On the page that appears, click the Backup Strategy tab.
  4. In the Base Backup section, click Edit. In the dialog box that appears, set the Retain Backup Files After Instance is Released parameter to Latest or All.
    Note
    • If you set the parameter to Latest or All, backup files are retained for a long period of time, and the backup retention period cannot be specified.
    • The Retain Backup Files After Instance is Released parameter is supported for both pay-as-you-go RDS instances and subscription RDS instances.
  5. Click Confirm.

Download a backup file

You can download a backup file of your RDS instance to your computer or to your Elastic Compute Service (ECS) instance. The backup file can be stored on your computer or ECS instance for a long period of time. For more information, see What is ECS? and Perform a standard download.

FAQ

  • The Retain Backup Files After Instance is Released parameter is set to Latest for my RDS instance before the RDS instance is released. Where is the retained backup file stored?

    After your RDS instance is released, you can go to the Backup for Deleted Instances tab to download the backup file of your RDS instance. Then, you can use the backup file for restoration.

  • My RDS instance is released but storage fees are still generated. Why?

    Backup files may be retained for your RDS instance, and fees are generated for the retention of backup files.
    Note
    • If your RDS instance is deleted due to unintended operations or is released, the most recent backup file is retained by default. You can download the backup file on the Backup for Deleted Instances tab and use the downloaded backup file to restore data.
    • If you do not need to retain backup files, you can perform the following operations before you release the instance: Go to the Backup and Restoration page of your RDS instance. On the Backup Strategy tab of the page that appears, click Edit in the Base Backup section to set the Retain Backup Files After Instance is Released parameter to None.