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.
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.
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 left-side navigation pane, 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, 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.
NoteThe 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.
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 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. The long-term retention of backup files ensures data security in a comprehensive manner.
Limits
The feature is not supported for RDS instances that run RDS Enterprise Edition and use local disks.
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 based on the pay-as-you-go billing method. The following tables describe the unit prices. The following tables describe the unit prices.
You cannot purchase storage plans to offset the backup storage fees of deleted RDS instances.
Usage notes
When you delete or release an RDS instance, the retained backup files of the RDS instance are displayed with specific latencies. In most cases, the retained backup files are displayed within 30 minutes after the background task is completed.
Procedure
If your RDS instance uses cloud disks and is created on or after February 1, 2024, the Backup Retention After Release parameter of the RDS instance is automatically set to Latest.
If the RDS instance is deleted, the backup files of the RDS instance are retained free of charge for seven days. After the seven-day retention period elapses, you are charged for the storage of the backup files. If you want to prevent the storage cost, you can configure the backup retention policy to None.
When you create an RDS instance that uses local disks, the Backup Retention After Release parameter of the RDS instance is automatically set to None.
You can configure a backup retention policy based on the status of an RDS instance.
Method 1: Configure a backup retention policy when you create the RDS instance
You can use this method only when you create a subscription RDS instance that uses local disks. On the ApsaraDB RDS buy page, you can configure the Backup Retention After Release parameter.
Method 2: Configure a backup retention policy on the instance details page before the RDS instance is released
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 left-side navigation pane, 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, configure the Data Backup Retention Policy parameter and click OK. Valid values of the Data Backup Retention Policy parameter:
Latest: After the RDS instance is released, the most recent backup file of the RDS instance is stored in the ApsaraDB RDS console. We recommend that you set the parameter to this value.
All: After the RDS instance is released, all backup files of the RDS instance are stored in the ApsaraDB RDS console. We recommend that you set the parameter to this value.
None: After the RDS instance is released, no backup files of the RDS instance are retained and the data of the RDS instance cannot be restored. Proceed with caution.
ImportantAfter the configuration is complete and your RDS instance is released, the backup files of the RDS instance are retained for a long period of time. You cannot specify the retention period.
The backup files of the RDS instance are retained free of charge for seven days. After the seven-day retention period elapses, you are charged for the storage of the backup files. For more information, see Billing rules.
For more information about how to use the retained backup files after an RDS instance is released, see Use the retained backup files of an RDS instance after the RDS instance is deleted.
Method 3: Configure a backup retention policy on the Backups page after the RDS instance is released
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 required RDS instance and click Settings in the Retention Policy column.
In the dialog box that appears, configure the Data Backup Retention Policy parameter and click OK. Valid values of the Data Backup Retention Policy parameter:
Latest: After the RDS instance is released, the most recent backup file of the RDS instance is stored in the ApsaraDB RDS console. We recommend that you set the parameter to this value.
All: After the RDS instance is released, all backup files of the RDS instance are stored in the ApsaraDB RDS console. We recommend that you set the parameter to this value.
None: After the RDS instance is released, no backup files of the RDS instance are retained and the data of the RDS instance cannot be restored. Proceed with caution.
ImportantAfter the configuration is complete and your RDS instance is released, the backup files of the RDS instance are retained for a long period of time. You cannot specify the retention period.
The backup files of the RDS instance are retained free of charge for seven days. After the seven-day retention period elapses, you are charged for the storage of the backup files. For more information, see Billing rules.
For more information about how to use the retained backup files after an RDS instance is released, see Use the retained backup files of an RDS instance after the RDS instance is deleted.
For more information, see Use the backup for deleted instances feature.
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.