Website Sync – How to Sync/Mirror Files and Database Between Remote Servers

firewallsyncwebsite

Here's my situation, I have website "A" sitting behind a intranet firewall, inaccessible to the people outside the intranet. I intend to have a outsourced developer work on "A", but he's not able to access it and I can not provide him access to the intranet. So my plan is set up a website "B", that syncs with "A"'s files and database, "B" of course is accessible to the world. My intention is that any changes on "B" would be immediately reflected on "A", likewise any changes on "A" would also be immediately reflected on "B" (a dropbox style sync relationship).

"A" and "B" both are running on linux server, I have root access on "A". I assume "A" would have to initiate the sync always, since "B" can not access "A" from the outside.

Is this possible? if so how would I achieve it?

Best Answer

Download OwnCloud (http://owncloud.org/) and host it on B. Install the client in A and setup filesyncing to whichever folders are of concern (e.g. /var/www/ ). OwnCloud will take the last edit time and update both ends to the latest file version (to prevent mistakes, the tolerance for system time differences is 2 seconds).

OwnCloud works in a very similar manner to DropBox but you have full control and privacy. You can also sync ANY folder in your local directories.

I use this personally to sync folders on my remote server, my home server and my office machine (which is behind a firewall). It even has a nice web UI that allows text editing and also an android app. Most importantly, the limit is whatever you decide to set.

Related Question