Upgrade to WordPress 2.7.1

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:



# EXCLUDE1=/logs/

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

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:

# @(#) $Id$


BCKFILE="$DBNAME-`date +%a`.sql"


[ ! -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	\

echo "`date` : completed"

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


# end

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

About hornlo

Geek. Curmudgeon
This entry was posted in meta and tagged , . Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.