PostgreSQL DB Migration (On-Prem To AWS)
PostgreSQL DB Migration (On-Prem To AWS)
PostgreSQL DB Migration (On-Prem To AWS)
Migration Cost
AWS database Migration Service is a low-cost service.
Charged for the compute resources used during the migration process called as replication instance and any
additional log storage.
Applicable for both homogeneous and heterogeneous migrations of any supported databases.
Reliability of DMS:
2 most important capabilities of the tools are resiliency and self-healing capability.
It continually monitors:
Source and target databases
Network connectivity
Replication instance
If interruption occurs,
It automatically restarts the process and continues the migration from where it stopped.
Multi-AZ option allows you to have high availability for database migration and continuous data
replication by enabling redundant replication instances.
Simplicity
No Need to install any drivers or applications for migration.
No change required for source database in most cases (except prerequisites.)
Start migration using the AWS Management Console.
Once the migration initiated DMS manages all the complexities of the migration process including
automatically replicating data changes that occur in the source database during the migration process.
DMS does continuous data replication.
Downtime minimized
Migrate your databases to AWS with virtually no downtime except during cutover.
Change of data in source database during the migration are continuously replicated to the target database.
IT causes the source database to be functional during the migration process.
Post migration the target database keeps synchronized with the source for as long as you to wish to keep
running the DMS allowing you to switchover as and when required.
DMS Migration Type
Homogeneous Database Migrations via DMS
Source & target DB engines are the same or are compatible like: -
Oracle to Amazon RDS for Oracle,
MySQL to Amazon RDS for MySQL,
Microsoft SQL Server to Amazon RDS for SQL Server.
Since the schema structure, data types, database code are compatible between the source and the target
databases, this kind of migration you create a migration task with connections to the source and target
database, and then start the migration with the click of a button. AWS Database Migration Service takes care
of the rest. The source database can be located in your own premises outside of AWS, running on an
Amazon EC2 instance, or it can be an Amazon RDS database. The target can be a database in Amazon EC2
or Amazon RDS.
Source & Target engines are different. Like in the case of Oracle to Amazon Aurora, Oracle to
PostgreSQL and Microsoft SQL Server to MySql migrations.
Customers who are looking to migrate self-managed PostgreSQL databases to Amazon RDS for
PostgreSQL or Aurora PostgreSQL, can use one of the three main approaches.
Use a native or third-party database migration method such as pg_dump and pg_restore for full
load only migrations.
Use a managed service such as AWS Database Migration Service (AWS DMS) for full load and
ongoing replication.
Use a native tool for full load and a managed AWS DMS service for ongoing replication. We call
this strategy the hybrid approach.
Automation of the creation of secondary database objects such as views, indexes, and constraints.
AWS DMS data validation to ensure that your target data matches with the source, row by row and
column by column.
Other capabilities provided by AWS DMS,
It may be simpler to use AWS DMS to track migration progress, transactional workload,
receive and transmit throughput, source and target latency, and so on.
Migration Steps
9.x, 10.x, 11.x, 12.x Use any available AWS DMS version.
Prerequisites
An active AWS account to create RDS and replication instance
Choose proper instance type capacity, storage features, and network features.
Identify network access security requirements for source and target databases.
Ongoing Replication
https://docs.aws.amazon.com/dms/latest/sbs/chap-manageddatabases.postgresql-rds-postgresql-ongoing-
replication.html
Endpoint Requirement
Source Endpoint Configuration
Endpoint identifier
o Server name
o Port
o User name
o Password
o Database name
Tags
Endpoint identifier
o Server name
o Port
o User name
o Password
o Database name
Tags
Task identifier
Replication instance
Tags
References:
https://www.youtube.com/watch?v=S9ogaQOvIyw