Cross-account Amazon Aurora PostgreSQL and Amazon RDS for PostgreSQL migration with reduced downtime using AWS DMS
Blog
This article provides a comprehensive guide for migrating Aurora PostgreSQL or RDS PostgreSQL databases across AWS accounts with minimal downtime using AWS DMS.
- Use Aurora cloning or RDS snapshot restore for initial data load phase
- Enable logical replication and create replication slots on source database
- Configure AWS DMS CDC-only task for ongoing change data capture
- Capture log sequence number (LSN) from target after initial load
- Use test_decoding plugin for logical replication in AWS DMS
- Disable triggers on target database before replication begins
- Monitor replication lag using CloudWatch metrics and pg_replication_slots
- Enable data validation to verify accuracy of migrated data
- Update sequences and re-enable triggers during cutover phase
- Stop application, verify zero CDC latency, then switch to target database
- Cross-account cloning requires AWS RAM sharing and KMS key policy updates
- Tables must have primary keys for AWS DMS CDC to capture DELETE/UPDATE operations
This migration approach minimizes downtime by combining fast initial data load with continuous replication, enabling near-zero-downtime cutover to the target database.
The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.
Related articles
The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.