One of the major headaches of maintaining a Joomla demo is that you have to refresh the data every now & then to restore the demo to its best as user usage can change a lot of data & interfere with the optimum demonstration of your products. We used to do this by simply having a cron job restore a backup of the database with the optimum data. But this had major issues as we had to upgrade extensions on the demo to the latest & these in some cases also involved structural database changes.

To solve this we maintain a clean version of our demos sites on a Local server. Our developers regularly update extensions at every release on our demo server. Once the demo upgrade has been tested & is satisfactory, we run the attached script. This is what the script does.

  1. Uses Rsync to find & sync changed files
  2. Take a backup of the local database
  3. Refresh the remote database with this dump
  4. Exclude files like configuration.php & cache folders from the sync

Using Rsync means that only changed files %MCEPASTEBIN% are synced. It is also set up to remove any deleted files. In case of the database, a differential is not taken, the entire database is replaced.

You can also use this script to move local sites to live. Also ideal if you have a more or less static site & want to maintain a Dev copy to try out content changes, new extensions etc.

The Script on GIST

Get it now!