Mysql – Migrate large (200GB) thesql databases to new hosts with as little downtime as possible

amazon-rdsmigrationMySQLmysqldump

My question is about migrating large amounts of MySQL data with as little downtime as possible.

I have 3 MySQL databases that need to be moved from one RDS instance inside a VPC into a brand new AWS account into a new RDS instance.

Each database is around 200GB.

I'd like to minimise downtime as much as possible on the 3 sites these databases support.

  • The sites are very read and write intensive, so unfortunately I can't go into a read-only mode for a few hours while I migrate.
  • I cannot SSH into and copy the data files for the mysql instances because this is RDS.
  • It takes around 4-5 hours to run mysqldump for the entire database to my local machine.

What options do I have to be able to do this and how much downtime would you estimate for any ideas?

Best Answer

If you can tolerate a little downtime you can make a snapshot and share the snapshot with the new account. This is a simple and cheap approach though you will be down for the time it takes to make the snapshot, share and then restore it and then point your clients to the new instance.

For a solution with much less downtime, if you are using RDS you can make use of AWS DMS (Data Migration Service). It can be used as a method for either a one-off data migration, or you can use it to replicate data from one VPC to another within the same AWS Account, or even cross account, so that you can replicate data written to the old RDS into the new one, until you are ready to switch to using the RDS in the new account.

Good documentation on AWS DMS can be found here: https://docs.aws.amazon.com/dms/latest/sbs/DMS-SBS-Welcome.html

If you can, to minimise downtime, set up the current database with a CNAME and have your clients address the RDS via that CNAME.