Migrate a Db2 database from Amazon EC2 to Aurora MySQL-Compatible by using AWS DMS
Created by Pinesh Singal (AWS)
Summary
After you migrate your IBM Db2 for LUW database
The pattern describes an online migration strategy with minimal downtime for a multi-terabyte Db2 source database with a high number of transactions.
This pattern uses AWS Schema Conversion Tool (AWS SCT) to convert the Db2 database schema to an Aurora MySQL-Compatible schema. Then the pattern uses AWS Database Migration Service (AWS DMS) to migrate data from the Db2 database to the Aurora MySQL-Compatible database. Manual conversions will be required for the code that isn’t converted by AWS SCT.
Prerequisites and limitations
Prerequisites
An active AWS account with a virtual private cloud (VPC)
AWS SCT
AWS DMS
Product versions
AWS SCT latest version
Db2 for Linux version 11.1.4.4 and later
Architecture
Source technology stack
DB2/Linux x86-64 bit mounted on an EC2 instance
Target technology stack
An Amazon Aurora MySQL-Compatible Edition database instance
Source and target architecture
The following diagram shows the data migration architecture between the source Db2 and target Aurora MySQL-Compatible databases. The architecture on the AWS Cloud includes a virtual private cloud (VPC) (Virtual Private Cloud), an Availability Zone, a public subnet for the Db2 instance and the AWS DMS replication instance, and a private subnet for the Aurora MySQL-Compatible database.

Tools
AWS services
Amazon Aurora is a fully managed relational database engine that's built for the cloud and compatible with MySQL and PostgreSQL.
AWS Database Migration Service (AWS DMS) helps you migrate data stores into the AWS Cloud or between combinations of cloud and on-premises setups.
Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the AWS Cloud. You can launch as many virtual servers as you need and quickly scale them up or down.
AWS Schema Conversion Tool (AWS SCT) supports heterogeneous database migrations by automatically converting the source database schema and a majority of the custom code to a format that’s compatible with the target database. AWS SCT supports as a source IBM Db2 for LUW versions 9.1, 9.5, 9.7, 10.1, 10.5, 11.1, and 11.5.
Best practices
For best practices, see Best practices for AWS Database Migration Service.
Epics
Task | Description | Skills required |
---|---|---|
Create the IBM Db2 database on Amazon EC2. | You can create an IBM Db2 database on an EC2 instance by using an Amazon Machine Image (AMI) from AWS Marketplace or by installing Db2 software on an EC2 instance. Launch an EC2 instance by selecting an AMI for IBM Db2 (for example, IBM Db2 v11.5.7 RHEL 7.9 | DBA, General AWS |
Configure security groups. | Configure the VPC security group inbound rules for SSH (Secure Shell) and TCP with port 22 and 50000, respectively. | General AWS |
Create the database instance. | Create a new instance (user) and database (schema), or use the default
| DBA |
Confirm that the Db2 DB instance is available. | To confirm that the Db2 database instance is up and running, use the | DBA |
Task | Description | Skills required |
---|---|---|
Create the Aurora MySQL-Compatible database. | Create an Amazon Aurora with MySQL compatibility Database from AWS RDS service
| DBA, General AWS |
Configure security groups. | Configure the VPC security group inbound rules for SSH and TCP connections. | General AWS |
Confirm that the Aurora database is available. | To make sure that the Aurora MySQL-Compatible database is up and running, do the following:
| DBA |
Task | Description | Skills required |
---|---|---|
Install AWS SCT. | Download and install the latest version of AWS SCT (the current latest version 1.0.628). | General AWS |
Configure AWS SCT. |
| General AWS |
Create an AWS SCT project. | Create an AWS SCT project and report that uses Db2 for LUW as the source DB engine and Aurora MySQL-Compatible for the target DB engine. To identify the privileges needed to connect to a Db2 for LUW database, see Using Db2 LUW as a source for AWS SCT. | General AWS |
Validate the objects. | Choose Load schema, validate the objects. Update any incorrect objects on the target database:
| DBA, General AWS |
Task | Description | Skills required |
---|---|---|
Create a replication instance. | Sign in to the AWS Management Console, navigate to the AWS DMS service, and create a replication instance with valid settings for the VPC security group that you configured for the source and target databases. | General AWS |
Create endpoints. | Create the source endpoint for the Db2 database, and create the target endpoint for the Aurora MySQL-Compatible database:
| General AWS |
Create migration tasks. | Create a single migration task or multiple migration tasks for full load and CDC or Data validation:
| General AWS |
Plan the production run. | Confirm downtime with stakeholders such as application owners to run AWS DMS in production systems. | Migration lead |
Run the migration tasks. |
| General AWS |
Validate the data. | Review migration task results and data in the source Db2 and target MySQL databases:
| DBA |
Stop migration tasks. | After data validation is successfully completed, stop the validation migration tasks. | General AWS |
Troubleshooting
Issue | Solution |
---|---|
AWS SCT source and target test connections are failing. | Configure JDBC driver versions and VPC security group inbound rules to accept the incoming traffic. |
The Db2 source endpoint test run fails. | Configure the extra connection setting |
The AWSDMS task fails to connect to the Db2 source, and the following error is returned.
| To avoid the error, run the following commands:
|
Related resources
Amazon EC2
Databases
AWS SCT
AWS DMS