General
How I Upgraded to WordPress 2.3 on Live Blog With Zero Downtime
3Few days back I had noted on this blog that the WordPress 2.3 upgrade of my blog went trouble-free and the blog was inaccessible only for less than a minute during the upgrade. I had quickly noted down the steps that I had followed to do the upgrade and I am trying to give a shape to those rough notes in the hope that it may come handy to me in the future. Whether or not this will be useful to the others depends on whether they share the same environment as that of my blog. Most important factor to me was my web host Dreamhost‘s support for remote shell access which is very helpful in carrying out many of the following tasks conveniently. I find FTP, scp etc. to be slow and inefficient. I was also lucky that my theme and plugins didn’t me give any problems.
So let’s get started.
The general idea here is to create a complete replica of the current blog at a different location but using the WordPress 2.3 version. Such a copy can be made on a local system too(if LAMP stack is installed, say XAMPP) but because Dreamhost makes it so easy to work with the remote shell, I decided to make the copy on the Dreamhost server directly.
- Let us first get everything ready that is needed to make a copy of the existing blog. We need to create a new directory to install WordPress 2.3 in it and also need to create a new database to import the old posts into it. (If you can’t/don’t want to create a new database, you can use the same existing database and use a new table prefix(e.g. wp2_) instead, but there is always a tiny-weeny bit of risk involved with this.)
From the control panel of your web host, create a new sub-domain and name it something like blog2.domain.com(you can create just a new directory too like domain.com/blog2); on Dreamhost this creates a new directory with the name blog2.domain.com and I use this directory name in the rest of the post.
Create a new MySQL database and let’s say you name it wp23_db. You can do this (1) using mysql command in a remote shell(ssh), (2) using phpMyAdmin web interface, or (3) from the control panel(like cPanel); use whatever method is provided by your web host. Note down the host name, user name and password details for the created database for future reference. On most web hosts the MySQL host name will be localhost, but on Dreamhost it will be mysql.domain.com.
- Download WordPress 2.3 and extract it in the newly created directory, probably using FTP, like you might have always done. Or preferably, use subversion to install WordPress 2.3 this time. If you use Dreamhost, you can connect using ssh/putty and run the following commands:
sh# cd $HOME/blog2.domain.com
sh# svn co http://svn.automattic.com/wordpress/tags/2.3 . - Copy the content files(theme files, uploaded files etc.) from your current blog directory to the new directory:
sh# cp -rpf ../oldblog/wp-content/* wp-content
sh# svn upAlso include any other directories you might have created to store non-Wordpress files like images.
- Now import all the data from the old database to the newly created one. You may prefer to export/import from the phpMyAdmin interface, which makes it a very easy task but painfully slow, so I use the command line instead:
sh# mysqldump ––add-drop-table -u
-p -h mysql.domain.com > exported.sql
sh# mysql -u-p -h mysql.domain.com wp23_db < exported.sql Remember to use *your* username, password, MySQL host name and database name in the commands.
You might consider disabling all the plugins in your current blog *before* exporting the database and then re-enable them as soon as the export job is finished. Actually it is strongly recommended that you disable the plugins before exporting the database as it may be necessary in your case depending on what plugins are installed on your blog. For the record, I didn’t have to disable the plugins(I was using the 3.0 beta version of Google Sitemap and latest versions of all other plugins).
- The database is ready now with all your posts in it. Next enter the database details of this *new* database(wp23-db) in the wp-config.php of the new 2.3 installation:
sh# cd $HOME/blog2.domain.com
sh# cp wp-config-sample.php wp-config.php
sh# emacs -nw wp-config.php[php]
define(‘DB_NAME’, ‘wp23-db’); // The name of the database
define(‘DB_USER’, ‘username’); // Your MySQL username
define(‘DB_PASSWORD’, ‘password’); // …and password
define(‘DB_HOST’, ‘localhost’); //mysql.domain.com in case of Dreamhost
[/php] - Before we can access the administration area of the new blog we need to edit a field in the database. Change the value in wp_options -> siteuri and wp_options -> home fields in wp23-db database i.e. replace the old blog URL with the new URL(i.e. change http://oldblog.domain.com/ to http://blog2.domain.com/ – either use phpMyAdmin or the mysql command to do this). (This is a cumbersome step and I think the URLs should be stored in a configuration file instead of in the database.)
- We are ready to run the upgrade script now, go to http://blog2.domain.com/wp-admin/upgrade.php to do so. You can now access the new, shiny WordPress 2.3 powered blog at http://blog2.domain.com/ :)
If you can’t access your blog at the new URL, try:
- Copying your old .htaccess file to the new directory:
sh# mv $HOME/oldblog.domain.com/.htaccess $HOME/blog2.domain.com
- Going to the Options -> Permalinks page in the WordPress administration area of the new blog and clicking the Update button.
In case parts of the blog look broken or you see database errors referring to tables such as post2cat, some of the plugins may be at fault, see the next step.
- Copying your old .htaccess file to the new directory:
- If you had disabled the plugins in your old blog before exporting the database(Step 4), then obviously the new blog will start with all of them disabled as well. Try enabling them one by one and see if any of them cause any trouble, in which case, consider upgrading the problematic plugins to their latest versions, or simply disabling them until you find a solution to it. You can read more about which plugins are compatible with WordPress 2.3.
If your theme looks broken, then you can try to fix the incompatible code yourself or try to use a new, 2.3 compatible theme. The chances of a theme breaking disastrously is extremely rare if you ask me. Rich’s article has a workaround.
- If you are happy with the working of the copy of your blog at http://blog2.domain.com/, it is time to make the final switch from the old blog to the new one. (Note that the old blog was serving your readers faithfully all this time without being affected by all the upgrading stuff we have been doing in the background). This is a critical step and you should confirm multiple times that your WordPress installation and the database backups are in sound size and shape before proceeding further. Do this as part of the final step:
- Change the URLs to point to your original blog location:
Go to http://blog2.domain.com/wp-admin, change the values in Options -> Blog Address and Options -> Website Address to http://oldblog.domain.com/. You can change the URLs directly in the database too, like we did in Step 6. -
sh# mv oldblog.domain.com tempblog.domain.com && mv blog2.domain.com oldblog.domain.com
Your web host may instead support mapping of domain names to directories in a different way. Use whichever way is available to you to map the old blog URL to the new installation directory. If you think something has gone wrong, then you have to reverse only this particular step.
You can now access the upgraded version at http://oldblog.domain.com/
(Delete the old database, old installation directory and the new sub-domain if you like.) - Change the URLs to point to your original blog location:
That’s it. Did I goof-up somewhere? I hope you at least got the gist of the method of upgrading described above. While enjoying the new features of the 2.3 version, try to make some time to read useful posts about WordPress 2.3 on the web. Mine was a success story, you may want to read about a different, not-so-positive WordPress 2.3 upgrading experience too. I could add a few more miscellaneous points such as how FTP too can be used instead of a shell to achieve the same end result but I think we would agree that the post is already quite long :)
Upgrading to WordPress 2.3 with Zero Downtime!
1I had decided to upgrade my wordpress blog to the 2.3 version once it gets released but I was planning to create a duplicate of this blog and work on it for couple of weeks before overwriting this original blog with the upgraded copy. I had never imagined that the whole upgradation process will go so smoothly without any database schema, plugin or theme issues and with literally zero downtime.
My blog is running on WordPress 2.3 version now! But you can’t see any difference? That’s the whole point! :)
I did not disable a single plugin during the upgradation process though I still need to test if all of them are working properly or not. They do not currently produce any observable bugs at the least. Throw me an email if you find a part of the site broken.
To be completely honest, the site did go down for around 40 seconds towards the end but that was because I goofed up a little bit. A simple rename set everything right. I am now planning to disable/uninstall some of the plugins, make a list of additional plugins to install and also search for a more 2.3 friendly theme. I am happy with categories for now, so I am keeping them; tags will have to wait.
If I can find time, I will try to document the process that I followed to upgrade this blog which I did in less than 30 minutes. I followed the subversion procedure to upgrade the blog. More details soon…
Update: Done, I have documented the entire procedure.
Microsoft’s Mobile PC Newsletter Features Linux-enabled Nokia N800
0Microsoft’s Mobile PC Newsletter of the month of September(2007) features a section on Linux-powered Nokia N800 Internet Tablet about an article written by Matt Faulkner on gottabemobile.com. The website basically features Windows powered Tablet PCs and UMPC devices. As Matt himself says:
We don’t deal with too many devices that aren’t Tablet PC or UMPC related, but there are a few that enhance our ‘Mobile’ life, and the N800 could be one of those devices.
Fair enough.

