Mysql – Easiest way to sync a dev MySQL db to a production MySQL db

MySQLmysql-replication

We have a staging server with MySQL installed locally. We plan on running Expression Engine, which requires a database. On the production side, we have two apache servers that are load balanced, so we'll need to install a mysql server on dedicated hardware and have the two web servers read from it. Now, since most of our work is done on the staging server (add,edit,deleting articles), I need to figure out how to sync the changes to production. No changes will be done on the production side.

I thought about a master/slave setup, but we don't want to "publish" our changes in real-time; only until management gives us the go ahead.

Best Answer

A master/slave setup could work if you ran "stop slave" on the production box. That would stop all syncing between the two boxes. You would then only need to start the slave whenever management give the go ahead to sync the two up. Just don't forget to run "stop slave" on it when you are done.

I'm assuming that shutting down production is not an option, but if it were able to, you have other options. One option is to shutdown both mysql servers and copy the files from staging to production. That is the easiest way to guarantee that both servers are completely in sync.