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 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. Go to the Backup and Restoration page.
    1. Log on to the ApsaraDB for RDS console. In the left-side navigation pane, click Instances. In the top navigation bar, select the region where your RDS instance resides.
      选择地域
    2. Find your RDS instance and click its ID. In the left-side navigation pane, click Backup and Restoration.
  2. Click Restore Database (Previously Clone Instance).
  3. 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 Back up 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 to which the RDS instance belongs. 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: The Zone of Primary Node and the Zone of Secondary Node are the same.
    • Multi-zone Deployment: The Zone of Primary Node and the Zone of Secondary Node are different. After you specify the Zone of Primary Node, the system automatically allocates the Zone of Secondary Node.

    The multi-zone deployment method provides zone-level disaster recovery. We recommend that you select the multi-zone deployment method.

    Note
    • After the RDS instance is created, you can view information about the RDS instance and its secondary RDS instance on the Service Availability page.
    • If you select the RDS Basic Edition, the database system consists of only one RDS instance and supports only the single-zone deployment method.
    Select zones
    Instance Type
    • Entry-level: belongs to the general-purpose instance family. 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 server.
    • Enterprise-level: belongs to the dedicated instance family. A dedicated instance exclusively occupies the allocated CPU, memory, storage, and I/O resources. The top configuration of the dedicated instance family is the dedicated host instance family. A dedicated host instance exclusively occupies all the CPU, memory, storage, and I/O resources of the server where it is deployed.
    Note Each instance type supports a specific number of CPU cores, memory capacity, maximum number of connections, and maximum IOPS. For more information, see Primary 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 local SSDs, the storage capacity of the RDS instance may vary based on the instance type. If you select standard or enhanced SSDs, this limit does not apply. For more information, see Primary instance types.
  4. Click Next: Instance Configuration.
  5. Configure the following parameters.
    Parameter Description
    Network Type
    • Classic Network: the traditional type of network.
    • VPC: A virtual private cloud (VPC) is an isolated network that provides higher security and better performance than the classic network. If you select the VPC network type, you must also specify the VPC and the VSwitch of Primary Node.
    Note The RDS instance must have the same network type as the ECS instance that you want to connect. If the RDS and ECS instances both have the VPC network type, they must also reside in the same VPC. Otherwise, the RDS and ECS instances cannot communicate over an internal network.
  6. Click Next: Confirm Order.
  7. 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.