04 Mar 2009
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:

  1. $ 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:

  1. #!/bin/bash
  2.  
  3. REMOTE_BASE=me@remote.host.com:/home/me
  4. LOCAL_BASE=$HOME/sites/myisp/me
  5.  
  6. # EXCLUDE1=/logs/
  7. EXCLUDE2=/Maildir/
  8. EXCLUDE3=/tmp/
  9.  
  10. # NOTE: trailing slashes on bases
  11. rsync -e ssh -azvP \
  12.     —exclude=$EXCLUDE2exclude=$EXCLUDE3 \
  13.     $REMOTE_BASE/ \
  14.     $LOCAL_BASE/
  15.  
  16. date >$LOCAL_BASE/pull-from-myisp.date
  17.  
  18. # 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:

  1. #!/bin/bash
  2. # @(#) $Id$
  3.  
  4. DBNAME=<<MYDBNAME>>
  5. DBHOST=<<MYSQLHOST>>
  6. DBPASS=<<HAHAHA>>
  7.  
  8. BCKDIR=$HOME/backups/mysql
  9. BCKFILE="$DBNAME-`date +%a`.sql"
  10.  
  11. uptime
  12.  
  13. [ ! -d $BCKDIR ] && mkdir -p $BCKDIR
  14.  
  15. echo "`date` : starting backup"
  16.  
  17. # I don't have RELOAD privs, so can't use
  18. # –flush-logs
  19. # –lock-all-tables
  20.  
  21. mysqldump > $BCKDIR/$BCKFILE \
  22.  —host=$DBHOST  \
  23.  –opt   \
  24.  –allow-keywords \
  25.  –comments  \
  26.  –create-options \
  27.  –disable-keys  \
  28.  —password=$DBPASS \
  29.  $DBNAME
  30.  
  31. echo "`date` : completed"
  32.  
  33. chmod u=rw,g=r,o= $BCKDIR/$BCKFILE
  34. ls -lh $BCKDIR/$BCKFILE
  35.  
  36. uptime
  37.  
  38. # end

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

Category: meta
Tags: ,
(comments closed) | (trackbacks closed) | Permalink | Subscribe to comments |

Site last updated 2015-01-12 @ 13:31:07; This content last updated 2009-03-04 @ 23:04:10