Archive for 2008 December

Upgrading WordPress via Shell Access

halo_wordpressWordPress 2.7 is out along with its brand new dashboard look, a new commenting system that supports pagination and threading, and some fixes to the crucial security issues.

I used to download the ZIP file from WordPress.org, extract that file in my machine, then upload the whole contents through FTP. Even if you’re using DSL/broadband internet connection, this uploading process, which is about 5MB size, is apparently rather time-wasting. Upgrading one blog is all fine, you can do it while you’re checking your Facebook without even realizing that it’s done already. But how about upgrading 9 WordPress blogs? And not to mention the unreliable internet connection in Indonesia which leads to errors in the uploading process.

The solution is to upgrade WordPress from UNIX shell prompt. It won’t take more than 30 seconds of your valuable time. Please mind that this procedure is only intended for them who are familiar with UNIX/Linux interface and the shell commands. If you are totally new to these stuffs, please follow the FTP-way of upgrading WordPress.

Step 1: Backup existing database!

1
2
3
$ mkdir /backup/yourblogname
$ mysqldump -u user -p WP-DATABASENAME > /backup/yourblogname/blog.db.sql
$ tar -zcvf /backup/yourblogname.tar.gz /public_html/yourblogname

Step 2: Download the latest version of WordPress

1
2
3
$ cd /tmp
$ wget http://wordpress.org/latest.zip
$ unzip latest.zip

Step 3: Overwrite all new files

1
2
3
$ cd /public_html/yourblogname
$ cp -avr /tmp/wordpress/* .
$ rm -rf /tmp/wordpress /tmp/latest.zip

Step 4: Database upgrade

Open a browser and go to http://yourblogname.com/wp-admin/upgrade.php

You’re done and you can repeat this procedure to all WP blogs you have on your server.

PS. You need to replace path names and database name with actual values.
PPS. If something goes crazy, you can restore your old database and files from /backup/wp/yourblogname directory.
PPPS. Yes, 9 WordPress blogs. You obviously need to feel the joy of hosting blogs and websites on an unlimited bandwidth/quota web hosting company.

Full Story » Comments (22)