Upgrading WordPress (2.1.0 to 2.6.2) – what a mission

Here’s the short of it for those that don’t want to read my whole epic.

While trying to upgrade from WordPress 2.1 to 2.6 I was presented with the database upgrade page when trying to get to the backend (/wp-admin). Upon clicking the Upgrade button/link a half-ream long list of “Table doesn’t exist” errors were displayed.

WordPress failed database upgrade - Table doesnt exist error messages.

WordPress failed database upgrade - Table doesnt exist error messages.

The reason WordPress can’t find the tables is because it fails to create them during the database upgrade. For the full reason behind why this happens you’ll have to read the whole post. If you’re only interested in what to do to get it working the next three paragraphs and two code samples should explain all.

In WordPress 2.2 two new settings were introduced in the wp-config.php file namely DB_CHARSET and DB_COLLATE. By default, that is in the wp-config-sample.php file, it sets these variables to ‘utf8′ and ‘utf8-general’ respectively.

define('DB_CHARSET', 'utf8');
define('DB_COLLATE', 'utf8-general-ci');

If you added the DB_COLLATE option to your old wp-config.php file and retained the default option as given in the sample file then it is highly likely you experienced this error since utf8-general-ci is not a valid MySQL collation. The silly little error that causes so much grief lies in the dashes — they should be underscores.

Most MySQL installations use utf8_unicode_ci as the default collation. You’re likely to get joy by setting the DB_COLLATE option to

define('DB_COLLATE', 'utf8_general_ci');

Continue reading