2009
07.10

Updating WordPress

The release of WordPress 2.8.1 was announced this week. I thought it would be useful to other WordPress users, and provide a good history for myself, to document how I do the update. I first visit the WordPress Download page and copy the URL for the tarball; currently it’s a link to latest.tar.gz, but who knows if that will always redirect to the correct release. With the URL in the clipboard, I switch to my SSH terminal window. I change to my ~/src directory and use wget to download the file and extract the tarball right there. I then use rsync to update the files from the new release to my production site. Here’s the process:

cd ~/src
wget http://wordpress.org/latest.tar.gz
tar -zxf wordpress-*.tar.gz
rsync -niruW wordpress/ ~/websites/sneakybastard.com/
# looks reasonable, run it
rsync -ruW wordpress/ ~/websites/sneakybastard.com/

The -n options it to perform a dry-run. I like to see what it plans to do before committing. It’s not a bad idea to clean up the permissions on the wp-content directory too.

cd ~/websites/sneakybastard.com
sudo chown -R slappy wp-content
sudo chgrp -R apache wp-content
sudo find wp-content -type d -exec chmod 2775 {} \;
sudo find wp-content -type f -exec chmod 0664 {} \;

The permissions allow file uploads through PHP as the apache user, while the shell account user can make changes to theme and plugin files.

No Comment.

Add Your Comment