Migrating master-slave MySQL database servers to 2 new servers, any tips or suggestions?

I'm setting up 2 new database servers that will be replacing a current master-slave setup. All boxes are running / will be running MySQL on RHEL.

Our current naming conventions:

db1 - master database

db2 - slave (using MySQL replication)

db01 - new master

db02 - new slave

We need to get db01 to be the new master with db02 as the new slave. What is the best way to migrate db1 and db2 to db01 and db02?

db1 and db2 are running in a production setting and we need to minimize all downtime; db1 has roughly 30GB of data in the database.

Any suggestions or tips on how to migrate to our new servers would be much appreciated.


Solution 1:

Having replication in place make it quite straight forward. This is because it is easy to turn a master into a slave and vice versa.

1) Setup (new) db01 as a slave of (old) db1.

2) You could then use the daisy chain feature to make (new) db02 the slave of (new) db01. [At this point you will have a string of three servers].

3) Redirect live traffic to db01 and db02.

4) Once certain db0X are handling live traffic switch off dbX.