How to organize the work of a production and demo site?

I need to have synchronization between two sites (demo and main). I don’t know how to synchronize the database.


Answer 1, authority 100%

  1. Are you sure that you need full synchronization!? I also do everything on the test, and then I put it in production, but I put it manually, because in 95% of cases you only need the structure and you want to control the process.
  2. If the synchronization is complete, and from master to slave; then it is possible through mysqldump + execution (via mysql < dat.sql) by cron;
  3. Navicat programs (Navicat for MySQL or Navicat Premium) can do a more or less qualitatively complex synchronization of structure and data. But we are not talking about full automation here.

Answer 2, authority 100%

Create a group for restricted accounts specifically for the demo.

All users who should work with the demo should be kept in this group.


Answer 3

Really, are different bases needed?
You can keep the beta version of the files on the beta subdomain, and the common database will remain, if necessary, create tables with the beta prefix.