Patrick Havens on July 22nd, 2008

Mind these shell commands are more for those who have shell access to their domains and are having to deal with upgrading many WordPress installs or are just wanting to be lazy.  If you look at it, you’ll see its very simplistic, and I didn’t do “garbage collection.” In otherwords I left the install files there until the next time (in which they get deleted first thing). The reason for that was that I might be playing with my install and need to swap back a replacement file or what-not from a default install.  But enough going on, here is the simple script.

I wrote this as a cshell, tshell or zshell script, technically it wouldn’t take much to make it a straight bourne shell script but I was lazy.

rm latest.zip
rm -rf wordpress
wget http://wordpress.org/latest.zip
unzip latest.zip
cp -R wordpress/* BLOG_INSTALL/.
date

A couple of options you can add:

At the beginning

pwd
sleep 3

That will tell you where its starting and give you enough time to CTRL-C if all of the sudden you realized you started it in the wrong place.

At the End

rm latest.zip
rm -rf wordpress

If you want to clean up and are running on a host that has a tight amount of space.

Now the steps to use this script.

  1. Edit the script in your text editor (I suggest EditPad)
  2. Bring up your shell and cd ~/ to your home folder
  3. Confirm to yourself that the install directory/path is correct
  4. Type: emacs upgrade-example (or the name of the blog your are upgrading)
  5. Paste in your finished script and make sure its all right
  6. CTRL-X CTRL-S and save it
  7. chmod 755 upgrade-wp
  8. Your done, to run type ./upgrade-example and a minute later your almost done
  9. Visit http://example.com/wp-admin/ and run the upgrade script if prompted

Hint: Tab can be used to auto complete and I’m sure you probably won’t have any files labels up___

if you don’t have shell access (Another reason I love Dreamhost) then you can give the automatic WordPress Upgrader a chance.

Tags: , , , , ,

One Response to “Simplistic way to upgrade WordPress”

Trackbacks/Pingbacks

  1. Bookmarks about Js

Leave a Reply