Migrate from IBM Db2 on Amazon EC2 to Aurora PostgreSQL-Compatible using AWS DMS and AWS SCT
Created by Sirsendu Halder (AWS) and Abhimanyu Chhabra (AWS)
Environment: PoC or pilot | Source: IBM Db2 | Target: Aurora PostgreSQL-Compatible |
R Type: Re-architect | Workload: IBM | Technologies: Migration; Databases |
AWS services: Amazon Aurora; AWS DMS; AWS SCT |
Summary
This pattern provides guidance for migrating an IBM Db2 database on an Amazon Elastic Compute Cloud (Amazon EC2) instance to an Amazon Aurora PostgreSQL-Compatible Edition DB instance. This pattern uses AWS Database Migration Service (AWS DMS) and AWS Schema Conversion Tool (AWS SCT) for data migration and schema conversion.
The pattern targets an online migration strategy with little or no downtime for a multi-terabyte IBM Db2 database that has a high number of transactions. We recommend that you convert the columns in primary keys (PKs) and foreign keys (FKs) with the data type NUMERIC
to INT
or BIGINT
in PostgreSQL for better performance.
Prerequisites and limitations
Prerequisites
An active AWS account
A source IBM Db2 database on an EC2 instance
Product versions
DB2/LINUXX8664 version 11.1.4.4 and later
Architecture
Source technology stack
A Db2 database on an EC2 instance
Target technology stack
An Aurora PostgreSQL-Compatible version 10.18 or later DB instance
Database migration architecture
Tools
AWS Database Migration Service (AWS DMS) helps you migrate databases into the AWS Cloud or between combinations of cloud and on-premises setups. The source database remains fully operational during the migration, minimizing downtime to applications that rely on the database. You can use AWS DMS to migrate your data to and from the most widely used commercial and open-source databases. AWS DMS supports heterogeneous migrations between different database platforms, such as IBM Db2 to Aurora PostgreSQL-Compatible version 10.18 or higher. For details, see Sources for Data Migration and Targets for Data Migration in the AWS DMS documentation.
AWS Schema Conversion Tool (AWS SCT) supports heterogeneous database migrations by automatically converting the source database schema and a majority of the database code objects, including views, stored procedures, and functions, to a format that's compatible with the target database. Any objects that are not automatically converted are clearly marked so that they can be manually converted to complete the migration. AWS SCT can also scan the application source code for embedded SQL statements and convert them.
Epics
Task | Description | Skills required |
---|---|---|
Create an Aurora PostgreSQL-Compatible DB instance. | To create the DB instance, follow the instructions in the AWS documentation. For engine type, choose Amazon Aurora. For edition, choose Amazon Aurora PostgreSQL-Compatible Edition. The Aurora PostgreSQL-Compatible version 10.18 or later DB instance should be in the same virtual private cloud (VPC) as the source IBM Db2 database. | Amazon RDS |
Task | Description | Skills required |
---|---|---|
Install and verify AWS SCT. |
| AWS administrator, DBA, Migration engineer |
Start AWS SCT and create a project. | To start the AWS SCT tool and create a new project to run a database migration assessment report, follow the instructions in the AWS SCT documentation. | Migration engineer |
Add database servers and create a mapping rule. |
| Migration engineer |
Create a database migration assessment report. | Create the database migration assessment report by following the steps in the AWS SCT documentation. | Migration engineer |
View the assessment report. | Use the Summary tab of the database migration assessment report to view the report and analyze the data. This analysis will help you determine the complexity of the migration. For more information, see the AWS SCT documentation. | Migration engineer |
Convert the schema. | To convert your source database schemas:
For more information, see the AWS SCT documentation. | Migration engineer |
Apply the converted database schema to the target DB instance. |
For more information, see the AWS SCT documentation. | Migration engineer |
Task | Description | Skills required |
---|---|---|
Set up a VPC and DB parameter groups. | Set up a VPC and DB parameter groups, and configure the inbound rules and parameters required for migration. For instructions, see the AWS DMS documentation. For the VPC security group, select both the EC2 instance for Db2 and the Aurora PostgreSQL-Compatible DB instance. This replication instance must be in the same VPC as the source and target DB instances. | Migration engineer |
Prepare source and target DB instances. | Prepare the source and target DB instances for migration. In a production environment, the source database will already exist. For the source database, the server name must be the public Domain Name System (DNS) of the EC2 instance where Db2 is running. For user name, you can use | Migration engineer |
Create an Amazon EC2 client and endpoints. |
| Migration engineer |
Create a replication instance. | Create a replication instance by using the AWS DMS console and specify the source and target endpoints. The replication instance performs the data migration between the endpoints. For more information, see the AWS DMS documentation. | Migration engineer |
Create an AWS DMS task to migrate the data. | Create a task to load the source IBM Db2 tables to the target PostgreSQL DB instance by following the steps in the AWS DMS documentation.
| Migration engineer |
Related resources
References
Tutorials and videos