Skip to content

How do I use AWS DMS to migrate PostgreSQL databases between Amazon RDS, Aurora, and on-premises environments?

3 minute read
0

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:

  1. Create a replication instance.
    Note: Make sure to choose an appropriate instance size based on your database size and migration requirements.
  2. Configure the virtual private cloud (VPC) and security group settings for the replication instance.
  3. 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.
  4. 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:

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:

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:

Manage access requirements

Complete the following steps:

  1. Verify that your AWS Identity and Access Management (IAM) policies grant the required permissions for AWS DMS resources and operations.
  2. Configure your RDS security groups to allow communication between the replication instance and your source and target endpoints.
  3. For on-premises sources or targets, set up a VPN connection or AWS Direct Connect to securely access your data.
  4. 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

Best practices for AWS Database Migration Service