Upgrading from WordPress 2.1 to 2.3.3

by Richardson ~ March 26th, 2008. Filed under: Blogs & Blogging.

While WordPress (WP) is an excellent, free platform for blogging, there is a tendency for upgrades to break blogs, plug-ins, and favorite themes. On one level this can be expected; progress must occur and not every feature and be backwards compatible. However, WP developers have largely failed to prepare non-technical users for some of the issue presented by the last few versions.

For example, changes the structure of the SQL database (DB) and from Latin1 to UTF8 character encoding. The DB structure change has the potential to break themes and plug-ins (and could prevent restoring from previous backups), while the encoding issue can break not only Korean characters, but quotation marks, apostrophes, etc.

The upgrade was finally managed through a long, methodical series of attempts; I’ll explain that process here for those in the same boat – wishing to upgrade to 2.3.3 from a manual install of WP 2.1 or earlier.

This assumes you’re using the semi-standard Control Panel that comes with most hosted packages, which includes Fantastico, File Manager, Unlimited FTP, phpMyAdmin, or similar tools.

These options would *not* work for me initially (I tried 2-4, several times with slight variations):

  1. Fantastico upgrade – not an option as the blog experienced a problem last year that required a manual reinstall, meaning a manual upgrade was the only option. I reinstalled 2.1 at that time rather than upgrade as I knew my theme, which I had spent many hours customizing, would not work on 2.2.x.
  2. New Fantastico 2.3.3 install with old MySQL DB backup/restore – different table structures in WP 2.2.x and above means 2.1 DBs will not work.
  3. XML backup/restore – this is a built-in Import/Export feature of WP in the Manage admin area, however “more” tag (which I use extensively, including in this post) cuts off posts in the backup! (as well as in RSS feeds)
  4. Export2mt.php – a workaround to export in Movable Type format and then import into a new blog, but would not import all my posts; came up at 1,299 each time (about 400 short) even after clearing the cache and using a different browser. I checked the code to see it there was some sort of limit imposed but found nothing there that I though would. (get the file here, change extension to .php)

The first step before doing anything else is to back up your blog’s DB (I suggest saving the entire file and each table individually, but you will need to save the wp_posts.sql separately from the rest of the DB for this upgrade), any themes you’ve modified that will work under WP 2.3.x, and image files uploaded to directories within the WP files, etc. This plug-in may or may not work for you.

In anticipation of moving to a UTF8 environment, I used this plug-in to change my 2.1 DB from Latin1 to UTF8, though I later found that I didn’t really need to do this.

Through much trial and error on test blogs, this is the process for getting all posts and comments transferred:

  1. Install a test blog with your current version of WP. This is an important step as you don’t Fantastico normally won’t install older versions, so the easier way to generate an SQL DB (with username and password) for this is to;
    • Install a 2.3.3 blog, save the wp-config.php file, delete the WP files (via File Manager, or FTP if that’s your only option), and drop the SQL tables (via phpMyAdmin). Note: if you only empty the tables this will not work, they must be dropped.
    • Download your legacy version of WP (2.1 in my case), unzip and upload the files, and upload your SQL DB.
    • Modify the wp-config.php file to reflect the correct username and password for the SQL DB.
    • Important: if you ever used the “more” tag, open the backup of wp_posts.sql in WordPad and replace (use find/replace on the Edit menu) every instance of the “more” tag with a space. Why? We will be using the WP export to XML function to export posts and comments, and the “more” tag will cut off posts using it!
    • Drop only the wp_posts.sql table and upload the one with no “more” tags.
    • Test the blog to make sure all posts and comments made it through. Compare post/comment numbers given on the dashboard or your main blog and the test blog. If you have problems, repeat the above steps.
    • In the WP admin area, go to Manage, Export, and download the XML file.
  2. Install a 2.3.3 test blog via Fantastico.
  3. Upload a php.ini file (like this one) to change the default upload size from 2 MB to 20 MB. You’ll need to do this unless you have a relatively young blog with few posts and comments. You can edit the file to change the setting if you need more than 20 MB.
  4. In the 2.3.3. blog, go to the admin area, Manage, Import, and import the XML file.
  5. Ensure that all your posts and comments made the transition via the Dashboard. If the encoding looks wrong, change the encoding in wp-config.php to Latin1 or UTF8.
  6. To bring your links over, go to http://your.old.blog/wp-links-opml.php. This will import your links, but you’ll have to edit each one to assign it to the correct category. At this point you have imported all your old posts, comments, users, and links.
  7. Backup the 2.3.3 test SQL DB, including individual tables just in case.
  8. Ensure you’ve saved your images, themes, plug-ins, and other and customized files in your actual blog before uninstalling it via Fantastico or simply deleting all the files and the SQL DB.
    Install a new 2.3.3. blog via Fantastico in your root directory.
  9. Via myPphAdmin, drop all the tables and upload the DB backup from your 2.3.3 test blog.
  10. Ensure that all your posts, comments, and links are there. You may need to run the upgrade.php program to change some of the settings and ensure the blog is pointing to the correct directly.

A bit convoluted, but it will work. Hopefully in the future WordPress developers won’t make the process so damned difficult. You can now delete your test blogs, unless you want to keep them around for further testing (themes, etc.).

5 Responses to Upgrading from WordPress 2.1 to 2.3.3

  1. Jack

    Heh, from 2.3 to 2.5 is not going to be fun because db changes happened as well as a new admin panel. WP says some plugins will not work. I am going to make sure the existing plugins I have will be ported to the new schema.

    I do not use the Fantastico for installation because the hosting I have is on a friend’s server. The other server DPRK Forum was on really, really sucked as you know.

    It is in RC status right now, and hopefully the process will be smoother. DPRK Forum has been my biggest success for any web site I have created thus far, and keeping everything together from upgrade to upgrade gets harder and harder. When there was nobody around, I could wipe everything and start over. Now it is not that easy. The new theme you have looks pretty decent by the way.

  2. Joshua

    Why should I even try this? It’s not broke yet.

    When I see someone as technologically advanced as yourself have so much trouble with this, I can just imagine how much trouble I’d have.

    I like your template tweaks, btw.

  3. Richardson

    Jack,
    I’ll email you separately about a possible workaround for you.

    Joshua,
    One major reason is security - some releases have real issues (e.g. 2.1.1). Another reason, which I found on the test blog as well, is that 2.3.3 is actually a lot faster than 2.1 in publishing/editing posts ~ very little lag. And there are several minor improvements that are nice.

    I was also upgrading in prep for 2.5, and as Jack points out more DB changes. But now that I’ve gone to 2.3.3 I will have the one-click (or is it two?) Fantastico option via Control Panel. I’d have had to go through the process eventually, and got it over with.

    On the new theme… it was all I could find on short notice that I liked and could modify to fit my old design. There are a few things about it I don’t care for, but overall it’s ok. Can’t wait for an updated K2 based 3-column theme to come along, though.

  4. James Na

    I noticed a significant increase in publishing/editing speed from the previous version. It went from about 2-3 minutes to 2-3 seconds.

    While such a difference is minute in a big scheme of things, it does seem like a pretty big difference in the digital era, in which we live!

    I like the new setup.

  5. Jack

    I just upgraded to 2.5 and seems to working just fine so far. I am still testing it.

Leave a Reply

Subscribe without commenting