All Products
Search
Document Center

ApsaraDB RDS:Retain the backup files of an ApsaraDB RDS for MySQL instance for a long period of time

Last Updated:Sep 21, 2023

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 due to unintended operations or 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.

Method 1: 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 and Backup storage fees.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane of the page that appears, click Backup and Restoration.

  3. On the Backup and Restoration page, click the Backup Strategy tab. In the Basic Backup section of the tab that appears, click Edit.

  4. In the dialog box that appears, manually increase the data backup retention period or the log backup retention period. For example, you can increase the value from the default value 7 to 30.

    Note
    • The log backup retention period cannot be longer than the data backup retention period.

    • If your RDS instance uses local disks, you can select Permanently Retained before Instance Release. After you select Permanently Retained before Instance Release, you do not need to specify the data backup retention period. All data backup files are retained. For more information, see Use the automatic backup feature.

  5. Click OK.

Method 2: Configure the backup retention policy after the instance is released

In most cases, after your RDS instance expires or becomes overdue, the system retains your RDS instance and its backup files based on the retention period that you specify. After the retention period elapses, the system releases your RDS instance and deletes its backup files. For more information, see Overdue payments. To resolve this issue, you can configure a backup retention policy for your RDS instance seven days after the RDS instance is created. After the configuration, the backup files of the RDS instance are retained for a long period of time even if the RDS instance is released.

Prerequisites

Your RDS instance uses local disks and was created at least seven days ago.

Note

If your RDS instance uses cloud disks, you cannot configure a backup retention policy for released RDS instances. You can go to the Basic Information page of your RDS instance to view the preceding information.

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 for the storage of the backup files. 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: dbsrkzl******.

    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 followed by 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. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane of the page that appears, click Backup and Restoration.

  3. On the Backup and Restoration page, click the Backup Strategy tab. In the Basic Backup section, click Edit.

  4. In the dialog box that appears, set the Retain Backup Files after Instance Release parameter to Latest or All.

    Note
    • After the RDS instance is released, the backup files of the RDS instance are retained for a long period of time, but you do not need to specify the retention period. You can go to the Backup for Deleted Instances tab to download the backup files of your RDS instance and use the backup files to restore the data of the RDS instance. You can also modify the backup retention policy of the RDS instance to Delete All Backups (Cannot be Restored) based on your business requirements.

    • You can configure a backup retention policy for released RDS instances that use local disks and are created for more than seven days.

  5. Click OK.

Method 3: 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 Download the backup files of an ApsaraDB RDS for MySQL instance.

FAQ

  • The Retain Backup Files after Instance Release 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?

    A backup retention policy may be configured for your released RDS instance. The backup files of the RDS instance are retained after the RDS instance is released, and fees are generated for the retention of the generated backup files. Therefore, even if your RDS instance is released, the storage fee will appear on the subsequent bills. For more information, see Retain the backup files of an ApsaraDB RDS for MySQL instance for a long period of time.

    Note

    If you do not want to retain the backup files after your RDS instance is released, you can go to the Backup for Deleted Instances tab to modify the backup retention policy of the RDS instance to Delete All Backups (Cannot be Restored) based on your business requirements.