A Poor Mans Staging/Live with WordPress and Rsync

Firstly, this isn’t meant to be a serious contender for ‘proper’ version control, Eg. Subversion or Git, or anything of the kind. But instead just a nice little way of managing a WordPress staging and live site, so that you can perform simple design tweaks/changes on a staging site and roll out those changes gracefully to the live site. We use it for tiny WordPress sites where version history is not required but we still want to separate CSS tweaks from the live site. Start by creating a new file sync.sh and paste the following into it, changing the highlighted lines as necessary, then chmod +x sync.sh and execute it. Support for W3 Total Cache – providing an option of flushing all caches (if necessary). WP Minify – automatically turning off CSS and JS minification on the staging site and flushing cache on live site The code #!/bin/sh LIVE_DBNAME=”” LIVE_DBUSER=”” … Continue reading