PHP MySQL Database Synchronize: Synchronize MySQL databases tables between servers

Recommend this page to a friend!
  Info   Example   View files (8)   Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
65%Total: 658 This week: 1All time: 4,815 This week: 242
Version License PHP version Categories
mysql-database-synch 1.0Freeware5PHP 5, Databases, Systems administration, W...
Description Author

This package can synchronize MySQL databases tables between servers.

One class can retrieve the list tables and records from the origin server MySQL database and send the data to another server script via HTTP.

On the destination server a script receives the request and recreates the origin tables in a MySQL database and inserts the retrieved records.


What is the best PHP mysql synchronize database class?
Synchronize an offline MySQL database with the online version

Offline database synchronisation with online database
How to sync offline and online database.

Picture of Bharat Parmar
  Performance   Level  
Name: Bharat Parmar <contact>
Classes: 11 packages by
Country: India India
Age: 29
All time rank: 58335 in India India
Week rank: 40 8 in India India
Innovation award
Innovation award
Nominee: 3x



Synchronize MySQL Database from One Server to Another Server or from One Database to Another Database on the same server using Simple PHP Script.

The source code is available at github. You can either clone the repository or download a zip file of the latest release.


1. cURL should be enabled

How To Use

1. copy & paste `server1` directory files on your first server.

2. set database details for the database which you want to synchronize to another database in 
	`includes/config.php` file.

3. copy & paste `server2` directory files on your second server. 

4. set Synchronization URL in `includes/config.php` which should have `server2` directory files. 

5. set database details for the database where you want to synchronize first database data.

6. execute `server1/example.php`


`server1/example.php` (Send Data to server2/example.php)

To make it automatic synchronization on particular interval, you can run the 
server1/example.php as cronjob on specific time.


    [data] => Array
            [bh_user_master] => Table Created. 8 Rows Inserted.
            [bh_user_message] => Table Created.

    [status] => success
    [message] => Database synchronization initiated.

    [data] => []
    [status] => fail
    [message] => No Table Found./Table Structure Not Found./

Limitation :

1. This is just for the Development mode only demo. When the script 
	synchronize the database, first it will drop the table on second 
	server and create new table and after that insert all data. 
	During the synchronization time, f the server stopped to respond, 
	the second server database will be truncated. 

2. Synchronization time, table structure and all rows will be 
	synchronization to avoid the collumn/data updation after 
	last synchronization.


Bharat Parmar

Ahmedabad, India.

Mobile : +91 9687766553 Email :

File Role Description
server1 (1 file, 2 directories)
server2 (1 file, 2 directories)
LICENSE Lic. License text Doc. Documentation

  Files  /  server1  
File Role Description
class (1 file)
includes (1 file)
   example.php Example Example script

  Files  /  server1  /  class  
File Role Description
   server1.class.php Class Class source

  Files  /  server1  /  includes  
File Role Description
   config.php Aux. Auxiliary script

  Files  /  server2  
File Role Description
class (1 file)
includes (1 file)
   example.php Example Example script

  Files  /  server2  /  class  
File Role Description
   server2.class.php Class Class source

  Files  /  server2  /  includes  
File Role Description
   config.php Aux. Auxiliary script

 Version Control Unique User Downloads Download Rankings  
This week:1
All time:4,815
This week:242
User Ratings User Comments (1)
 All time
Very Good package.
3 years ago (Jack Thomas)

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