This topic describes how to use the cloud migration feature to migrate data from an ApsaraDB MyBase for PostgreSQL instance to an ApsaraDB RDS for PostgreSQL instance.
Preparations
- Create an ApsaraDB RDS for PostgreSQL instance that meets the following requirements:
- The major engine version and edition of the ApsaraDB RDS for PostgreSQL instance are the same as those of the ApsaraDB MyBase for PostgreSQL instance.
- The storage capacity of the ApsaraDB RDS for PostgreSQL instance is larger than that of the ApsaraDB MyBase for PostgreSQL instance.
- The ApsaraDB RDS for PostgreSQL instance belongs to the dedicated instance family.
Note- If you migrate data over an internal network, make sure that the region and virtual private cloud (VPC) of the ApsaraDB RDS for PostgreSQL instance are the same as those of the ApsaraDB MyBase for PostgreSQL instance.
- If you migrate data over the Internet, make sure that you applied for public endpoints for the ApsaraDB RDS for PostgreSQL instance and the ApsaraDB MyBase for PostgreSQL instance. For more information, see Apply for or release a public endpoint on an ApsaraDB RDS for PostgreSQL instance and Apply for or release a public endpoint.
- Configure IP address whitelists for the ApsaraDB RDS for PostgreSQL instance and the
ApsaraDB MyBase for PostgreSQL instance to enable communication between the instances.
For more information, see Configure an IP address whitelist for an ApsaraDB RDS for PostgreSQL instance and Configure an IP address whitelist.
To view the CIDR blocks that you must add to the IP address whitelists, you can log on to the ApsaraDB RDS console or the ApsaraDB MyBase console and go to the Database Connection page of each instance.
- Create a privileged account for the ApsaraDB MyBase for PostgreSQL instance. For more information, see Create a database account.
Usage notes
- During the cloud migration, you can read data from and write data to the ApsaraDB MyBase for PostgreSQL instance. However, we recommend that you do not perform operations such as migration, restart, or specification changes on the instance.
- The ApsaraDB MyBase for PostgreSQL instance is configured to process only read requests.
- The ApsaraDB RDS for PostgreSQL instance that uses a new general-purpose instance type cannot be used for migration over the Internet. For more information, see Primary ApsaraDB RDS for PostgreSQL instance types (x86).
Step 1: Evaluate whether data can be migrated
Step 2: Start the cloud migration
Step 4: Connect your application to the ApsaraDB RDS for PostgreSQL instance
Method 1: Change the endpoint (recommended)
View and change the endpoint of the ApsaraDB MyBase for PostgreSQL instance. Then, replace the endpoint of the ApsaraDB RDS for PostgreSQL instance with the original endpoint of the ApsaraDB MyBase for PostgreSQL instance. For more information, see View and change the private and public endpoints and ports of an instance and View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for PostgreSQL instance.
For example, the endpoint of your ApsaraDB MyBase for PostgreSQL instance is pgm-aaa.pg.rds.aliyuncs.com
and the endpoint of your ApsaraDB RDS for PostgreSQL instance is pgm-bbb.pg.rds.aliyuncs.com
. You can change the endpoint of your ApsaraDB MyBase for PostgreSQL instance to pgm-ccc.pg.rds.aliyuncs.com
and then change the endpoint of your ApsaraDB RDS for PostgreSQL instance to pgm-aaa.pg.rds.aliyuncs.com
.
Method 2: Change the endpoint that is configured in your application
Obtain the endpoint of the ApsaraDB RDS for PostgreSQL instance and use the endpoint to replace the database endpoint that is configured in your application. For more information, see View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for PostgreSQL instance