This topic describes how to restore the individual databases and tables of an ApsaraDB RDS for MySQL instance.

Restore the individual databases and tables of an RDS instance that is equipped with local SSDs

Prerequisites
  • The RDS instance runs MySQL 8.0, MySQL 5.7, or MySQL 5.6 on RDS High-availability Edition or runs MySQL 5.7 on RDS Enterprise Edition.
  • The number of tables that are created in the RDS instance is less than 50,000.
  • The Restore Individual Database/Table feature is enabled for the RDS instance on the Backup Settings tab of the Backup and Restoration page in the ApsaraDB RDS console.
    Note
    • The Restore Individual Database/Table feature is enabled for each new RDS instance and cannot be disabled.
    • The data that is generated before the Restore Individual Database/Table feature is enabled cannot be restored. If you want to restore the data, we recommend that you restore all data of the RDS instance. For more information, see Restore the data of an ApsaraDB RDS for MySQL instance.
    • After the Restore Individual Database/Table feature is enabled, the supported backup file format changes from TAR to xbstream.

Impacts

If you restore individual databases and tables to the original RDS instance, a primary/secondary switchover is triggered during the restoration process. The switchover may cause a transient connection that lasts approximately 30 seconds. Make sure that your application is configured to automatically reconnect to the RDS instance. If you restore individual databases and tables to a new RDS instance, no primary/secondary switchovers are triggered during the restoration process.

Procedure

  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. On the page that appears, click Restore Individual Database/Table.
    Note If the Restore Individual Database/Table button cannot be found, you must check that the RDS instance meets all prerequisites.
  3. Configure the following parameters.
    Parameter Description
    Restore To
    • Current Instance: If you select this option, ApsaraDB RDS restores the data to the original RDS instance.
    • New Instance: If you select this option, ApsaraDB RDS restores the data to a new RDS instance.
    Restore Method
    • By Backup Set: If you select this option, you can restore the data from a data backup file.
    • By Time: If you select this option, you can restore the data to a point in time within the log backup retention period that you specify. For more information about how to view and change the log backup retention period, see Enable automatic backups for an ApsaraDB RDS for MySQL instance.
      Note The By Time option is available only when the log backup feature is enabled.
    Restore Mode
    • Logical Restoration: The restoration is slow.
    • Physical Restoration: The restoration is fast but triggers a primary/secondary switchover. In addition, all attached read-only RDS instances are restarted. If the RDS instance is being maintained, the amount of data that you want to restore is small, or the data replication to the attached read-only RDS instances is interrupted, the backend automatically selects Logical Restoration.
    Note This parameter is available only when the RDS instance is attached with read-only RDS instances.
  4. Select the databases and tables that you want to restore. You can also specify the name of each restored database or table. Then, click OK.
    Note
    • You can select up to 50 databases or tables at a time.
    • If you restore the selected databases and tables to the original RDS instance, these databases and tables must have new names that are different from the original names. By default, ApsaraDB RDS adds _backup to the original names.
    • If you restore the selected databases and tables to the original RDS instance, you must make sure that the available storage of the RDS instance is sufficient to store the data from these databases and tables.
  5. Select a billing method and configure the parameters that are required to create an RDS instance. This step is required only when you want to restore the data to a new RDS instance.
    • 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.
    • Pay-as-you-go: You are charged an hourly fee for a pay-as-you-go instance based on your actual resource usage. The pay-as-you-go billing method is suitable for short-term use. If you no longer need a pay-as-you-go instance, you can release the instance to reduce costs.
    Parameter Description
    Zone

    The zone where 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 or in a different zone than the Elastic Compute Service (ECS) instance that you want to connect.
    Note The new RDS instance must reside in the same region as the original RDS instance. You cannot change the region.
    Instance Type The instance type of the new RDS instance. 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 the new RDS instance provides to store data files, system files, binary log files, and transaction files.
    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.
Note You can also use one of the following methods to restore individual databases and tables:

Restore the individual databases and tables of an RDS instance that is equipped with standard SSDs or ESSDs

  1. Use DBS to create a logical backup. For more information, see Back up an ApsaraDB RDS for MySQL, PolarDB for MySQL, or self-managed MySQL database.
  2. Restore data from the generated logical backup file. For more information, see Restore a MySQL database from a logical backup.
Note For more information about how to restore individual databases and tables, see Use mysqldump to back up and restore an ApsaraDB RDS for MySQL instance.

Related operations

Operation Description
RestoreTable Restores the specified individual databases and tables of an ApsaraDB RDS instance to the original RDS instance.
CloneDBInstance Restores the specified individual databases and tables of an ApsaraDB RDS instance to a new RDS instance.
DescribeLocalAvailableRecoveryTime Queries the restorable time range that is supported by a backup file of an ApsaraDB RDS instance.