Skip to content

Migrate 5TB EBS reserved instance to 3TB EBS reserved instance including Non RDS MySQL

0

We are currently using a 5TB EBS volume attached to a EC2 instance that also hosts a MySQL database. However, our actual usage is only around 2TB. so we want to reduce size of EBS volume from 5TB to 3TB.

Is it possible to migrate all the data, including the MySQL database, from the 5TB ec2 instance to a 3TB reserved instance? Can we restore 5TB snapshot to 3TB Ec2 instance?

Another option is to manually migrating whole data and migrate database using DMS? Does DMS allow to migrate database from one ec2 instance to another ec2 instance? If yes, could you provide an estimate of the approximate cost and time required to migrate a 500 GB MySQL database using DMS?

Our current MySQL version is 5.5.62, and we would like to maintain the same version in the new instance. Similarly, our application is running on PHP 5.5, and we want to keep the same version in the new environment.

1 Answer
0

Yes, you can migrate from a 5TB EBS volume to a 3TB EBS volume since your actual usage is only around 2TB. You have several options for this migration:

  1. For the EC2 instance migration:
  • Launch a new EC2 instance with a 3TB EBS volume
  • Back up your data by creating snapshots of your existing EBS volumes
  • You cannot directly restore a 5TB snapshot to a 3TB volume, but you can create a new 3TB volume from your snapshot and specify the smaller size (as long as it contains your 2TB of data)
  • Alternatively, you can copy data directly from your old instance to the new one
  1. For the MySQL database migration, you have several options:
  • Use native MySQL tools like mysqldump, which is typically the simplest option for a 500GB database
  • Use Percona XtraBackup (physical backup)
  • Use MyDumper (logical backup)
  • Use AWS DMS to migrate between EC2 instances

Yes, AWS DMS can migrate a MySQL database from one EC2 instance to another. DMS provides additional features like data validation that aren't available in native tools. You could also use a hybrid approach - native tools for the full load and DMS for ongoing replication to minimize cutover time.

For your MySQL 5.5.62 and PHP 5.5 requirements, you can install the same versions on the new EC2 instance to maintain compatibility with your application.

The migration time will depend on factors like network bandwidth and database complexity. For a 500GB MySQL database, you should perform testing to get an approximate time. If downtime is a concern, using a change data capture (CDC) tool like AWS DMS can help minimize cutover time to minutes, though it requires more monitoring and complexity than an offline option.
Sources
Migrate to a new instance type by launching a new EC2 instance - Amazon Elastic Compute Cloud
Migration options for large MySQL and MariaDB databases - AWS Prescriptive Guidance
Migrate an on-premises MySQL database to Amazon EC2 - AWS Prescriptive Guidance
Migrating a MySQL Database to RDS for MySQL or Aurora MySQL - Database Migration Guide

answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.