This topic describes how to retain the backup files of an ApsaraDB RDS for MySQL instance for a long period. Long-term retention helps you restore data when needed and protects your data assets.
Background information
When you use a database, you may encounter the following scenarios:
Your data is accidentally deleted, but only backups from the last seven days are available. As a result, you cannot restore older data.
Your RDS instance is accidentally released or is released due to an overdue payment. Because the instance has been released for a long time, both your data and backups are unrecoverable.
You want to release your RDS instance but retain its backups for future use.
Method 1: Increase the backup retention period
You can increase the number of days that backup files are retained to restore older data when needed.
This operation increases your backup size and may increase your backup storage costs.
Log on to the ApsaraDB RDS console and 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 instance ID.
In the navigation pane on the left, click Backup and Restoration.
On the Backup and Restoration page, click the Backup Strategy tab. In the Basic backup section, click Edit.
In the dialog box that appears, increase the data backup or log backup retention period. For example, you can change the default value from 7 days to 30 days.
NoteThe log backup retention period cannot exceed the data backup retention period.
If your instance uses Premium Local SSDs, select Permanently retained before instance release. After you select this option, you do not need to set a data backup retention period. All data backups are retained until the instance is released. For more information, see Automatic backup.
Click OK.
Method 2: Configure the backup retention policy after instance release
Typically, when an RDS instance expires or has an overdue payment, both the instance and its backups are retained for a period of time. After this period elapses, the instance and its backups are released and deleted. To resolve this issue, you can configure a backup retention policy for your RDS instance. Once configured, the RDS instance's backup files are retained for an extended period, even if the RDS instance is unexpectedly released. You can download the backup files from the ApsaraDB RDS console to your computer or restore the backup files to a new RDS instance to prevent data loss. This long-term retention of backup files ensures comprehensive data security.
Limits
This feature is not supported for RDS for MySQL instances that run RDS Enterprise Edition and use Premium Local SSDs.
Billing rules
After your RDS for MySQL instance is deleted, you are charged for backup storage. Backup storage is free for seven days after the instance is released. After seven days, you are charged based on the pay-as-you-go billing method. The unit prices are as follows:
You cannot purchase storage plans to offset backup storage fees for deleted RDS for MySQL instances.
Usage notes
After an RDS for MySQL instance is released, its retained backup files may take up to 30 minutes to appear on the Backups > Backup for Deleted Instances page.
If your account has an overdue payment for more than 30 consecutive days, Alibaba Cloud terminates the backup retention service for the deleted instance and permanently deletes the associated backups.
Procedure
For an RDS for MySQL cloud disk instance purchased on or after February 1, 2024, the default backup retention policy for a released instance is Latest.
Storage is free for 7 days after the instance is released. After 7 days, you are charged for backup storage. To avoid these fees, set the backup retention policy to None.
For a new RDS for MySQL instance that uses Premium Local SSDs, the default backup retention policy for a released instance is Do Not Retain.
Select a configuration method based on the current state of your instance.
Method 1: During instance purchase
This method applies only to new subscription RDS for MySQL instances that use Premium Local SSDs. You can set the Backup Retention After Release policy on the purchase page.

Method 2: Before instance release
Log on to the ApsaraDB RDS console and 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 instance ID.
In the navigation pane on the left, click Backup and Restoration.
On the Backup and Restoration page, click the Backup Strategy tab. Then, click Edit in the Basic Backup section.
In the dialog box that appears, set Retain Backup Files After Instance Release and click OK.
Latest or All (recommended): After the instance is released, the completed backups are retained based on your selection.
None: After the instance is released, no backups are retained. Data cannot be recovered. Exercise caution when you select this option.
ImportantAfter the instance is released, the system retains the backup files indefinitely based on the configured policy. You cannot specify a retention period.
Retained backup files are stored free of charge for 7 days. After 7 days, you are charged. For more information about the pricing, see Billing.
For information about how to use backup files that are retained after an instance is released, see Use backup files from a released instance.
Method 3: After instance release
Log on to the ApsaraDB RDS console. In the left-side navigation pane, click Backups. In the top navigation bar, select the region in which the RDS instance resides.
On the Backup for Deleted Instances tab, find the target instance and click Settings in the Retention Policy column.
In the dialog box that appears, set the Data Backup Retention Policy and click OK.
Latest or All (recommended): After the instance is released, the completed backups are retained based on your selection.
None: After the instance is released, no backups are retained. Data cannot be recovered. Exercise caution when you select this option.
ImportantAfter the instance is released, the system retains the backup files indefinitely based on the configured policy. You cannot specify a retention period.
Retained backup files are stored free of charge for 7 days. After 7 days, you are charged. For more information about the pricing, see Billing.
For information about how to use backup files that are retained after an instance is released, see Use backup files from a released instance.
For more information, see Configure the backup retention policy after instance release.
Method 3: Download a backup
You can also download backups to your local machine or to an Elastic Compute Service (ECS) instance for long-term storage. For more information, see Download backups.