But what took Microsoft’s “Mobile PC” Newsletter so long to mention a mobile product that is almost nine months old today? It’s not even a detailed review of the product, just a short post by Matt! I felt strange that such a passing mention of a nine month old Linux-powered product found space in Microsoft’s newsletter :)
I Am Most Like Darren Rowse!
0Matt’s blog pointed me to Technosailor’s Self Importance test that tells you which web celebrity you most closely resemble with after you answer just 13 questions. The questions were simple in the sense that you can complete it in less than 30 seconds, so I took the test, and the result says that I am most like Darren Rowse of ProBlogger!

I don’t know if these web celebrities were actually questioned to find out about their lifestyle or the information was derived from public knowledge, but when Matt took the test, he says that he turned out to be most like Jason Calacanis and not himself! (Yes, Matt says he is one of the possible outcomes.)
What do you plan to do on the Software Freedom Day(Sep 15th)?
0September 15, 2007 is going to be celebrated the world over as Software Freedom Day.
What do you plan to do on this year’s Software Freedom Day? I plan to do the following in the coming days leading up to September 15:
- Learn emerging trends and new developments related to the Freedom Software Movement. Charity begins at home they say ;)
- Remind some of my closest, not so tech-savvy friends about the benefits of using Free software. Especially those who showed interest the last time I raised the topic of benefits of Free software.
- Display the following(or similar) “Software Freedom Day” banner somewhere on this blog.
- Help those who are interested in installing/configuring a GNU/Linux distribution, get them started with basic set of tools and applications and finally point them to the various sources of help/documentation(IRC, forums, mailing-lists etc.) so that they can take care of themselves from there. Hand interested people burned GNU/Linux distribution DVDs.
- Make a list of reasons why a typical Internet user, a software developer or heavy users of productivity tools should consider GNU/Linux as a possible alternative. Also tell them that they probably should stick to Windows if they expect zero learning curve or are avid fans of computer games. Make also a list of feature-filled Free software available for the Windows platform(or just give people TheOpenCD) for such die-hard Windows users. Post the lists on relevant forums and mailing-lists(where such lists would be welcome, I am not a victim of Raymondism).
- Personally, I will try to make another desperate attempt to get rid of the few non-free software that I still use on Windows(I mostly use GNU/Linux). I love the philosophy behind the Freedom software but at the same time I don’t like using a Free software even when it is not up to the mark(I commend those who do). But I am one of the first to adopt such software as soon as it comes even a little bit close to its non-Free competitor. Examples of my late adoptions are 7-zip, Foxit PDF Reader and FileZilla FTP client.

Non-Free software I still use today include(other than Windows itself): VMWare Workstation, Kaspersky Anti-virus and Nero CD/DVD Burning software. I have tried Xen, QEmu etc. but I think they are not there yet. I liked ClamWin anti-virus and still use it from a PortableApps powered USB drive but Kaspersky is the only tool that keeps me from going mad with every newly released virus or worm on the Internet. I like K3B on GNU/Linux more than Nero but K3B for Windows looks very unstable to me. Anything other good recommendations?I will try to give another chance to Free anti-virus and CD/DVD burning tools.
- Blog about the Software Freedom Day. But wait, it is already done! ;)
More Information:
Where to get more information about Software Freedom Day?
- Official Website of SFD
- Software Freedom Day Start Guide
- Poor Entry at Wikipedia
- What is Free software?
- Mark Shuttleworth on Software Freedom Day
So what is on your agenda for this year’s September 15th?
Recent Comments