EasyWPUpdate for WordPress 2.2 (and earlier)

TESTED THROUGH WORDPRESS 2.5

The release of WordPress 2.2 is finaly at our doorstep.  You can find the download on the on the main download page here: http://wordpress.org/download/ or from the announcement here: http://wordpress.org/development/2007/05/wordpress-22/.  This has been an interesting release.  For the last month I’ve been concentrating on the new job, but in the middle of all that I did participate in the debate that ended with the original tag implementation being pulled from this release.  Matt M. showed some real maturity by being willing to step back from his implementation upon the recomendation of others.  Oh! and for info about the name of this release “Getz”  head on over to Matt’s site for some sweet tones to put you into the mood to upgrade…

Aaron Brazell, aka Mr. Boss Sir, has come through and delivered another one of his 10 Things You Should Know About WordPress 2.2 articles and does a pretty good job of describing the heart and soul of this release.

I’ve released an updated version of my EasyWPUpdate script which includes some of the suggestions I’ve had from my readers.  Now, I must admit that Aaron’s similar script is downright awesome and the absolute best script in the world (yes I must admit that because it was a condition of my employment with b5media (REALLY!)), but if you don’t have automated server backups and you don’t regularly backup your SQL files, you might want to try my lowly little script.

Its features include:

  • Many blogs in one shot
  • Any version of WP
  • Automaticly runs upgrade script
  • Cleans up all files
  • Can use hosted or local files as source
  • Can be croned to ensure backups and/or refresh of dirtied files
  • Backup of files to new directory
  • Backup of files tarball/li>
  • Backup of database to SQL text file
  • Backup of database to tar ball
  • Optional inclusion/exclusions of directories.
  • Error detection and safe aborts

You can peruse the text version, EasyWPUpdate.txt, here:
Here are the basic steps to install this script:
1. Use Telnet or Putty to connect to your website and log into the shell
2. Type the following line:
wget http://www.thecodecave.com/downloads/EasyWPUpdate
3. Type the following line:
chmod +x EasyWPUpdate
4. Use an editor to change the values in Step 1 and save it again.
5. Run the script by typing:
EasyWPUpdate

That’s it. You will have just made backups of the files and database and updated all of your blogs. When 2.2.1 or even 2.3 comes out, the process will be:
1. Log in
2. Type
EasyWPUpdate

And you are done.

Now, step 1 looks like this:

# ##################################################################
# Step 1. Tell the script where to find the blogs
# ##################################################################
# List all of your WordPress directories and urls here.
#
# Each Blog should have a BlogDir and a BlugURL.
# Each Blog should have its own number [1],[2],[3] etc
# Delete the ones you don’t need.
#
BlogDir[1]=’site1dir’
BlogURL[1]=’www.example.com’

BlogDir[2]=’site2/news’
BlogURL[2]=’www.site2.com/news’

BlogDir[3]=’wordpress’
BlogURL[3]=’blog.site3.com’

That isn’t that hard to change is it? Even in VI.

Some quick tips on editing the script
1. type
vi EasyWPUpdate
2. Hit i
3. Make your changes
4. Hit ESCAPE COLON W to save your changes (or skip this step to lose changes)
5. Hit ESCAPE COLON !Q to immediately quit

Also, if your root directory is accessible from the web, you might want to change the name of the script:
mv EasyWPUpdate SomeSneakyName

to prevent unauthorized access.

(If you are a guru, please read through all 6 setup steps (and the rest too) there may be things you want to change.)

Enjoy 2.2!

48 Comments

Add a Comment

Your email address will not be published. Required fields are marked *