Migrate from MySQL running on VMware Cloud on AWS to Amazon Aurora using AWS Database Migration Service (DMS)

8 minute read
Content level: Advanced
1

Demonstrate one of the methods for modernization with VMware Cloud on AWS

Introduction

Customers use VMware to power their applications and databases on premises. They use VMware Cloud on AWS as the first step to migrate without refactoring their applications. After that, they can also use AWS DMS to migrate the databases running on VMware Cloud on AWS to Amazon Relational Database Service (Amazon Aurora and Amazon RDS). This provides a next step of cloud journey for modernization, while still keeping applications on VMware Cloud on AWS with minimum impact or risk to their business.

This post will guide you how to migrate a database running on VMware Cloud on AWS to Amazon Aurora by using AWS DMS.

About AWS DMS

AWS DMS is one of AWS’s migration services and is trusted by customers globally to securely migrate 1,000,000 databases with minimal downtime.

1.Overview of AWS Database Migration Service (AWS DMS)

AWS DMS with VMware Cloud on AWS

In this post, I will demonstrate how AWS DMS enables you to migrate MySQL running on VMware Cloud on AWS to Amazon Aurora. Amazon Aurora is a modern relational database service offering performance and high availability at scale, offers open-source MySQL and PostgreSQL compatible editions, and supports a range of developer tools for building serverless and machine learning (ML)-driven applications.

Overview

The following architecture overview shows how AWS DMS migrates a MySQL database (DB VM) running on VMware Cloud on AWS to Amazon Aurora deployed in a connected VPC via an Elastic Network Interface (ENI).

2.Architecture overview of migrating MySQL running on VMware Cloud on AWS environment to Amazon Aurora by using AWS DMS

Please note that all the communication in the Figure above is kept private since the communication between VMware Cloud on AWS and the connected VPC is internally connected via an ENI.

Pre-requisites

General

Database details

Destination database location

  • Amazon Aurora (MySQL compatible) is running within the Connected VPC

3.Amazon Aurora (MySQL compatible) is running within the Connected VPC

Source database

  • MySQL is already set up as WordPress database

4.MySQL is already set up as WordPress database

Steps

For this example, I’ll walk through AWS DMS configurations covering the following sections:

  1. Create a replication instance in the connected VPC
  2. Create source and destination endpoints
  3. Create and execute a database migration task
  4. Switch DB access for WordPress from MySQL to Amazon Aurora and test

Step 1. Create an AWS DMS replication instance

When you create an AWS DMS replication instance, AWS DMS creates it on an Amazon EC2 instance in a VPC. You use this replication instance to perform your database migration. You can choose the Multi-AZ option if you need high availability and failover support.

In this example, I chose Single-AZ option and deployed the replication instance in the Connected VPC.

Create a DMS replication instance in the connected VPC

Create a replication instance in the Connected VPC.

5.step1_DMSreplication_instance

Parameters check

You can choose parameters following your environments and requirements

6.step1_DMS_replicaiton_instance_confing

Step 2. Create source and destination endpoints

Create endpoint

Create an endpoint for both Source (MySQL side) and Target (Amazon Aurora side).

An endpoint provides connection, data store type, and location information about your data store. AWS DMS uses this information to connect to a data store and migrate data from a source endpoint to a target endpoint. You can specify additional connection attributes for an endpoint by using endpoint settings.

7.step2_endpoints

Create a source endpoint

First, create a source endpoint. Register access information for the DB VM (MySQL) running on VMware Cloud on AWS.

8.source_endpoint

Create a target endpoint

Next, create a target endpoint. Register your access information for Amazon Aurora running on the Connected VPC.

9.target_endpoint

(Optionall) target Endpoint connection test

Before creating the Target endpoint, you can test a connection to the replication instance.

10.target_endpoint_connection_test

Then, the pre-migration setup with AWS DMS is now complete.

Step 3. Create and execute a database migration task

An AWS DMS task is where all the work happens. You specify what tables (or views) and schemas to use for your migration and any special processing, such as logging requirements, control table data, and error handling.

A task can consist of three major phases:

  • Migration of existing data (Full load)
  • The application of cached changes
  • Ongoing replication (Change Data Capture)

For more information and an overview of how AWS DMS migration tasks migrate data, please refer to High-level view of AWS DMS

Migration of existing data

In this example, I simply chose “Migration of existing data” to migrate data from MySQL to Amazon Aurora.

11.create_db_migration_task

And, I chose MySQL schema "wordpress" to migrate to Amazon Aurora.

12.db_schema_wordpress

You can check the execution status in “Status”.

13.migration_status

With this, I could migrate the MySQL data to Amazon Aurora.

Next, let’s confirm the data migration from WordPress applicaiton.

Step 4. Switch WordPress' database access from MySQL to Amazon Aurora and test

After database migration, let’s test with the WordPress application. Once updating the “wp-config.php” configuration file to switch DB access for WordPress (App VM), the WordPress accesses Amazon Aurora.

Switching DB access for WordPress (App VM)

14.wordpress_config

Migration check

As shown blow, I can see that all my WordPress posts had been successfully migrated.

15.wordpress_post

Additional Considerations

Conclusion

It is not difficult to imagine that database migration is tough, but AWS DMS can greatly lower the hurdles in that process. I would be happy if this post encourages you to consider further modernization. There are many reference materials in AWS DMS. A summary is provided below. Please check them out as well.

Additional Resources