If you have backup data for an ApsaraDB RDS for PostgreSQL instance, you can restore the data to a new instance. This is useful for recovering from operational errors or analyzing historical data.
How it works
ApsaraDB RDS for PostgreSQL supports restoring data from a backup set or to a specific point in time. The restoration process consists of the following steps:
-
Restore backup data from the source instance to a new instance.
-
Connect to the new instance and verify that the data is correct.
-
Migrate the data to the original instance.
For more information about data restoration methods, see Overview of data restoration methods.
Prerequisites
The source instance must meet the following requirements:
-
The instance is in the Running state
-
No migration tasks are running on the instance.
-
To restore from a backup set, the source instance must have at least one backup set.
-
To restore to a point in time, log backup must be enabled. For more information, see Configure automatic backups.
NoteBasic Edition instances do not support log backup and therefore cannot be restored to a specific point in time.
Usage notes
-
The new instance inherits the source instance's backup and parameter settings.
-
The data and account information on the new instance match the source instance's state at the time of the backup or the specified point in time.
-
When restoring an instance that uses cloud disks, its whitelist and security group configurations are not copied to the new instance. You must reconfigure them after the restoration is complete.
Billing
Restoring data creates a new, billable instance. You can review the cost details during creation.
-
For temporary use, you can create a new Pay-as-you-go or serverless instance, migrate the data to the original instance, and then release the new instance.
-
Billing for the instance starts upon creation.
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 navigation pane on the left, click Restoration.
-
In the upper-left corner of the page, click Restore Instance (Previously Clone Instance).
-
Configure the following parameters.
Parameter
Description
Billing Method
-
Subscription : You are billed up-front for the resources that you purchase. This method is suitable for long-term use and is more cost-effective than Pay-as-you-go. The longer the subscription duration, the higher the discount.
-
Pay-as-you-go: You are charged on an hourly basis for the resources that you use. This method is suitable for short-term use. You can release the instance at any time to reduce costs.
NoteIf the source instance is a serverless instance, you can restore its data only to a new serverless instance.
Restore Mode
-
By Time: Restores the instance to any point in time within the log backup retention period. To view or change the retention period, see Back up an ApsaraDB RDS for PostgreSQL instance.
-
By Backup Set
NoteThe By Time option is available only when log backup is enabled.
Product Series
-
Basic Edition: A single-node architecture that separates compute from storage. This edition is highly cost-effective.
-
High-availability Edition: A classic high-availability architecture with a primary node and a secondary node.
-
Cluster Edition: A high-availability architecture with one primary node and multiple secondary nodes.
NoteThe available editions vary based on the region and database version. The actual options on the buy page prevail. For more information about each edition, see Product series overview.
Deployment Method
You can select Single-zone Deployment or Multi-zone Deployment. An availability zone is an independent physical zone within a region. The Zone of Primary Node is the availability zone for the primary node, and the Zone of Secondary Node is the availability zone for the secondary node.
-
Single-zone Deployment: The Zone of Primary Node and the Zone of Secondary Node are the same.
-
Multi-zone Deployment (Recommended): The Zone of Primary Node and the Zone of Secondary Node are different, providing availability zone-level disaster recovery. You must select the Zone of Primary Node and the Zone of Secondary Node.
Note-
After the instance is created, you can view information about the primary and secondary nodes on the Service Availability page.
-
Basic Edition instances have only one node and can be deployed only in a single availability zone.
Instance Type
-
General-purpose: Entry-level instance types. These instances exclusively use their allocated memory and I/O resources, but share CPU and storage resources with other general-purpose instances on the same server.
-
Dedicated: Enterprise-level instance types. These instances exclusively use their allocated CPU, memory, storage, and I/O resources. An instance that runs on a dedicated host uses all resources on the physical server.
NoteEach instance type provides a specific number of CPU cores, memory size, maximum number of connections, and maximum IOPS. For more information, see Primary ApsaraDB RDS instance types.
Capacity
The storage capacity includes space for data, system files, log files, and transaction files. You can adjust the capacity in 5 GB increments.
NoteFor instances that use dedicated resources, such as those with high-performance local disks, the storage capacity is determined by the instance type. For more information, see Primary ApsaraDB RDS instance types.
-
-
Click Next: Instance Configuration.
-
Configure the following parameters.
Parameter
Description
Network Type
VPC: A Virtual Private Cloud (VPC) is an isolated network environment that provides higher security and performance than a traditional classic network. When you select this network type, you must select the corresponding VPC and VSwitch of Primary Node. If, in the Basic Resources section in the previous step, you configured Multi-zone Deployment, you must also select a VSwitch of Secondary Node.
NoteEnsure that the RDS instance and the ECS instance that you want to connect to are in the same VPC. Otherwise, they cannot communicate over the internal network.
Resource Group
The resource group to which the instance belongs.
-
Click Next: Confirm Order.
-
In the Parameter Configuration section, confirm the settings, select a Quantity and a Duration (for Subscription instances only), read and accept the terms of service, and then click Pay Now to complete the payment.
Log in and verify data
For information about how to connect to an instance, see Connect to an instance.
Migrate data to the original instance
After verifying the data on the new instance, you can migrate the required data back to the original instance. For more information, see Migrate data between ApsaraDB RDS instances.
Data migration copies data from a source to a destination instance without affecting the source.
More operations
-
To restore specific databases or tables, see Restore databases and tables.
-
To quickly restore a small amount of data, such as data in a specific table, you can use a logical backup. For more information, see Use pg_restore to restore data from a logical backup file.
-
To restore backup data from an ApsaraDB RDS for PostgreSQL instance to a self-managed PostgreSQL database, see Restore data from an ApsaraDB RDS for PostgreSQL instance to a self-managed PostgreSQL database from a CSV or SQL file.