Guide to Trouble-Free WordPress Upgrade, 2.0.11 to 2.5.x

Posted: May 3rd, 2008 | Filed Under: Tutorials, WordPress |

WordPress has released its first bugfix, 2.5.1, people are getting the hang of the new WP backend and plugin authors are catching up. What better time to upgrade? A lot of prudent folks, like us, have been playing the wait and see game, standing pat with 2.0.11, the only other stable WP release.

I’ve just now upgraded this blog from 2.0.11 to 2.5.1 and there was only one hitch, and that was easily corrected, and in fact if I’d paid attention to my own advice, wouldn’t have happened at all. :-)

The key to a successful WP upgrade is a healthy database. If the database is stable and has survived the upgrade, and you don’t have any weird calls to obsolete tags in your templates, you are cleared for takeoff. Here are the steps you should follow to ensure that your database (which contains all your posts, pages, settings and comments, your WP site’s heart and soul) survives intact.

  1. Backup your database! If you have the WP Backup plugin, just use that to capture the latest MySQL dump. Otherwise, go through your web host’s control panel and PHPAdmin to export the *.sql file to your hard drive.
  2. Backup any changed files such as your themes, the quicktags.js file if you’ve customized it, and I usually backup the /plugins folder as well, just so it’s handy and I don’t have to hunt down all the plugins I’ve installed.
  3. Disable all your plugins. You can do this manually from within the WordPress dashboard or you can cheat like I do. Just rename your /plugins folder. If WP cannot find the /plugins folder, it thinks you don’t have any installed. You can restore the folder’s correct name after you’ve successfully upgraded.
  4. Chart your upgrade path. If you are upgrading from 2.0.11, you should upgrade incrementally, like this: 2.0.11 > 2.1 > 2.2 > 2.3 > 2.5 > 2.5.1
  5. Make sure you have downloaded and unzippped to folders all of the WP versions you’ll need to complete your upgrade. You can find them in the download archive.
  6. Using your favorite FTP program, upload WordPress, starting with 2.1, from the folder you downloaded and unzipped. DO NOT UPLOAD any .htaccess or wp-config.php files from any of the distros! You will want to retain your own versions of .htaccess and wp-config.php already on your server.
  7. Once the first new version is uploaded, point your browser to the /wp-admin folder and upgrade.php. For example, if your WordPress install is at www.yourserver.com, you would go to: http://www.yourserver.com/wp-admin/upgrade.php.
  8. Proceed to upgrade the database when prompted.
  9. Repeat steps 6, 7, and 8 above (uploading the incremental versions, invoking upgrade.php and updating the database) until you’ve upgraded all the way to WordPress 2.5.1. (Using the upgrade path above, that should be five FTP passes.)
  10. After you’ve upgraded to 2.5.1, your WordPress database should be ready to go. Rename your /plugins folder if you cheated in the step above, or login to WordPress and activate your plugins, one by one, testing to make sure your WP site doesn’t throw out any blank pages. If it does, you have a plugin that isn’t ready for 2.5.1. Make a note of it, keep it deactivated (or delete it altogether) and make a note to find a replacement for it later.
  11. If you get any kind of errors when working in the backend of WordPress, don’t despair. I’ve saved the best for last. It’s what happened to me. It’s simply a matter of a server burp and a critical file (aren’t all program files critical?) not being uploaded properly during the FTP process. Go back to your FTP program, and delete the following files/folders:
    • /wp-admin
    • /wp-includes
    • all *.php files in the WP root EXCEPT .htacess and wp-config.php
  12. Reupload the WP files from the latest version (except any .htaccess or wp-config.php files from the distro). Having deleted the original files, you are ensuring that you have uploaded the freshest versions, not depending on your FTP program to accurately overwrite them.

You should now be able to log into WP and any issues you had should have disappeared. If not, you may want to post in the WordPress Support Forum to find an answer to your problem. Happy upgrading!

1 Comment »

  1. Thanks for this. I was cruising for compatible themes before I upgrade. Been waiting for 2.51 and so now it is time to bite the bullet!

    Comment by Diana L Guerrero — June 15, 2008 @ 1:51 pm

RSS feed for comments on this post.

Leave a comment