Instance and table restoration is a process of restoring only a specified instance or table of a cluster. For example, if you are a games company, you can use the instance and table restoration feature to restore the data of a player or a group of players. Instance and table restoration supports two methods: restore from a backup set and restore data to a previous point in time. This topic describes how to restore a specified instance or table from a backup set.

Prerequisites

The version of your cluster must be ApsaraDB PolarDB MySQL-compatible edition 5.6 or later and the minor engine version of the PolarDB kernel must be 5.6.1.0.24 or later. For more information about how to upgrade the minor engine version of the PolarDB kernel, see Upgrade versions.

Precautions

  • You can restore only specified tables, so you must confirm that you have selected all the tables that you want to restore.
    Note If you cannot determine which tables to restore, we recommend that you restore all the data of your cluster to a new cluster and then migrate the data back to the original cluster. For more information, see Method 1 for cluster restoration: Restore from a backup set and Method 2 for cluster restoration: Restore data to a previous point in time.
  • If the specified tables are deleted during the time period between the generation of the last backup set and the specified time, you cannot restore the data by Backup Timepoint.
  • You can restore up to 100 tables at a time. If you choose to restore an instance, all tables in the instance can be restored.
    Note To restore a large number of tables, we recommend that you restore all data of your cluster to a new cluster. For more information, see Method 1 for cluster restoration: Restore from a backup set and Method 2 for cluster restoration: Restore data to a previous point in time.
  • The instance and table restoration feature only applies to clusters that have no more than 50,000 tables.
  • The instance and table restoration feature does not restore triggers. If the original table has a trigger, the trigger will not be restored.
  • The instance and table restoration feature does not restores foreign keys. If the original table has a foreign key, the foreign key will not be restored.

Procedure

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is deployed.
  3. Find the cluster and click the cluster ID.
  4. In the left-side navigation pane, choose Settings and Management > Backup and Restore.
  5. On the Backup and Restore page, click Restore Databases/Tables.
  6. In the dialog box that appears, select Backup Set in the Restore Type section and select the backup set from which you want to restore data in the backup set drop-down list.
    1
  7. In the left section of the Databases and Tables to Restore page, select the instance that you want to restore, and select the table that you want to restore on the right side.
    1
    Note
    • If you select an instance but do not specify tables, all data in the instance is restored.
    • After you select an instance or table, the system automatically generates the name of the new instance or table by adding the _backup suffix to the name of the original instance or table. For example, if the name of a table is test, the new table is named test_backup. You can also customize the names of new instances and tables.
  8. Click OK.

Related API operations

API operation Description
DescribeMetaList You can call the DescribeMetaList operation to query the metadata of the instance or table that you want to restore.
RestoreTable You can call the RestoreTable operation to restore the instances or tables of a PolarDB cluster.