This topic describes how to restore the data of an ApsaraDB RDS for MySQL instance.
For more information about how to restore the data of an RDS instance that runs a different database engine, see the following topics:
Restore data to a new RDS instance
You can restore data to a new RDS instance, verify the data on the new RDS instance, and then migrate the data from the new RDS instance back to the original RDS instance. This feature was previously known as instance cloning.Description
- The new RDS instance must have the same whitelist settings, backup settings, and parameter settings as the original RDS instance.
- The data in the new RDS instance must be the same as the data in the specified data or log backup file of the original RDS instance.
- The information about the account that is used to create the specified data or log backup is replicated to the new RDS instance.
Time required for the restoration
For more information about the amount of time that is required for the restoration, see Appendix: Amount of time required for data restoration to a new RDS instance.
Billing
You are charged for the new RDS instance. We recommend that you create a new pay-as-you-go RDS instance. After the restoration is complete, you can release the new RDS instance.
Procedure
What to do next
- Log on to the new RDS instance and verify the data in the new RDS instance. For more information, see Connect to an ApsaraDB RDS for MySQL instance.
- Optional. Migrate the data that you need from the new RDS instance back to the original
RDS instance. For more information, see Migrate data between RDS instances.
Note The migration of data from the new RDS instance to the original RDS instance does not interrupt the workloads that are run on the original RDS instance.
Restore data to the original RDS instance, a different existing RDS instance, or an on-premises database instance
Method 1
After you restore data to the new RDS instance, verify the data on the new RDS instance. Then, migrate the data from the new RDS instance to the original RDS instance or a different existing RDS instance. For more information, see Restore data to a new RDS instance.
Method 2
If a logical backup is created by Database Backup (DBS), restore the data of the data backup file that is generated to the original RDS instance or a different existing RDS instance.
For more information, see Restore a MySQL database from a logical backup.
Appendix: Amount of time required for data restoration to a new RDS instance
Factors
- Volume of full data: A larger data volume indicates a lower restoration speed.
- Volume of incremental data: A larger data volume indicates a lower restoration speed.
- Large transactions: If the binary log files contain information about large transactions, the restoration speed is low.
- Hot data updates: If the binary log files contain information about hot data updates, the restoration speed is low.
- Foreign key constraints: Foreign key constraints increase the costs of verification and decrease the restoration speed.
- Number of binary log records: If you restore data to a specific point in time, a larger number of binary log records indicates a lower restoration speed.
- Partitioned tables: If tables are partitioned, the restoration is not supported. This rule takes effect if you use MySQL 8.0.
- Storage type: The restoration speed is higher when you use standard SSDs or enhanced SSDs (ESSDs) than when you use local SSDs.
- Specifications: Higher specifications indicate a higher restoration speed.
- Database engine version: If the database engine version that you use supports parallel replication, the restoration speed is high. If the database engine version that you use does not support parallel replication, the restoration speed is low.
- Binary logs are not parsed as expected because the new RDS instance runs an earlier database engine version than the original RDS instance.
- Table names or column names contain Chinese characters or special characters.
- Binary logs in the original RDS instance are deleted.
- Tables that do not have primary keys cannot be restored because the implicit_primary_key parameter is set to off in the original RDS instance.
Amount of time required for data restoration
The following table lists the amount of time required to restore data to a new RDS instance that provides 2 cores and 4 GB of memory and runs RDS High-availability Edition with local SSDs.
Operation | Time required |
---|---|
Create an RDS instance | 5 minutes |
Configure the new RDS instance | 15 minutes |
Download the data backup file | 400 GB per hour |
Start the new instance. | 5 minutes |
Download the log backup file | 400 GB per hour |
Apply the log backup file | Dependent on the specific content of the log backup file |
FAQ
- How do I restore one or more databases that I accidentally deleted?
ApsaraDB RDS allows you to restore the individual databases that you accidentally deleted. For more information, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance. If your RDS instance does not support the restoration of individual databases or tables, you can restore the data of the deleted databases to a new RDS instance, verify the data on the new RDS instance, and then migrate the data from the new RDS instance back to your original RDS instance.
- If my RDS instance does not have a data backup, can I restore data to a specific point
in time?
No, if your RDS instance does not have a data backup, you cannot restore data to a specific point in time. To restore data to a specific point in time, you must find a full data backup that is completed before the specified point in time and restore the data of the data backup file that is generated from the full data backup. Then, you must restore the incremental data from the log backup file that is generated at the specified point in time.
- When I create an RDS instance to which I want to restore data, why am I unable to
select a vSwitch from the vSwitch of Primary Node drop-down list?
If no vSwitches are available in the zone that you specify in the Basic Configurations step, you cannot select a vSwitch from the vSwitch of Primary Node drop-down list in the Instance Configuration step. In this case, click go to the VPC console. In the VPC console, create a vSwitch. Then, you can select a vSwitch from the vSwitch of Primary Node drop-down list.