Upgrade to WordPress 2.7.1

Posted by hornlo on March 4th, 2009 filed in meta

I upgraded my blog from WordPress 2.6.3 to 2.7.1 earlier this evening. It was simple and quick:

  1. unpacked the 2.7.1 kit into a scratch directory
  2. backed up my current installation (see the “pull” script below)
  3. copied (and updated) my original .htaccess and wp-config.php files into the scratch tree
  4. deactivated all my plugins
  5. rsync‘d the scratch tree on top of my remote blog tree
  6. re-enabled my plugins
  7. checked settings and hit various links to make sure the code and theme were behaving

If you’ve modified the WordPress code, you’ll have to re-apply your changes to the new code of course. Because the only significant changes I’ve made are to my theme, I didn’t have to do that. For those interested, here are the scripts I used (be careful with cut-n-paste: it willscrew up the various kinds of quotes):

The actual update transfer is a single command:

$ rsync -e ssh -avP ./scratchdir/ me@remote.host.com:path/to/blog/

I made the backup using this “pull” script, which makes a complete backup (via rsync) of my remote account to my laptop. That’s the entire account, not just the blog directory tree. I also make a nightly backup of the blog’s database on the remote host, so that’s included as well. Here’s the script, which I run ad hoc every day or so, when it’s convenient:

#!/bin/bash

REMOTE_BASE=me@remote.host.com:/home/me
LOCAL_BASE=$HOME/sites/myisp/me

# EXCLUDE1=/logs/
EXCLUDE2=/Maildir/
EXCLUDE3=/tmp/

# NOTE: trailing slashes on bases
rsync -e ssh -azvP \
    --exclude=$EXCLUDE2 --exclude=$EXCLUDE3 \
    $REMOTE_BASE/ \
    $LOCAL_BASE/

date >$LOCAL_BASE/pull-from-myisp.date

# end

Here’s the MySQL backup script, run nightly via cron. By including the weekday name, I have a rotating backup of the last seven days:

#!/bin/bash
# @(#) $Id$

DBNAME=<>
DBHOST=<>
DBPASS=<>

BCKDIR=$HOME/backups/mysql
BCKFILE="$DBNAME-`date +%a`.sql"

uptime

[ ! -d $BCKDIR ] && mkdir -p $BCKDIR

echo "`date` : starting backup"

# I don't have RELOAD privs, so can't use
#	--flush-logs
#	--lock-all-tables

mysqldump > $BCKDIR/$BCKFILE	\
	--host=$DBHOST		\
	--opt			\
	--allow-keywords	\
	--comments		\
	--create-options	\
	--disable-keys		\
	--password=$DBPASS	\
	$DBNAME

echo "`date` : completed"

chmod u=rw,g=r,o= $BCKDIR/$BCKFILE
ls -lh $BCKDIR/$BCKFILE

uptime

# end

Feel free to comment here or email me if you have any suggestions or questions.

Leave a Comment

Site last updated 2019-12-09 01:14:57; This item last updated 2009-03-04 23:04:10