The restoration feature for individual databases and tables is supported for ApsaraDB RDS for PostgreSQL instances. This feature allows you to restore specific databases to the original or an existing ApsaraDB RDS for PostgreSQL instance by backup set or point in time. This feature can be used in scenarios when accidental operations are performed and data needs to be quickly restored or when historical data needs to be analyzed.
Feature description
Item | Description |
Restoration range | Specific databases on an RDS instance. Note The restoration range varies based on data backup retention period, log backup retention period, and the point in time at which you enable the fast restoration feature for individual databases and tables of your RDS instance. The maximum retention period is 730 days for both data backup files and log backup files. For more information, see Back up an ApsaraDB RDS for PostgreSQL instance. You can call the DescribeLocalAvailableRecoveryTime operation to query the time range within which an RDS instance can be restored. |
Restoration speed | The restoration speed varies based on the data volume of the databases, which is approximately 20 Mbit/s. |
Restoration method | You can restore data from backup files or to a specific point in time. Note
|
Prerequisites
Your RDS instance meets the following requirements:
The RDS instance runs PostgreSQL 10, PostgreSQL 11, PostgreSQL 12, PostgreSQL 13, PostgreSQL 14, or PostgreSQL 15. Serverless RDS instances are not supported.
The RDS instance runs RDS Basic Edition or RDS High-availability Edition.
The RDS instance uses the enhanced SSD (ESSD) storage type.
If your RDS instance is created before October 10, 2022 and uses an original architecture, you must perform SLR authorization, update the minor engine version to the latest version, and then restore individual databases and tables of the RDS instance. For more information, see [Notice] SLR authorization is required to create an ApsaraDB RDS for PostgreSQL instance from October 10, 2022 and Update the minor engine version.
The restoration feature for individual databases and tables is enabled. For more information, see Enable the restoration feature for individual databases and tables.
You can go to the Basic Information page of your RDS instance to obtain the preceding information.
Billing rules
The restoration feature for individual databases and tables is in public preview. You can use the feature free of charge.
Limits
You cannot use the restoration feature for individual databases and tables to restore individual databases or tables of an RDS instance to a new RDS instance.
You can use the fast restoration feature for individual databases and tables to restore databases not tables.
You cannot use the restoration feature for individual databases and tables to restore views.
You cannot restore a table that is larger than 100 GB.
The databases whose names start with
postgres
,rdsadmin
, andtemplate
cannot be restored.
Enable the restoration feature for individual databases and tables
To use the restoration feature for individual databases and tables to restore data, you must perform the following steps to enable the feature before you restore data. For more information, see Procedure. Enabling the feature does not affect your workloads.
- 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.
In the left-side navigation pane of the page that appears, click Backup and Restoration.
On the page that appears, click the Backup Strategy tab.Backup and Restoration
In the Backup Strategy section, click Edit. In the dialog box that appears, turn on Restore Individual Database/Table.
Click Save.
Procedure
- 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.
In the left-side navigation pane of the page that appears, click Backup and Restoration. On the page that appears, click Restore Individual Database/Table.
NoteIf the Restore Individual Database/Table button is not displayed in the ApsaraDB RDS console, check whether the requirements that are described in Prerequisites are met.
Configure the following parameters.
Parameter
Description
Restore To
The destination RDS instance to which you want to restore data.
Original RDS instance
Another RDS instance that resides in the same region and have the same major engine version
Restore Speed
The value of this parameter is fixed as Standard.
Restore Method
By Backup Set: If you select this option, you can restore the data from a backup set.
By Time: The By Time option is displayed only if the log backup feature is enabled for the RDS instance. The system restores full backup data and then incremental log backup data. You can select a point in time within the log backup retention period. If you want to enable the log backup feature or modify the log backup retention period, follow the instructions provided in Back up an ApsaraDB RDS for PostgreSQL instance.
For example, if the data backup retention period and the log backup retention period of an RDS instance are seven days, you can restore data that is generated within the last seven days. Backup sets that are generated seven days ago are not retained and cannot be used for restoration.
Select the databases that you want to restore and click OK. You can specify the names of the restored databases based on your business requirements.
NoteYou can select up to 50 databases at a time.
The names of the restored databases cannot be the same as the names of the original databases. The system automatically adds _backup to the end of the name of a restored database. You can also modify the database name.
Make sure that the available storage of the destination instance is greater than the total storage of the selected database.
After the database is restored, you can go to the Databases page of the destination instance to view the restored database.
FAQ
What do I do if the "The operation failed. The RDS instance is not in a ready state." error message is displayed when I restore a database or table of my RDS instance in the ApsaraDB RDS console?
Tasks in the ApsaraDB RDS console are executed in sequence. If an ongoing restoration task or an incomplete task exists, the error message is displayed when you execute another restoration task. In this case, wait until the ongoing restoration task or the incomplete task is complete and then execute another restoration task.
What do I do if the restored table is empty?
Check whether the original table contains data at the point in time that you selected for the restoration. If the original table does not contain data at the point in time that you selected for the restoration, you must select a point in time at which the table contains data.
What other methods can I use to restore individual databases and tables of an RDS instance?
You can use Database Backup (DBS) to back up and restore RDS instances and self-managed databases that reside on Elastic Compute Service (ECS) instances. You can also use DBS to download backup sets from the cloud to your computer. For more information, see Overview. For more information about other data restoration methods, see Restore data by database or table.
Related operations
You can restore all data of an RDS instance. For more information, see Restore data of an ApsaraDB RDS for PostgreSQL instance.
You can also use pg_restore to restore specific individual tables from logical backup files. For more information, see Use pg_restore to restore data from a logical backup file.
You can restore the backup data of an RDS instance to a self-managed PostgreSQL instance. For more information, see Restore the data of an ApsaraDB RDS for PostgreSQL instance to a self-managed PostgreSQL instance by using a CSV file or an SQL file.
You can call API operations to perform related operations. For more information, see DescribeLocalAvailableRecoveryTime.