Tips for Avoiding WordPress 2.3 Upgrade Problems

February 8th, 2008 Da Vinci

Keeping up with software updates is considered best practice, but it can be a pain. WordPress is no different. All my previous WordPress upgrades have been smooth, but I was reluctant to upgrade from 2.2 to 2.3 because I was using the Jerome’s Keywords plugin (which enables tagging) and feared that it would conflict with the native tagging support in WordPress 2.3. That was before I learnt that WordPress 2.3 has import support for plugins like Jerome’s Keywords, Ultimate Tag Warrior, Simple Tags, and Bunny’s Technorati Tag. The nagging knowledge that I should upgrade finally won me over this week, but my fears realized and it took me a few hours to get my site back up. Here’s what I have learned.

Understand the Best Practices for Upgrading

The WordPress upgrade instructions are very good and include details on how to backup your WordPress database. Now backing up is probably the single most important best practice and the upgrade instructions includes a specific step to verify your backups, but you need to make sure you know how to restore your backups. I have been using the MySQL Administrator to do full daily, weekly and monthly backups, but when things went wrong with the upgrade I was surprised how unintuitive the restore process was. In fact, restoring seemed more risky than resolving the upgrade issues I decided to rather figure out the upgrade incompatibilities. Had I known how to restore – with confidence – I would have been able to recover much quicker. A blogger is likely to have upgrade issues at some point in time and it will almost certainly be caused by a plugin, so please think about that before you go plugin crazy.

Reactivate Plugins Very Carefully

The upgrade instructions explain that you should first deactivate all your plugins, then do the actual upgrade and then reactivate your plugins. I followed these instructions, but it’s with the reactivation where things went wrong for me. The Jerome’s Keywords plugin like many others makes database updates when it’s activated. What I didn’t realize was that when I reactivated it, it apparently conflicted with some of the WordPress 2.3 upgrades. What I should have done was to run the new Jerome’s Keywords import feature, which can be found under Manage, Import in the WordPress admin interface and not reactivate the plugin. While that in itself wouldn’t have made the upgrade flawless because I also had to make theme updates, it would have prevented my blog data from becoming partially corrupted. The solution to my specific problems with the Jerome’s Keywords plugin was:

      1. After I had upgraded and reactivated the plugin, I deactivated it again.

      2. Reran the Jerome’s Plugin import in the admin interface. It returned zero records this time, but it seemed to fix the database structure.

      3. Updated my theme to use WordPress’ tag functions rather than the plugin’s.

      4. Created Apache rewrite rules to convert plus signs to dashes. The Jerome’s Keyword plugin uses plus (+) signs to separate words while the new WordPress tag functionality uses dashes. This seemingly simple rewrite rule probably has a simple solution, but I resorted to a list of less elegant, static rules like:

      RewriteRule ^tag/portable\+apps(.*)$ /tag/portable-apps$1 [R=permanent,L]

Other WordPress Upgrade Tips

  • PHP has a built in function that can be used to check if functions exist. This can be used to make your WordPress theme more forward compatible. Be warned though that by using this functionality you could be hiding incompatible theme components which would otherwise be exposed with clear PHP error messages. These missing page elements would probably be the results of customization that you made from plugins. So you need to decide what’s more important: a broken site with clear error messages or a less broken site with less clear signals that there’s a problem.
  • Upgrade as frequently as possible, but don’t become careless because they seem easy. By updating frequently you become more familiar and comfortable with the upgrade process. That is good, but don’t overlook the basics of upgrading: create backups and know how to restore them yourself when needed.
  • When you upgrade, take the time to learn about new features. Many new features are only useful when you update your theme to use them. For instance WordPress 2.3 introduced tagging and so themes that were created before 2.3 would not include the new tagging functionality like adding a tag list or a tag cloud.
  • When all is said and done I am happy to have completed the upgrade and in retrospect it was a good learning experience. :)


    Leave a Reply

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>