Sync database MySQL
The task is to synchronize two nearly identical MySQL database (CMS). One is a test domain, the second at work. Hosting different. Changes are made only on a test domain, then the admin team to get to a working domain. In database there are records that should be different on two different domains (domain names, paths to files on the hosting).
How you can configure synchronization of such system? It would be optimal if I synchronize only the changes and not the entire dump.
4 answers
So you want to test on a production to transport not only the schema but also the data ?
I think there is only 1 option:
A script dampit the part of the schema to be migrated, as needed carries out the replacement of some lines, fills the dump on prod.
To transfer only new data, You can help utiility mysqldiff.
But due to the fact that you have replaced some data that did not happen such that all data is accidentally determined as "new", you have to make an intermediate database, which will contain a base test, but substituted with the production names, and the database to compare, and to diff.
Or after making changes to the staging database to zincate it prod by the utility table-sync from percona tools set.
most likely a very custom scripts for You, suspended on post-commit hook in git, although automatically I wouldn't approval on the battle server
domain names, paths to files on hosting services to store in files excluded from version control system. in the database these settings are not stored
the concept to update database from outside of the low-level mechanisms to break sooner or later it will lead to the logical inconsistently data. so the import-export application-level
Find more questions by tags PHPMySQL