This topic explains the process for restoring backup data from an AnalyticDB for PostgreSQL instance to a new instance.
Limits
-
The availability of a restoration point is closely related to whether active archive abandonment has occurred on instance nodes. For more information about active archive abandonment, see the log backup description in How it works.
-
Before performing data restoration, ensure that no active archive abandonment has occurred on any node of the source instance from the time the last full backup was completed to the point in time you want to restore data.
You can Submit a ticket to contact technical support for assistance in confirming the availability of the corresponding restoration point.
-
The resource type of both the source and destination instances must be Storage Elastic Mode.
-
The source and destination instances must reside within the same region.
-
The storage capacity of the destination instance must be greater than or equal to that of the source instance.
-
The time taken for instance data restoration depends on the volume of data in the source instance. Typically, data is restored within a few hours.
Procedure
- Log on to the AnalyticDB for PostgreSQL console.
- In the upper-left corner of the console, select a region.
- Find the instance that you want to manage and click the instance ID.
- In the left-side navigation pane, click Backup and Restoration.
-
On the Data Backup or Restore Points tab, locate the desired backup and click the Actions column's Restore option.
On the Clone Instance page, configure the following parameters:
Parameter
Description
Clone Source Instance
The source instance whose data you want to restore.
Clone Source Type
Fixed as Backup Set.
Clone Source Backup Set
The point in time to which you want to restore data.
Region
The region in which to clone the instance. It is automatically set to the region in which the source instance resides.
Zone
The zone in which you want to clone the instance.
Network Type
The network type of the destination instance. The value is fixed as VPC.
VPC
The ID of the virtual private cloud (VPC).
Vswitch
The vSwitch in the specified VPC.
Instance Resource Type
The resource type of the instance. The backup and restoration feature supports only Storage Elastic Mode.
Instance Edition
Select High-performance (basic Edition) or High-availability Edition based on your requirements.
The Basic Edition is available only in specific regions and zones. For more information, see Scope of application.
For more information about the Basic Edition, see High-performance instances.
Engine Version
The engine version of the destination instance. It must be the same as the engine version of the source instance.
Coordinator Resources
The coordinator node resources of the destination instance. The specifications of coordinator nodes must be greater than or equal to those of compute nodes. For more information about coordinator resources, see Coordinator resource management.
Node Specifications (compute Node)
The specifications of compute nodes in the destination instance.
Node Count (compute Node)
The number of compute nodes in the destination instance.
Node Storage Capacity (compute Node)
The storage capacity per compute node in the destination instance. The total storage capacity of compute nodes in the destination instance must be greater than or equal to that in the source instance.
Disk Storage Type
The disk type. Valid values:
ESSD PL1 (recommended)
ESSD PL0
ESSD PL2 (high Throughput)
For more information about disk storage types, see Change the disk storage type.
Encryption Type
The encryption type.
If you select Disk Encryption, you must also select an Encryption Key.
Select the Service Agreement.
-
Click Buy Now.
NoteWhen you purchase, a new instance is created with the data from the source instance restored. The time required for data restoration depends on the amount of data in the source instance. Typically, instance data is restored within a few hours.
FAQ
How do I restore a single table?
AnalyticDB for PostgreSQL does not allow for the direct restoration of a single table. However, you can restore a single table by following these steps.
-
Follow the Procedure section to restore the data of the source instance to a new instance in the same region and VPC.
-
On the External Data Source Management page of the source instance, add the restored instance as a homogeneous data source. For more information, see Step 1 in Homogeneous data source access.
-
Create a foreign table in the source instance that maps to the single table in the new instance.
CREATE FOREIGN TABLE s01.t1(a int, b int) SERVER example_name OPTIONS(schema_name 's02', table_name 't1');
-
In the source instance, rename the original table, for example, from testtable to testtable_old.
-
In the source instance, create a new table named
testtable
, and import data from the foreign tables01.t1
to the new table.ImportantWhen renaming the original table, creating a new table, and importing data, stop writing data to the original table. If new data is written, manually add it after the import is complete.
CREATE TABLE testtable(a int, b int); INSERT INTO testtable SELECT * FROM s01.t1;
-
After confirming the data is imported correctly, release the restored instance.