This topic describes how to restore the data of an ApsaraDB RDS for MySQL instance.

Prerequisites

The original RDS instance whose data you want to restore must meet the following requirements:

  • The original RDS instance is in the Running state and is not locked.
  • The original RDS instance does not have ongoing migration tasks.
  • If you want to restore data to a point in time, the log backup feature is enabled for the original RDS instance.
  • If you want to restore data from a backup set, the original RDS instance has at least one completed physical backup. For more information, see Enable automatic backups for an ApsaraDB RDS for MySQL instance.

For more information about how to restore the data of RDS instances that run other database engines, see the following topics:

Background information

You can use one of the following methods to restore the data of the original RDS instance:
  • Method 1: Restore the data of the original RDS instance 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 function was previously known as instance cloning. This topic describes this restoration method.
  • Method 2: Restore the data of individual databases or tables to the original RDS instance or to a new RDS instance. For more information, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance.
  • Method 3: Restore the data of the original RDS instance to a new or existing RDS instance that resides in a different region than the original RDS instance. For more information, see Restore the data of an ApsaraDB RDS for MySQL instance across regions.

Precautions

  • The new RDS instance must have the same whitelist, backup, and parameter settings as the original RDS instance.
  • The data information of the new RDS instance must be the same as the data information that is indicated by the specified data or log backup file of the original RDS instance.
  • The account information of the new RDS instance must be the same as the account information that is indicated by the specified data or log backup file of the original RDS instance.

Billing

You must pay for the new RDS instance. For more information, see Pricing, billable items, and billing methods.

Note If you use Alibaba Cloud Data Transmission Service (DTS) to migrate the data from the new RDS instance back to the original RDS instance, you are not charged for the schema migration or full data migration.

Restore data to a new RDS instance

  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Backup and Restoration.
  3. Click Restore Database (Previously Clone Instance).
  4. Configure the following parameters.
    Parameter Description
    Billing Method
    • Subscription: A subscription instance is an instance that you can subscribe to for a specified period and pay for up front. Subscription billing is more cost-effective than pay-as-you-go billing. Therefore, we recommend that you select subscription billing with a longer commitment. You can receive larger discounts for longer subscription periods.
    • Pay-As-You-Go: A pay-as-you-go instance is charged per hour based on your actual resource usage. We recommend that you select pay-as-you-go billing for short-term use. If you no longer need your pay-as-you-go instance, you can release it to reduce costs.
    Restore Mode
    • By Time: allows you to restore data to a point in time within the specified log retention period. The time is accurate to the second. For more information about how to view or change the log backup retention period, see Enable automatic backups for an ApsaraDB RDS for MySQL instance.
    • By Backup Set: allows you to restore data from a specified backup set. You can restore data only from the backup set that is generated from a physical backup. You cannot restore data from the backup set that is generated from a logical backup.
    Note The By Time option appears only when the log backup function is enabled.
    Zone

    The zone where the RDS instance resides. Each zone is an independent physical location within a region. For example, the China (Hangzhou) region contains Zone H, Zone I, and Zone J. ApsaraDB RDS supports the following two deployment methods:

    • Multi-zone Deployment: The primary RDS instance and the secondary RDS instance reside in different zones to provide zone-disaster recovery. This is the recommended deployment method.
    • Single-zone Deployment: The primary RDS instance and the secondary RDS instance reside in the same zone.
    Note If you select the RDS Basic Edition, you can select only the Single-zone Deployment method.
    Instance Type The instance type of the RDS instance. Before you select an instance type, you must select an instance family.
    • General-purpose (Entry-level): 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 (Enterprise-level): A dedicated instance exclusively occupies the allocated CPU, memory, storage, and I/O resources. The dedicated host instance family is the highest configuration of the dedicated instance family. A dedicated host instance occupies all the CPU, memory, storage, and I/O resources on the host where the instance is deployed.
    Note For more information, see Primary ApsaraDB RDS instance types.
    Capacity The storage capacity that the RDS instance has available to store data files, system files, binary log files, and transaction files. You can adjust the storage capacity in increments of 5 GB.
    Note If you select the local SSD storage type, the storage capacity of the RDS instance may vary based on the instance type. If you select the standard SSD or ESSD storage type, the storage capacity of the RDS instance does not vary based on the instance type. For more information, see Primary ApsaraDB RDS instance types.
  5. Click Next: Instance Configuration.
  6. Specify the network type.
    Note If your application is deployed on an ECS instance, the ECS instance and the RDS instance must both reside in the classic network or reside in the same virtual private cloud (VPC). Otherwise, the ECS instance and the RDS instance cannot communicate over an internal network.
    • Classic Network: the traditional type of network.
    • VPC: the recommended type of network. A 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 also select a VPC and a vSwitch. If no VPCs or vSwitches are created within your Alibaba Cloud account, you can select the default VPC and vSwitch.

  7. Click Next: Confirm Order.
  8. Confirm the settings in the Parameters section, specify the Purchase Plan and Duration parameters, read and select Terms of Service, and then click Pay Now. You must specify the Duration parameter only when the new RDS instance uses the subscription billing method.
    Note If the new RDS instance uses the subscription billing method, we recommend that you select Auto-Renew Enabled. This relieves the need to renew the instance on a regular basis and avoids interruptions to your workloads due to overdue payments.

Verify data on the new RDS instance

For more information, see Connect to an ApsaraDB RDS for MySQL instance.

Migrate data to the original RDS instance

After you verify the data on the new RDS instance, you can migrate the data from the new RDS instance back to the original RDS instance. For more information, see Migrate data between RDS instances.

Note The migration does not interrupt the workloads on the original RDS instance.

FAQ

  • How do I restore a database that I accidentally deleted?

    ApsaraDB RDS allows you to restore only the database 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 database that you accidentally deleted 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.

  • If my RDS instance does not have a data backup, can I restore the data to a point in time?

    No, if your RDS instance does not have a data backup, you cannot restore the data to a point in time. To restore the data to a point in time, you must restore the data from a full data backup that was completed before the specified point in time. Then, you must restore the incremental data from the log backup file that was generated at the specified point in time.

  • When I create an RDS instance to which data is restored, why am I unable to select a vSwitch for my primary RDS instance?

    If no vSwitches are available in the zone that you specified in the Basic Configurations step, you cannot select a vSwitch for your primary RDS instance 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 for your primary RDS instance.