ApsaraDB RDS for PostgreSQL supports the cloud migration feature. You can use this feature to migrate data between ApsaraDB RDS for PostgreSQL instances.
Prerequisites
The following requirements are met:
- The source RDS instance and the destination RDS instance run the same major engine version. The supported major engine versions are PostgreSQL 10, PostgreSQL 11, PostgreSQL 12, PostgreSQL 13, PostgreSQL 14, and PostgreSQL 15.
- The destination RDS instance is a primary instance. Read-only RDS instances do not support cloud migration.
- The destination RDS instance is equipped with standard SSDs or enhance SSDs (ESSDs).
- The destination RDS instance is empty. The available storage of the destination RDS instance is greater than or equal to the size of the data in the source RDS instance.
- The CIDR block of the virtual private cloud (VPC) to which the source RDS belongs is different from the CIDR block of the VPC to which the destination RDS instance belongs.
Usage notes
When you migrate data between the RDS instances that reside in different regions, you must use Cloud Enterprise Network (CEN) to enable cross-region communication between the source RDS instance and the destination RDS instance over an internal network. You are charged for cross-region communication that is based on CEN. For more information, see What is CEN? and Billing.
Procedure
Note In this example, the source RDS instance resides in the China (Beijing) region, and the destination RDS instance resides in the China (Hangzhou) region.
- Create a CEN instance and configure the CEN instance to enable cross-region communication between the source RDS instance and the destination RDS instance over an internal network.
- Configure the source RDS instance.
- Configure the destination RDS instance.
What to do next
To connect your applications to the destination RDS instance without the need to modify business code after the migration, perform the following operations on the destination RDS instance:
- Modify the whitelist settings of the destination RDS instance to ensure that the whitelists of the destination RDS instance are the same as the whitelists of the source RDS instance. For more information, see Configure an IP address whitelist for an ApsaraDB RDS for PostgreSQL instance.
- Change the endpoints that are used to connect to the destination RDS instance to ensure that these endpoints are the same as the endpoints that are used to connect to the source RDS instance. For more information, see View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for PostgreSQL instance. For example, if the endpoint that is used to connect to the source RDS instance is
pgm-aaa.pg.rds.aliyuncs.com
and the endpoint that is used to connect to the destination RDS instance ispgm-bbb.pg.rds.aliyuncs.com
, perform the following steps to change the endpoints:- Change the endpoint that is used to connect to the source RDS instance from
pgm-aaa.pg.rds.aliyuncs.com
topgm-ccc.pg.rds.aliyuncs.com
. - Change the endpoint that is used to connect to the destination RDS instance from
pgm-bbb.pg.rds.aliyuncs.com
topgm-aaa.pg.rds.aliyuncs.com
.
- Change the endpoint that is used to connect to the source RDS instance from