This topic describes how to restore specific databases or tables of a PolarDB for MySQL cluster to an original cluster.
You can select different methods to restore the data in a PolarDB for MySQL cluster to a new or original cluster based on your business requirements.
- Method 1: Restore all historical data to a new cluster.
Restore all data of an original cluster to a new cluster, verify the data on the new cluster, and then migrate the data from the new cluster back to the original cluster. For more information, see Restore data.Note The new cluster to which data is restored contains the data and account information of the original cluster but does not contain the parameter settings of the original cluster.
- Method 2: Restore data of specific databases or tables to the original cluster.
For example, in gaming business, you must restore the data of one or more players. This topic describes how to restore data by using this method.
PrerequisitesThe version of the PolarDB for MySQL cluster is 5.6 and the minor kernel version is 22.214.171.124.24 or later. For more information about how to upgrade minor versions, see Upgrade versions.
- You can restore only the specified tables. You must confirm that you have selected
all of the tables that you want to restore.
Note If you cannot determine all the related tables that you want to restore, we recommend that you restore all the historical data of the entire cluster to a new cluster and then migrate the data back to the original cluster. For more information, see Restore data.
- 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 using Backup Timepoint.
- You can restore up to 100 tables at a time. If you choose to restore a database, all
tables in the database can be restored.
Note To restore a large number of tables, we recommend that you restore all historical data to a new cluster. For more information, see Restore data.
- Only clusters that have no more than 50,000 tables support restoring databases or tables. You cannot restore databases or tables of a cluster if the cluster has more than 50,000 tables.
- When you restore databases and tables, take note that triggers cannot be restored.
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region where the cluster resides.
- Find the cluster, and then click the cluster ID.
- In the left-side navigation pane, choose .
- On the Backup and Restore page, click Restore Databases/Tables.
- In the dialog box that appears, select Restore Type or Backup Set as Restore Type based on your business requirements.
- If you select Backup Set to restore a backup set, select the destination backup set from the backup set list.
- If you want to restore the data by Backup Timepoint, set the Restoration Time parameter.Note The selected time selected as Restoration Time must follow the limits on Restore To. Only the data generated within the last seven days can be restored.
- On the left section of the Databases and Tables to Restore page, select the destination database and select the destination table on the right
- If you select a destination database but do not specify tables, all data in the database is restored.
- After you select a destination database or table, the system automatically adds the
_backupsuffix to the new database or table. For example, the name
test_backup. You can also use a custom name for the new database or table.
- Click OK.
- Q: Why does the restoration feature temporarily become unavailable?
A: Check whether the cluster has an excessive number of tables. Only clusters that have no more than 50,000 tables support restoring databases or tables. You cannot restore databases or tables of a cluster if the cluster has more than 50,000 tables.
- Q: Can I customize the name of the new database or table?
A: Yes. Custom names for the new database or table are supported.
Related API operations
|DescribeMetaList||You can call the DescribeMetaList operation to query the metadata of the database or table that you want to restore.|
|RestoreTable||You can call the RestoreTable operation to restore databases or tables of a PolarDB cluster.|