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 use Premium Local SSDs and run on RDS Enterprise Edition.
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
For recently deleted (released) RDS for MySQL instances, backup files may take some time to appear on the Backups > Backup for Deleted Instances page. Typically, the backups appear within 30 minutes after the background instance release task is complete. Please wait.
If your account remains overdue for more than 30 days, Alibaba Cloud stops the backup retention service for deleted instances and permanently deletes related backups.
Procedure
For RDS for MySQL cloud disk instances purchased on or after February 1, 2024, the default backup retention policy for released instances is Lastest.
Storage is free for 7 days after the instance is released. After 7 days, backup storage costs are incurred. To avoid these charges, set the backup retention policy to Do Not Retain.
For new RDS for MySQL instances with Premium Local SSDs, the default backup retention policy for released instances is Do Not Retain.
Select a configuration method based on the current state of your instance.
Method 1: Configure the policy when you purchase an instance
This method applies only to new subscription RDS for MySQL instances with Premium Local SSDs. You can set the Backup Retention After Release parameter on the purchase page.

Method 2: Configure the policy on the instance details page (before 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. In the Basic Backup section, click Edit.
In the dialog box that appears, set the Retain Backup Files After Instance Release parameter and click OK.
Lastest or All: After the instance is released, completed backups are retained based on your selection.
Do Not Retain: After the instance is released, no backups are retained. Data cannot be recovered. Use this option with caution.
ImportantAfter the instance is released, the system retains the backup files for the long term 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 pricing, see Billing.
For more information about how to use backup files retained after an instance is released, see Use backup files from a released instance.
Method 3: Configure the policy on the Backup Management page (after 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 Backups 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.
Lastest or All: After the instance is released, completed backups are retained based on your selection.
Do Not Retain: After the instance is released, no backups are retained. Data cannot be recovered. Use this option with caution.
ImportantAfter the instance is released, the system retains the backup files for the long term 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 pricing, see Billing.
For more information about how to use backup files 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.