Migrate an on-premises MySQL database to Amazon EC2
Created by Sergey Dmitriev (AWS)
R Type: Rehost | Source: Databases: Relational | Target: MySQL on Amazon EC2 |
Created by: AWS | Environment: PoC or pilot | Technologies: Databases; Migration |
Workload: Open-source |
Summary
This pattern provides guidance for migrating an on-premises MySQL database to a MySQL database on an Amazon Elastic Compute Cloud (Amazon EC2) instance. The pattern discusses the use of AWS Database Migration Service (AWS DMS) or native MySQL tools such as mysqldbcopy and mysqldump for the migration.
Prerequisites and limitations
Prerequisites
An active AWS account
A MySQL source database in an on-premises data center
Product versions
MySQL versions 5.5, 5.6, and 5.7
For a list of target operating systems supported by Amazon EC2, see Amazon EC2 FAQs
Architecture
Source technology stack
An on-premises MySQL database
Target technology stack
A MySQL database instance on Amazon EC2
AWS data migration methods
AWS DMS
Native MySQL tools (mysqldbcopy, mysqldump)
Target architecture
AWS data migration architecture
Using AWS DMS:
Using native MySQL tools:
Tools
AWS DMS - AWS Database Migration Service (AWS DMS) supports several source and target databases. For information about MySQL source and target databases supported by AWS DMS, see Migrating MySQL-Compatible Databases to AWS. If your source database isn't supported by AWS DMS, you must choose another method to migrate your data.
Native MySQL tools - mysqldbcopy and mysqldump
Epics
Task | Description | Skills required |
---|---|---|
Validate the source and target database versions. | DBA | |
Identify the target operating system version. | DBA, SysAdmin | |
Identify the hardware requirements for the target server instance based on the MySQL compatibility list and capacity requirements. | DBA, SysAdmin | |
Identify storage requirements (storage type and capacity). | DBA, SysAdmin | |
Identify network requirements such as latency and bandwidth. | DBA, SysAdmin | |
Choose the proper instance type based on capacity, storage features, and network features. | DBA, SysAdmin | |
Identify the network or host access security requirements for the source and target databases. | DBA, SysAdmin | |
Identify a list of operating system users required for MySQL software installation. | DBA, SysAdmin | |
Determine a backup strategy. | DBA | |
Determine availability requirements. | DBA | |
Identify the application migration or switchover strategy. | DBA, SysAdmin |
Task | Description | Skills required |
---|---|---|
Create a virtual private cloud (VPC) and subnets. | SysAdmin | |
Create security groups and network access control lists (ACLs). | SysAdmin | |
Configure and start an EC2 instance. | SysAdmin |
Task | Description | Skills required |
---|---|---|
Create the operating system users and groups required for the MySQL software to work. | DBA, SysAdmin | |
Download the required version of the MySQL software. | DBA, SysAdmin | |
Install the MySQL software on the EC2 instance and configure the server. | DBA, SysAdmin |
Task | Description | Skills required |
---|---|---|
Use native MySQL tools or third-party tools to migrate database objects and data. | These tools include mysqldbcopy and mysqldump. | DBA |
Task | Description | Skills required |
---|---|---|
Migrate data with AWS DMS. | DBA |
Task | Description | Skills required |
---|---|---|
Follow the application migration strategy. | DBA, SysAdmin, App owner |
Task | Description | Skills required |
---|---|---|
Follow the application cutover or switchover strategy. | DBA, SysAdmin, App owner |
Task | Description | Skills required |
---|---|---|
Shut down the temporary AWS resources. | Shut down the AWS DMS replication instance. | DBA, SysAdmin |
Review and validate the project documents. | DBA, SysAdmin, App owner | |
Gather metrics around time to migrate, % of manual vs. tool, cost savings, etc. | DBA, SysAdmin, App owner | |
Close out the project and provide feedback. | DBA, SysAdmin, App owner |
Related resources
References
Tutorials and videos