If you have shell access to your webserver, upgrading to the latest WordPress build can be a matter of painless seconds. As usual there is more than one way to do it, and here is one of these ways -- the script I am using.
-
#!/bin/bash
-
CURDIR=$(pwd)
-
SITE="http://yoursite.com/blog"
-
echo Updating Wordpress in $CURDIR
-
echo 1. downloading latest build
-
wget -q http://wordpress.org/latest.tar.gz
-
echo 2. unpacking latest build
-
tar zxf latest.tar.gz
-
cd wordpress/
-
echo 3. replacing old files with fresh ones
-
tar cf - . | (cd $CURDIR; tar xf -)
-
echo 4. updating your blog
-
wget -q -O - ${SITE}/wp-admin/upgrade.php?step=1> /dev/null
-
echo 5. removing unneeded files and directory
-
rm -f ../latest.tar.gz
-
echo 6. all done !
Modify line 3 to reflect your blog URL and here you go. The script downloads the latest build, unpacks it, overwrite your files and keeps file attributes, update your blog with the often forgotten /wp-admin/upgrade.php step, and removes temporary files. Literally takes seconds to upgrade.
Newbie how-to:
- Go to the wordpress root, where wp-config.php sits
- Using your favorite editor (pico ?) create a new file named updatewp
- Paste the code in the newly created file, save, exit
- chmod +x updatewp
- To upgrade WordPress: just type ./updatewp in the root dir
Note: this is based on a script I found a couple of years ago, which introduced me to the wicked tar piped line (step 3). I completely forgot where I found this originally, so if you have the feeling you might be the original coder, feel free to raise your hand in the comments :)
Related posts
Shorter URL
Want to share or tweet this post? Please use this short URL: http://ozh.in/g6
Pages: [2] 1 » Show All
pingback on 08/Mar/09 at 2:41 am # :
[...] multiple WordPress installations. Stephen Rider offered up Virtual Multiblog. Ozh linked to his WordPress Upgrade Script. Eric Marden listed some of the more general build process tools: Phing, Capistrano, Ant, Maven, [...]
pingback on 04/Mar/09 at 6:12 am # :
[...] WordPress Upgrade Script « planetOzh. [...]
pingback on 07/Dec/08 at 10:19 pm # :
[...] http://planetozh.com/blog/2007/10/wordpress-upgrade-script/ [...]