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

  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane, click Backup and Restoration.
  3. Click Restore Database (Previously Clone Database).
  4. Configure the following parameters.
    Parameter Description
    Billing Method
    • Subscription: A subscription instance is an instance for which you pay an upfront fee. For long-term use, the subscription billing method is more cost-effective than the pay-as-you-go billing method. You are offered lower prices for longer subscription periods.
    • Pay-As-You-Go: A pay-as-you-go instance is charged per hour based on your actual resource usage. For short-term use, we recommend that you select the pay-as-you-go billing method. If you no longer need a pay-as-you-go instance, you can release the instance to reduce costs.
    Restore Mode
    • By Time: This mode allows you to restore data to a specific point in time within the log backup retention period that you specify. The time is accurate to the second. For more information about how to view or change the log backup retention period, see Enable the automatic backup feature for an ApsaraDB RDS for MySQL instance.
    • By Backup Set: This mode allows you to restore data from a data backup file. You can restore data only from the data backup file that is generated from a physical backup. You cannot restore data from the data backup file that is generated from a logical backup.
    Note The By Time option is available only after the log backup feature is enabled.
    Zone of Primary Node

    A zone is an independent physical location within a region. The Zone of Primary Node parameter specifies the zone to which the primary RDS instance belongs. The Zone of Secondary Node parameter specifies the zone to which the secondary RDS instance belongs.

    You can select the Single-zone Deployment or Multi-zone Development method.
    • Single-zone Deployment: If you select this deployment method, the values of the Zone of Primary Node and Zone of Secondary Node parameters are the same.
    • Multi-zone Development: If you select this deployment method, the values of the Zone of Primary Node and Zone of Secondary Node parameters are different. We recommend that you select this deployment method to perform zone-disaster recovery. You must manually configure the Zone of Primary Node and Zone of Secondary Node parameters.
    Note
    • After the new RDS instance is created, you can view the information about the new RDS instance and its secondary RDS instance on the Service Availability page.
    • If you select RDS Basic Edition, the database system consists of only one primary RDS instance and supports only the single-zone deployment method.
    Instance Type
    • General-purpose: A general-purpose instance exclusively occupies the allocated memory and I/O resources. However, it shares CPU and storage resources with the other general-purpose instances that are deployed on the same host.
    • Dedicated: You can select a dedicated instance type or a dedicated host instance type. A dedicated RDS instance exclusively occupies the allocated CPU, memory, storage, and I/O resources. Dedicated host instance types provide the highest specifications in the dedicated instance family. A dedicated host instance exclusively occupies all the CPU, memory, storage, and I/O resources on the physical host on which the instance is deployed.
    Note Each instance type supports a specific number of cores, memory capacity, maximum number of connections, and maximum IOPS. For more information, see Primary ApsaraDB RDS instance types.
    Capacity The maximum amount of storage that is provisioned to store data files, system files, binary log files, and transaction files in the new RDS instance. You can adjust the storage capacity at a step size of 5 GB.
  5. Click Next: Instance Configuration.
  6. Configure the following parameters.
    Parameter Description
    Network Type
    • Classic Network: the traditional type of network.
    • VPC: the recommended type of network. A virtual private cloud (VPC) is an isolated virtual network that provides higher security and higher performance than the classic network. If you select the VPC network type, you must configure the VPC and vSwitch of Primary Node parameters. If you set the Deployment Method parameter in the previous step to Multi-zone deployment, you must also configure the vSwitch of Secondary Node parameter.
    Note The network type of the new RDS instance must be the same as the network type of the Elastic Compute Service (ECS) instance that you want to connect. If the new RDS instance and the ECS instance both reside in VPCs, these instances must reside in the same VPC. If the new RDS instance and the ECS instance reside in different VPCs, these instances cannot communicate over an internal network.
  7. Click Next: Confirm Order.
  8. Confirm the settings in the Parameters section, configure the Purchase Plan and Duration parameters, read and select Terms of Service, click Pay Now, and then complete the payment. You must configure the Duration parameter only when the new RDS instance uses the subscription billing method.
    Note If you select the subscription billing method for the new RDS instance, we recommend that you select Auto-Renew Enabled below the Duration parameter. This eliminates the need to renew the new RDS instance on a regular basis. This also helps prevent interruptions to your workloads on the new RDS instance if a payment is overdue.

What to do next

  1. 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.
  2. 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

The restoration speed varies based on a number of factors, and the restoration may fail in a few circumstances. You may also need to manually troubleshoot the errors that occur due to the executions of SQL statements. The following factors affect the restoration speed:
  • 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.
Note The restoration may fail due to the following factors:
  • 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.