mSync PHP Sync MySQL Databases: Update the MySQL database schema between servers

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2021-07-14 (6 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 62 This week: 62All time: 9,911 This week: 1Up
Version License PHP version Categories
msync 1.0.0Custom (specified...5PHP 5, Databases, Systems administration
Description Author

This class can update the MySQL database schema between servers.

It can connect to a given MySQL database server to retrieve the schema of the tables of a given database to create a schema definition in JSON format.

The class can also update the schema of the same database in different MySQL servers without losing the data already in the tables, so the database schemata are the same in the end.

Picture of Shabeer ALi M
  Performance   Level  
Name: Shabeer ALi M <contact>
Classes: 3 packages by
Country: India India
Age: ???
All time rank: 4292302 in India India
Week rank: 1 Up



mSync - a MySQL schema synchronization utility


mSync will create a schema file as JSON so that you can easily migrate schema to your production or any other work envirment easily. Currently mSync will support only table & views.

Why we use mSync

Developers find very hard to synchronize mysql schema. The current conventional method is to export to sql & update it in production. The main demerit of this method is all the old values of the production will be loose & the process is bit hectic. In Order to solve this we developed a platform where you can update the schema in a file and by running msync it will update only those changes without losing any old structure or data.


To run mSync you need PHP.


First you need to update the database configuration in mSync config file (config.php). In confi.php you can add multiple hosts with a host name.

Usage (CLI)

Create: Creating schema (schema.json) file from localhost. Make sure that localhost configuration is updated in config.php

php msyc.php create

Creating schema (schema.json) file from some other host (Ex:

php msyc.php create

Update : Once the schema is created you can update/sync with other host or database by using update command.

//by the following query the schema.json will be update with your localhost
php msyc.php update

Updating remote mysql

php msyc.php update

Note : If you are executing this query from localhost please make sure that your IP is accessible to update your production host.

  Files folder image Files  
File Role Description
Accessible without login Plain text file config.php Conf. Configuration script
Accessible without login Plain text file LICENSE Lic. License text
Plain text file msync.php Class Class source
Accessible without login Plain text file Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
This week:62
All time:9,911
This week:1Up

For more information send a message to info at phpclasses dot org.