To restore data to the point in time when a backup set (snapshot) was created, you can restore the database or table from that backup set to recover from accidental operations.
Prerequisites
A backup set (snapshot) must exist.
Scenarios
Cluster editions
The database and table restoration feature supports PolarDB Enterprise Edition and Standard Edition, but requires specific cluster revision versions. The following table lists the minimum revision versions required for different scenarios.
Basic Features: The minimum revision version required to support database and table restoration.
GDN primary cluster/New restoration process: The minimum revision version required to use the feature on a global database network (GDN) primary cluster or to benefit from the speed optimization of the new restoration process.
NoteThe new restoration flow for the database and table restoration feature is an enhancement that optimizes the speed of restoring data to the original cluster. For more information about the mechanism and speed, see Overall Flow and Estimated Time.
Edition Series | MySQL Version | Architecture | Basic Features (Minimum Revision Version) | GDN Primary Cluster/New Restoration Process (Minimum Revision Version) |
Enterprise Edition (Cluster Edition) | 5.6 | X86 |
|
|
5.7 | X86 |
|
| |
8.0.1 | X86 |
|
| |
8.0.2 | X86 |
|
| |
Standard Edition | 5.6 | X86 |
|
|
5.7 | X86 |
|
| |
8.0.1 | X86 |
|
| |
Yitian (ARM) |
|
| ||
8.0.2 | X86 |
|
|
You can view the kernel version of your cluster in the Configuration Information section on the Basic Information page of your PolarDB for MySQL cluster.
Other limitations
The database and table restoration feature has the following limitations:
Clusters:
The feature is not supported for Multi-master Cluster (Limitless) Edition clusters or secondary clusters in a global database network (GDN).
Database and table restoration is not supported for clusters with more than 50,000 tables in either of the following cases:
The storage type is enterprise SSD (ESSD).
The cluster has no read-only (RO) nodes.
Table schemas and indexes:
Tables that contain a global secondary index (GSI) are not supported.
Restoring a columnstore index (IMCI) is not supported.
Storage engines: Only tables that use the InnoDB storage engine can be restored.
Data status: Tables that are archived as cold data cannot be restored.
If your current cluster does not support the database and table restoration feature, you can use full restoration to restore data to a new cluster, and then migrate the data to the source cluster.
Usage notes
Point-in-time recovery restores databases or tables to a specific point in time. After the recovery is complete, the data in the tables is identical to the data at that point in time.
You can restore databases and tables only from level-1 backups. You cannot restore from level-2 backups.
Only the tables you select are restored. Make sure to select all tables that you need to restore.
NoteIf you are unsure which tables to restore, perform a full cluster restoration.
You can use the database and table restoration feature even if the cluster contains more than 50,000 tables, including system tables.
If you choose to restore specific tables instead of a full database, you can restore up to 100 tables at a time. If you choose to restore a full database, all tables within that database are restored.
NoteTo restore many tables, perform a full cluster restoration.
The database and table restoration feature does not restore triggers.
The database and table restoration feature does not restore foreign keys.
Restore data during off-peak hours.
Step 1. Start database and table restoration
Log on to the PolarDB console, click Clusters in the navigation pane on the left, select the Region where the cluster is deployed, and then click the cluster ID to open the cluster details page.
In the left-side navigation pane, choose , and then click Restore Databases/Tables.
In the dialog box that appears, set the Restoration Type parameter to Backup Set and select the backup set that you want to use from the backup set drop-down list.
NoteSelect a restoration speed option based on your business requirements. The restoration speed options include Quick, Standard, and Secure. Each option consumes a different level of input/output operations per second (IOPS) to restore data to the current cluster. The estimated restoration duration for each restoration speed option can be found in the reference test data for database and table restoration speed.
Quick: consumes a large number of IOPS (approximately 60%) for restoring data to the current cluster. We recommend you select this option during off-peak hours.
Standard (recommended): consumes a moderate number of IOPS (approximately 30%) for restoring data to the current cluster.
Secure: consumes a small number of IOPS (approximately 15%) for restoring data to the current cluster. This may significantly slow down the restoration process.
On the left side of the Databases and Tables to Restore section, select the database that you want to restore. On the right side, select the tables that you want to restore.
NoteIf you do not specify a name for a destination database or table, the system automatically generates a new database or table name by suffixing the name of the original database and table with
_backup. For example, if the name of an original table istest, the destination table is automatically namedtest_backup.If you do not select a table after you select a database, all tables in the database are restored.
Verify that you have accurately identified and selected the databases or tables you want to restore, and then click OK.
Step 2. Compare data
After all the data has been restored, you need to log on to your cluster and compare and verify the data.
You can log on to the new cluster by using DMS, other clients, or Alibaba Cloud command line interface (CLI). This topic describes how to log on to your cluster and verify data on the DMS console. For more information about other methods, see Connect to a cluster.
- In the upper-right corner of the Basic Information page, click Log on to Database.

- In the dialog box that appears, specify database account and database password that are created in your cluster, and click Login.

- After you log on to DMS, refresh the page. In the left-side navigation pane, click Logged in instance.
- In the Logged in instance list, click the cluster and double-click the database that you want to manage.

- Locate the data that was deleted or modified accidentally and confirm whether it has been restored, and check whether other data is consistent with what it was before the accidental deletion or modification occurred.