Automatic backup and manual backup are supported for ApsaraDB RDS for MySQL instances and serverless ApsaraDB RDS for MySQL instances.
For more information about how to use the automatic backup feature for an RDS instance that runs a different database engine, see the following topics:
The automatic backup feature that is provided by ApsaraDB RDS stores backup files in the same region as your RDS instance. If you want to store backup files to a region that is different from the region of your RDS instance, follow the instructions provided in Use the cross-region backup feature of an ApsaraDB RDS for MySQL instance.
Introduction to backups
You can back up your RDS instance by using one of the following methods:
ApsaraDB RDS: The system provides a default backup feature that supports full data backups and incremental log backups.
DBS: Database Backup (DBS) provides the logical backup feature. The logical backup supports advanced capabilities such as cross-account backup and quick query.
For more information about the differences between the default backup feature of ApsaraDB RDS and the logical backup feature of DBS, see Differences between default RDS backups and advanced DBS backups.
Use ApsaraDB RDS to perform automatic backups
ApsaraDB RDS supports automatic data backups and automatic log backups. Data backups cannot be disabled. However, you can change the data backup frequency based on your business requirements.
Instance category | Minimum frequency | Maximum frequency |
| Twice every week | Once every day. |
RDS instances that run RDS High-availability Edition or RDS Cluster Edition with cloud disks | Once every 15 minutes. You must enable the Increase Snapshot Frequency feature. |
Prerequisites
If this is the first time you use the backup feature of ApsaraDB RDS, you must attach the AliyunServiceRoleForDBS policy by using your Alibaba Cloud account. For more information, see How do I create a service-linked role for DBS?
Usage notes
If the minor engine version of your RDS instance meet the following conditions, the RDS instance cannot be backed up after it is locked:
Any minor engine version if the RDS instance runs MySQL 5.1 or MySQL 5.5.
20190815 or earlier if the RDS instance runs MySQL 5.6, MySQL 5.7, or MySQL 8.0.
NoteFor more information about how to upgrade the major engine version or update the minor engine version of an RDS instance, see Upgrade the major engine version of an ApsaraDB RDS for MySQL instance or Update the minor engine version of an ApsaraDB RDS for MySQL instance.
For more information, see What do I do if my ApsaraDB RDS instance is in the Locking state?
You can configure a binlog retention policy for a read-only RDS instance but cannot configure an automatic backup policy for the read-only RDS instance. For more information, see Delete the binary log files of an ApsaraDB RDS for MySQL instance.
Do not execute DDL statements during a backup operation. If DDL statements are executed during a backup operation, the relevant tables are locked and the backup operation fails.
We recommend that you back up data during off-peak hours.
If the number of tables that are created on your RDS instance exceeds 600,000, you cannot back up the data. In this case, we recommend that you shard the databases on your RDS instance.
If the number of tables that are created on your RDS instance exceeds 50,000, you cannot restore individual databases or tables. For more information, see Restore individual databases and tables for an ApsaraDB RDS for MySQL instance.
Procedure
- 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.
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 of the tab that appears, click Edit.
Configure the following parameters and click OK.
NoteIf your RDS instance uses cloud disks, the system creates snapshots to back up the data of the RDS instance.
Table 1. Data backup settings Instance category
Parameter
Description
All RDS instances
Backup retention in days
The number of days for which backup files are retained. Default value: 7. Valid values:
For RDS instances that use cloud disks: 7 to 730.
NoteIf your RDS instance runs MySQL 5.7 on RDS Basic Edition, the value is fixed as 7.
If you enable the single-digit second backup feature, the value of this parameter ranges from 7 to 730.
For RDS instances that use local disks: 7 or more. The value must be less than 2 to the power of 31.
Data backup files that are retained for 730 days or less are considered regular backup files.
Data backup files that are retained for more than 730 days are converted into archived backup files. The cost of archived backup files is less than the cost of regular backup files. For more information, see Backup storage pricing of an ApsaraDB RDS for MySQL instance.
NoteIf you set this parameter to a value greater than 730 or select Long-term Retention, you must specify the number of archived backup files to retain. For example, if you select Monthly and enter 2 in the unit field, the system retains the first two archived backup files that are generated each month.
Full Backup Cycle
The cycle based on which data backups are created. You must select at least two days of the week.
Start At
The time at which a data backup starts. For example, you can select 08:00. We recommend that you select an off-peak hour.
RDS instances that use local disks
Database/Table Restoration
Specifies whether to enable the restoration feature for individual databases and tables. For more information, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance The restoration feature for individual databases and tables is automatically enabled and cannot be disabled.
NoteThe restoration feature for individual databases and tables is supported for RDS instances that run MySQL 8.0, MySQL 5.7, or MySQL 5.6 on RDS High-availability Edition and use local disks.
After you enable the restoration feature for individual databases and tables, a new backup file format takes effect. For more information, see [Product changes/Feature changes] New physical backup file format is phased in for some ApsaraDB RDS for MySQL instances.
Fast Restoration
Specifies whether to enable the fast restoration feature for individual databases and tables. If you enable the fast restoration feature for individual databases and tables, the data is restored at a fast speed. If you disable the fast restoration feature, the data is restored at a standard speed. For more information, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance.
Standard: Data is restored at a standard speed.
Fast: Data is restored at a speed that is 50% to 95% faster than standard restoration.
NoteIf you enable the fast restoration feature for individual databases and tables, you must also configure the CDM Billing Method and CDM Retention Period parameters.
The fast restoration feature for individual databases and tables is not supported in some Alibaba Cloud regions.
Retain Backup Files after Instance Release
Specifies whether to retain backup files after the RDS instance is released.
NoteThis parameter is displayed and can be configured only when your RDS instance uses local disks and was created at least seven days ago.
We recommend that you select Latest or All. After your RDS instance is released, you can go to the Backup for Deleted Instances tab to download the backup files of your RDS instance. Then, you can use the backup files to restore the data of your RDS instance. For more information, see Configure the backup retention policy after the instance is released.
RDS instances that use cloud disks
Backup within Seconds
Specifies whether to enable the single-digit second backup feature. If the feature is enabled, a snapshot backup can be completed within a few seconds.
NoteThis feature is supported for RDS instances that run RDS High-availability Edition with enhanced SSDs (ESSDs) or run RDS Cluster Edition.
Increase Snapshot Frequency
The frequency at which snapshot backups are created. You can configure a shorter interval to create snapshots by using the single-digit second backup feature, which increases the frequency of the snapshots. You can increase the frequency to up to once every 15 minutes. For more information, see Use the high-frequency snapshot backup feature for an ApsaraDB RDS for MySQL instance.
NoteThis feature is supported for RDS instances that run RDS High-availability Edition with cloud disks or run RDS Cluster Edition.
- Before you can use this feature, you must enable the single-digit second backup feature. If the single-digit second backup feature is disabled, ApsaraDB RDS automatically enables the single-digit second backup feature when you enable the high-frequency snapshot backup feature.
Fast Database/Table Restoration
Specifies whether to enable the fast restoration feature for individual databases and tables. Fast restoration provides a restoration speed that is 50% to 95% faster than standard restoration. For more information, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance.
NoteThe fast restoration feature for individual databases and tables is not supported in some Alibaba Cloud regions.
Table 2. Log backup settings Parameter
Description
Log Backup
Specifies whether to enable the log backup feature. After the feature is enabled, you can restore the data of your RDS instance to a point in time. This feature is enabled by default.
Log Backup Retention Period (Days)
Valid values: 7 to 730. Default value: 7.
The log backup retention period must be less than or equal to the data backup retention period.
NoteIf your RDS instance runs MySQL 5.7 on RDS Basic Edition, the value is fixed as 7.
Use DBS to perform automatic backups
Create a backup schedule. Make sure that you select the logical backup method.
Configure the backup schedule that you created.
For more information, see Back up an ApsaraDB RDS for MySQL or self-managed MySQL instance by using logical backup.
References
Related operations
Category | Operation | Description |
ApsaraDB RDS | Modifies the backup settings of an instance. | |
Queries the backup settings of an instance. | ||
Queries the backup sets of an instance. | ||
Queries the backup tasks of an instance. | ||
DBS | Creates a backup plan. | |
Configures a backup plan. |