All Products
Search
Document Center

ApsaraDB RDS:Restore data across regions

Last Updated:Aug 09, 2024

This topic describes how to restore the data of an ApsaraDB RDS for MySQL instance from a cross-region backup file to an existing or new RDS instance. The existing or new RDS instance must reside in the region to which the original RDS instance belongs or in the region in which the cross-region backup file is stored.

Prerequisites

Your RDS instance is backed up across regions. For more information, see Use the cross-region backup feature.

Note

Usage notes

  • Before you can connect to the new RDS instance to which you want to restore data, you may need to reset the password of the account that you want to use for the connection. This applies if the original RDS instance has the database proxy feature enabled and does not have a privileged account.

  • If you enable the cloud disk encryption feature for an RDS instance and restore data of the RDS instance to a new RDS instance, the new RDS instance uses the default service CMK for cloud disk encryption by default. For more information, see Use the cloud disk encryption feature and service key.

Restore data to a new RDS instance

You can restore the data of RDS instances that use local disks and cloud disks from backup files to new RDS instances. This does not affect the performance of the original RDS instances.

Local disks

  1. Log on to the ApsaraDB RDS console. In the left-side navigation pane, click Backups. In the top navigation bar, select the region in which your RDS instance resides.

  2. On the Backup Instances tab of the Cross-region Backup tab, find the RDS instance and click the ID of the instance.

  3. On the page that appears, find the backup set that you want to use, and click Restore in the Actions column.

  4. Select Restore to New Instance and click OK.

  5. On the Restore Database page, 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 billed per hour based on your actual resource usage. We recommend that you select the pay-as-you-go billing method for short-term use. If you no longer require a pay-as-you-go RDS instance, you can release it to reduce costs.

    Restoration Mode

    • By Backup Set: allows you to restore the data of your RDS instance from a data backup file.

    • By Time: allows you to restore the data of your RDS instance to a specific point in time. The point in time must be within the specified log backup retention period.

    By Backup Set

    The data backup file from which you want to restore the data of your RDS instance. This parameter appears only when you set the Restore Method parameter to By Backup Set.

    By Time

    The point in time to which you want to restore the data of your RDS instance. This parameter appears only when you set the Restore Mode parameter to By Time.

    Note

    Both local and cross-region log backup files can be used to restore the data of your RDS instance to a specific point in time.

    Region

    The region to which the new RDS instance belongs.

    Zone

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

    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 RDS instance is created, you can view 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

    Each instance type supports a specified number of cores, memory capacity, maximum number of connections, and maximum IOPS. For more information, see Primary ApsaraDB RDS instance types.

    Storage Capacity

    The maximum amount of storage that is provisioned to store data files, system files, binary log files, and transaction files in the RDS instance.

    Note

    The settings of some parameters cannot be modified. These parameters include Database Engine, Version, and Edition. The same settings of these parameters must be specified for both your RDS instance and the new RDS instance.

  6. Click Next: Instance Configuration to configure the network type and resource group of the RDS instance.

    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 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 vSwitch of Primary Node parameters.

    Note

    The network type of the RDS instance must be the same as the network type of the ECS instance that you want to connect. If the RDS instance and the ECS instance both reside in VPCs, these instances must reside in the same VPC. If the RDS instance and the ECS instance reside in different VPCs, these instances cannot communicate over an internal network.

    Resource Group

    You can use resource groups to categorize the resources of your Alibaba Cloud account. Resource groups help you simplify the management of resources and permissions in your Alibaba Cloud account. You can select an existing resource group or create a resource group. If you do not need to group resources, select Default Resource Group.

  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 you select the subscription billing method for the RDS instance.

    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 way, you do not need to renew the new RDS instance on a regular basis. This also helps prevent interruptions on your workloads on the new RDS instance if a payment becomes overdue.

  9. Optional. Log on to the new RDS instance and verify the data. For more information, see Use a client or the CLI to connect to an ApsaraDB RDS for MySQL instance.

