Faster, Easier WordPress Upgrade
Tuesday, February 5th, 2008In the last 38 days there have been two urgent security fix releases of WordPress. In the last 3 and a tiny bit months there have been three maintenance releases of WordPress. In the last 4 and a tiny bit months there have been four releases of WordPress.
Other than the fact I’m starting to get pretty worried about the security and stability of the software in general, it’s a pain in the rear to have to keep upgrading. So I’m making it easier for me. WordPress themselves have helped by having a decent system in place for making it easy to get the latest.
I now have the simplest of shell scripts which:
- Backs up my database.
- Backs up my WordPress folder.
- Gets the latest WordPress release.
- Unpacks that release.
- Deploys that release live.
Being nice, I’m going to share it with you:
mysqldump --host=localhost --user=wordpress --password=wordpress wordpress > wordpress.sql
tar -zcf wordpress_backup.tgz wordpress_live
wget http://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
cp -r wordpress/* wordpress_live/
rm -r wordpress
Of course this assumes that you have a wordpress database in a localhost MySQL instance with username and password wordpress and that your live wordpress folder is wordpress_live so you can cope with a temporary wordpress folder from the unpack. It also assumes that mysqldump, tar and wget are available in your shell.
Also, I don’t just do this on live. I back up my live, put it on my portable instance and test the new version first. Then I do it on live. Then I update the versions of my plugins.
What an arse. This is why I prefer Geeklog. It’s more secure and doesn’t change at an alarming rate.
Now I can SSH into my server and type ./upgradewordpress.sh when I’m ready then hit http://inanger.com/[secretlocationofadmin]/wp-upgrade.php and finish things off. Job done. I still have a pain in the rear as I have to test the release locally first (./upgradewordpress.sh on local instance of course, after restoring a fresh backup of live into it and adjusting the config to refer to my local instance).
And I think this is less risky than tracking WordPress via SVN on live.
Popularity: 46% [?]

