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.

  • Techsandy

    Thanks for ur information….

  • Pingback: Upgrading Wordpress via Shell Access Jubel and The Unessential | internet marketing tools()

  • boys and gals don’t try this at godaddy shared hosting, coz there’s no shell access :mrgreen: servernya semamput !
    antoher method to upgrade your wp is to download latest version of WP through rapidleech, but it less effective compare to upgrading via shell as Michael menitons above, but it’s still usefull if internet connection is a main cause.

  • Pingback: Upgrading Wordpress via Shell Access Jubel and The Unessential | fix my credit()

  • Hello !! ;)
    My name is Piter Kokoniz. oOnly want to tell, that I like your blog very much!
    And want to ask you: is this blog your hobby?
    Sorry for my bad english:)
    Thank you:)
    Your Piter

  • You need to have a VPS , Dedicated or Reseller for doing that. Thank you for sharing this . Power of the codes ;)

  • Very nice instructions to upgrade WordPress via UNIX shell prompt. I will have to give this one a try on one of my blogs with a standard theme that hasn’t been modified.

  • i’m new. still dont get it.

  • Boleh boleh….

  • Wow, this is so simply. Been in front of me all this time and never saw this. Thank you, this will make my life so much easier.

  • Hi Jubel!
    Sayang saya tidak bisa memakai Shell. Tapi gue udah upgrade WP 2.7 via FTP and it feels great.
    BTw, Jubel pasti datang ke Wordcamp Indonesia khan? Senangnya. Saya sudah daftar tapi lagi nunggu kepastian. Mudah2an diterima coz saya pengen banget ke sana. Ketemu Matt *hehee jadi menyimpang dari topik, maaf*

  • happy new year bel.
    Btw mana niy postingan barunya..!!??

    :)

  • wp-content yang baru kan kosongan, cuma berisi plugins sama themes standar doang, jadi kurasa ditindih pun ga masalah, toh file2 yg lama ga akan ilang kan? kalo aku kemaren upgrade via plugins wpau mas jubel, n syukurlah ga ada masalah :)

  • wah, server dreamhost saya sebenarnya mengijinkan penggunaan shell… tapi ngga bisa makenya.. :(
    Ajarin donk..

  • ini WP versi terbaru kan ya mas ? saya coba instal ahh… thanks sharingnya.

  • I never knew this could be possible, you hit it right the hope, man. I just came here through enticeqh blog today. Thank you for this great interesting and useful tip you have shared here in this post.

    -srednarb-

  • I wont use wp 2.7 for awhile until I could upgrade my php memory limit. It loads really slower than ever. I downgraded my wp after a week of use (should be done earlier, but I’m too lazy to do so)

  • Nice tip. It is better to deactivate plugins and start upgrade process. Certain wp plugin like wp-cache put you in trouble ;)

  • Untuk folder wp-content nya ga perlu dipisahin dulu?
    Karena menurut WP, folder yg baru ga boleh nimpa yg lama.

    Seandainya emang ga perlu, next time saya akan cona tips ini.

    Makasih.

    • gak tuh. hehehehe.. tapi buat amannya sih dipisahin dulu supaya file2 lama yang udah tidak terpakai bisa dibuang. hehe..

  • wow, nice tips michael.
    I have never thought it before, I just used conventional method for upgrading my wordpress. And it took a long time.
    maybe I’ll use this technique later.
    thanks michael.

    /******
    dukung tim gladioolers di busby seo test dengan menaruh link http://umpcinfo.com/gladioolers di blogroll dg nama busby seo test. Dukung jg peserta lain, jgn sampe tim negara lain yg menang. thanks ^_^
    ******/

  • Pingback: Posts about Wordpress 2.7 as of December 11, | The Lessnau Lounge()