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.
October 3rd 19 at 01:42
4 answers
October 3rd 19 at 01:44
Solution
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.
The scheme will not change, only the data - Brook_Sawa commented on October 3rd 19 at 01:47
October 3rd 19 at 01:46
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
Why not approvali would? And what is the normal cron from the post-commit hook? - Brook_Sawa commented on October 3rd 19 at 01:49
October 3rd 19 at 01:48
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
October 3rd 19 at 01:50
Suggest https://www.devart.com/dbforge/mysql/schemacompare/ as the option scheme and the date of the Comparators in commandline mode

Find more questions by tags PHPMySQL