All Products
Search
Document Center

ApsaraDB RDS:Retain backup files for a long period of time

Last Updated:Feb 06, 2024

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, 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, 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. 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 meets the following requirements:

  • The RDS instance runs MySQL 8.0, MySQL 5.7, or MySQL 5.6

  • The RDS instance uses local disks or cloud disks.

  • The RDS instance runs RDS Basic Edition, RDS High-availability Edition, or RDS Cluster Edition.

Note

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 Billing rules.

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, 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 Retain Backup Files after Instance Release to Latest or All.

    Note

    After the configuration, if your RDS instance is released, the backup files of your RDS instance are retained for a long period of time. You cannot 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 your RDS instance. You can also modify the backup retention policy of your RDS instance to Delete All Backups (Cannot be Restored) based on your business requirements.

  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 backup files.

FAQ