PHP Classes

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 (1)    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 172 All time: 8,813 This week: 69Up
Version License PHP version Categories
msync 1.0.0Custom (specified...5PHP 5, Databases, Systems administration


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.

Innovation Award
PHP Programming Innovation award nominee
July 2021
Number 5
Sometimes applications that use a database to store their data need to update the schema of the database tables to be able to implement new features.

Usually, developers start making changes to the database schema in the development environment. When the changes are well tested, they need to implement the same schema changes on the server-side.

This package provides a solution that uses schema definition files in JSON format to update the database schema either in the development environment or the production environment.

Manuel Lemos
Picture of Shabeer ALi M
  Performance   Level  
Name: Shabeer ALi M <contact>
Classes: 4 packages by
Country: India India
Age: ???
All time rank: 3536233 in India India
Week rank: 185 Up16 in India India Up
Innovation award
Innovation award
Nominee: 2x



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:0
All time:8,813
This week:69Up