How do I use AWS DMS to migrate PostgreSQL databases between Amazon RDS, Aurora, and on-premises environments?
I want to use AWS Database Migration Service (AWS DMS) to migrate PostgreSQL databases between Amazon Relational Database Service (Amazon RDS), Amazon Aurora, and on-premises environments.
Resolution
Create an AWS DMS task for PostgreSQL migrations
Complete the following steps:
- Create a replication instance.
Note: Make sure to choose an appropriate instance size based on your database size and migration requirements. - Configure the virtual private cloud (VPC) and security group settings for the replication instance.
- Create your source and target endpoints.
Note: For Amazon RDS or Aurora database (DB) instances, select the Amazon RDS for PostgreSQL or Aurora PostgreSQL-Compatible Edition database engine. For on-premises DB instances, configure the VPC endpoint with the IP address and DNS of the on-premise DB server and test the connection. - Create a migration task.
Note: Before you perform the migration in your production environment, it's a best practice to test your migration in a test environment.
To monitor the migration progress, take one or more of the following actions:
- Use Amazon CloudWatch to monitor the progress of your migration tasks.
- Set up Amazon Simple Notification Service (Amazon SNS) notifications for important events during the migration process.
- View the AWS DMS task logs.
- Monitor Amazon RDS database logs for your task endpoints to check for errors.
- Monitor table statistics to track the progress of your migration tasks.
Configure your AWS DMS task for specific migration scenarios
If you're migrating an RDS for PostgreSQL database to an Aurora PostgreSQL-Compatible database, then use AWS DMS to perform data transformations during the migration.
If you're migrating an on-premises PostgreSQL database to an Amazon RDS database or Aurora database, then take the following actions:
- Use AWS PrivateLink to set up an endpoint service to resolve the source IP address and hostname for consistent connectivity.
- Use the AWS Schema Conversion Tool (AWS SCT) or AWS DMS Schema Conversion to migrate secondary objects, such as indexes and keys.
If you're migrating databases across VPCs, then take the following actions:
- Confirm that you configured VPC peering or a transit gateway.
- Launch an AWS DMS networking Amazon machine image (AMI) as an Amazon Elastic Compute Cloud (Amazon EC2) instance to troubleshoot connectivity issues.
Optimize costs for AWS DMS migrations
Take the following actions:
- Use the AWS pricing calculator to estimate costs for different migration scenarios.
- Choose a replication instance size that's appropriate for your performance requirements.
- Use AWS DMS Serverless for variable workloads.
Manage access requirements
Complete the following steps:
- Verify that your AWS Identity and Access Management (IAM) policies grant the required permissions for AWS DMS resources and operations.
- Configure your RDS security groups to allow communication between the replication instance and your source and target endpoints.
- For on-premises sources or targets, set up a VPN connection or AWS Direct Connect to securely access your data.
- If you use encrypted volumes, then check that you have the required AWS Key Management Service (AWS KMS) key permissions.
Related information
Using a PostgreSQL database as an AWS DMS source
Using a PostgreSQL database as a target for AWS Database Migration Service
- Argomenti
- Migration & Modernization
- Lingua
- English

Contenuto pertinente
AWS UFFICIALEAggiornata 7 mesi fa