Hi I am trying to synchronize my local mysql database to the web server. Please help me how to do it

We have developed an ERP application which should run in a LAN network, when we make any entries it should be stored in the local DB first then updated in the web server DB. If there is no internet connection still the entries needs to be saved in the local dB and then when the internet is back it should automatically updated in the web dB.

Please help me with the steps of how to do it.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

wow! i’m so happy to see this, i am about to build an erp system that performs the same function of syncing offline to online database. my question are as follows: should i host the application on a shared hosting or cloud hosting? and can i build the erp system with php and mysql?

please what other tools or tutorials do i need?

i am also using vanilla php with no frameworks.

thanks in anticipation.

A simple guide for setting up your first web server. you will only cover PHP, MySQL database and Apache webserver.

If you are using Microsoft SQL server on windows then I have no idea how to replicate from it to Linux but maybe same instructions can work, however if you are using mysql on windows then it is the same.

As for the second question the Linux server which is the replication slave needs to connect to Windows which is the replication master, so you need to provide it with either an IP address on your router and setup port forwarding from the router to your Windows however this needs a fixed public IP address, if you cannot get it I think you can setup VPN server on Linux and then setup your router as a VPN client then you can connect from the server to windows using its private IP address which you can easily control it.

Sorry for making this too long but I hope it helps out, if you still have any other questions please do not hesitate to write back here.

Mouhsen Ibrahim


You need to setup a master/slave replication between your local DB and the server’s DB. this tutorial helps to get it done.