Upgrading Wordpress with SVN & RSYNC
Thursday, October 18th, 2007The first time I upgraded my Wordpress installation I used the standard upgrade instructions and although it went through without a glitch I did find them long winded and time consuming, it took over 10 minutes so in my book that is time consuming.
If you are fortunate enough to have SVN on your server then I recommend you convert your Wordpress installation to be able to upgrade with SVN. The conversion is quick and easy and future upgrades using SVN are a doddle and very fast.
Now we get to the crux of why I’m writing this – I do not have access to SVN and nor am I allowed to install it on the server so I came up with a work-around for everyone else who finds themselves in this situation. I am still fairly new to LINUX, so for more experienced users this method is probably obvious or perhaps even considered pointless? but nonetheless it works for me.
This is in relation to the stable version and not the trunk (unstable) version of Wordpress. The link for the instructions for converting your wordpress installation to use SVN along with upgrading using SVN can be found here: http://codex.wordpress.org/Installing/Updating_WordPress_with_Subversion – that is the page I used.
On that page, scroll down to the instructions for “Converting a “Traditional” WordPress Blog to a Subversion Checkout” and go to “1. Create a new temporary blog directory”. On your local server/PC, follow the instructions below “First, create the temporary directory and check out WordPress there:”. But we need to add an additional step after performing the SVN. We now need to get the blognew folder on to the remote server before continuing and this is where we use RSYNC over SSH:
rsync -avz /home/username/blognew/ -e ssh remoteuser@remotehost:/home/sites/mydomain/public_html/blognew
Don’t forget, we are still working on the local server/PC and you will have to amend the RSYNC command accordingly depending on your system, so “/home/username/blognew/” is where you downloaded wordpress to using SVN. And “username@remotehost:/home/sites/mydomain/public_html/blognew” is the destination on your remote server. You may need to confirm some details with your host if you are not sure of them. For instance “remotehost” can be an IP address or URL/domain. In my case, I use an IP address. The path after “:” should be where you place your website files and in the location directly above the folder of your wordpress installation.
Then, all the following instructions, below “Next, copy the old wp-config and .htaccess files to the new site:” are performed on the remote server.
And that is it – basically a 2 minute job. All future upgrades can then be done by repeating the above. Please note, I am only using RSYNC because I do not have SVN installed on my remote server. If you have SVN on your remote server then you do not need the additional RSYNC step. Hope that makes sense and helps other people in the same situation.