MySQL Server Migration – How to Migrate MySQL Server to New Hardware

migrationmysql-5.5mysql-5.6replication

I have to migrate working DB from old server (~50 Gb, mysql-5.5.43, openvz, all data in InnoDB) to a new hardware and new mysql version (mysql-5.6.28, debian). DB is "alone" – no replica servers. Dumps regulary made by mysqldump. Also software on PHP is running on server

Simple move using mysqldump isn't ok, 'cause restoring base is longs about 8 hours. I have no window of time for this…

So, there's a thought: make new server as a slave to existing server, wait till mysql replication sync is done, turn off old server, make slave become master and continue working. Is this possible? Will be there any software-kind problems?

Or, this thought is wrong. If so, how, then, I have to migrate my DB to new hardware and software with minimal downtime?

Best Answer

Let's assume you're managing your own database instead of AWS managed database.

  1. Make sure you did backup the database, just in case accidental disaster. By default, your database located at /var/lib/mysql. Copy that to a safe place.
  2. Upgrade your old database
  3. Migrate using rsync