Cloud disks

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

  2. In the left-side navigation pane of the page that appears, click Backup and Restoration.

  3. Click the Cross-region Backups tab and configure the Region of Backup Set parameter.

  4. On the page that appears, find the backup set that you want to use, and click Restore in the Actions column.

  5. On the Restore Database page, 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 billed per hour based on your actual resource usage. We recommend that you select the pay-as-you-go billing method for short-term use. If you no longer require a pay-as-you-go RDS instance, you can release it to reduce costs.

    Restoration Mode

    • By Backup Set: allows you to restore the data of your RDS instance from a data backup file.

    • By Time: allows you to restore the data of your RDS instance to a specific point in time. The point in time must be within the specified log backup retention period.

    By Backup Set

    The data backup file from which you want to restore the data of your RDS instance. This parameter appears only when you set the Restore Method parameter to By Backup Set.

    By Time

    The point in time to which you want to restore the data of your RDS instance. This parameter appears only when you set the Restore Mode parameter to By Time.

    Note

    Both local and cross-region log backup files can be used to restore the data of your RDS instance to a specific point in time.

    Region

    The region to which the new RDS instance belongs.

    Zone

    The zone in which the new RDS instance resides. Each zone is an independent physical location within a region. Zones in the same region do not have substantial differences. The new RDS instance can reside in the same zone as the ECS instance that you want to connect or in a different zone.

    Instance Type

    Each instance type supports a specified number of cores, memory capacity, maximum number of connections, and maximum IOPS. For more information, see Primary ApsaraDB RDS instance types.

    Storage Capacity

    The maximum amount of storage that is provisioned to store data files, system files, binary log files, and transaction files in the RDS instance.

  6. Click Next: Instance Configuration to configure the network type and resource group of the RDS instance.

    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 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 vSwitch of Primary Node parameters.

    Note

    The network type of the RDS instance must be the same as the network type of the ECS instance that you want to connect. If the RDS instance and the ECS instance both reside in VPCs, these instances must reside in the same VPC. If the RDS instance and the ECS instance reside in different VPCs, these instances cannot communicate over an internal network.

    Resource Group

    You can use resource groups to categorize the resources of your Alibaba Cloud account. Resource groups help you simplify the management of resources and permissions in your Alibaba Cloud account. You can select an existing resource group or create a resource group. If you do not need to group resources, select Default Resource Group.

  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 you select the subscription billing method for the RDS instance.

    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 way, you do not need to renew the new RDS instance on a regular basis. This also helps prevent interruptions on your workloads on the new RDS instance if a payment becomes overdue.

  9. Optional. Log on to the new RDS instance and verify the data. For more information, see Use a client or the CLI to connect to an ApsaraDB RDS for MySQL instance.

Restore data to an existing RDS instance

Note
  • You can restore the data of only RDS instances that use local disks to existing RDS instance across regions.

  • Make sure that the backup feature for individual databases and tables is enabled and at least one backup set is created for the existing RDS instance. For more information, see Back up individual databases and tables

  1. Log on to the ApsaraDB RDS console. In the left-side navigation pane, click Backups. In the top navigation bar, select the region in which your RDS instance resides.

  2. On the Backup Instances tab of the Cross-region Backup tab, find the RDS instance and click the ID of the instance.

  3. On the page that appears, find the backup set that you want to use, and click Restore in the Actions column.

  4. Select Restore to Existing Instance and click OK.

  5. In the dialog box that appears, Configure the following parameters.

    Parameter

    Description

    Restore Method

    • By Backup Set: allows you to restore the data of your RDS instance from a backup set.

    • By Time: allows you to restore the data of your RDS instance to a specific point in time. The point in time must be within the specified log backup retention period.

    Region

    The region to which the existing RDS instance belongs.

    Destination Instance Name

    The existing RDS instance to which you want to restore the data of your RDS instance.

    Databases and Tables to Restore

    The databases and tables that you want to restore.

    Selected Databases and Tables

    The names of the restored database and tables. By default, the names of the restored tables and tables are suffixed with _backup.

  6. Click OK.

References

After you create an RDS instance, you must configure IP address whitelists or security groups and create accounts. For more information, see Configure an IP address whitelist and Create an account. If you want to connect to the RDS instance over the Internet, you must also apply for a public endpoint. For more information, see Apply for or release a public endpoint. After you complete these operations, you can connect to the RDS instance. For more information, see Use a database client or the CLI to connect to an ApsaraDB RDS for MySQL instance.

Related operations

Operation

Description

CheckCreateDdrDBInstance

Checks whether an instance has a cross-region backup set that can be used to restore data across regions.

CreateDdrInstance

Restores the data of an instance to a new instance.

ModifyInstanceCrossBackupPolicy

Modifies the cross-region backup settings of an instance.

DescribeInstanceCrossBackupPolicy

Queries the cross-region backup settings of an instance.

DescribeCrossRegionBackups

Queries the cross-region data backup files of an instance.

DescribeCrossRegionLogBackupFiles

Queries the cross-region log backup files of an instance.

DescribeAvailableCrossRegion

Queries the available destination regions to which the cross-region backup files from a specific source region can be replicated.

DescribeAvailableRecoveryTime

Queries the restorable time range that is supported by a specified cross-region backup file.

DescribeCrossRegionBackupDBInstance

Queries the instances for which the cross-region backup feature is enabled in a region and the cross-region backup settings of the instances.