Update Complete - Now To Collapse
Posted by Stropp on August 1, 2008Phew!
The update of Wordpress to 2.6 is complete. Finally. What should have been simple ended up being something of a nightmare.
After I completed the upgrade, which by using a plugin called Wordpress Automatic Upgrade, I loaded up the blog only to find some errors. Okay. I expected that. Dan over at the GamesLaw blog told me that he had problems with the popularity plugin. So I did my homework and found out how to fix it after the install.
Only it wasn’t the popularity plugin that failed. That worked perfectly. It was the actual Wordpress installer that royally screwed things up. Some of the errors disappeared after I updated all the plugins, 2.6 handles that from the blog… mucho coolio. But the categories at the bottom of the page were giving errors.
After doing a bit of checking, and it turns out that I wasn’t the only upgrader to experience this, I found out that WP 2.6 has a new database table structure. Where my categories were once stored in a single categories table, now they were spread out over at least two new tables. And the upgrade didn’t properly copy the categories.
The table had been populated with the categories, but all the names, descriptions and post slugs were missing. This in turn screwed up the functions getting data out of the DB to the blog, causing the error.
In this case there are three choices.
- Restore the whole blog from a backup and attempt the upgrade again (or leave it as it was.)
- Delete all my categories (they still showed up in the manage tab) and re-add them. I would then have to edit over 350 posts to re-categorize.
- Manually go into the database and fix things up.
I chose option three. I had performed a backup before starting — you must always do this — so I had the data from the old category table. I then copied it to a text editor and massaged the data into a SQL update statement. I created one for each category like so: (there were 39 categories in my db)
UPDATE `wp_terms` SET name = ‘General’, slug = ‘general’ where term_id = 1 ;
UPDATE `wp_terms` SET name = ‘Humour’, slug = ‘humour’ where term_id = 2 ;
UPDATE `wp_terms` SET name = ‘Vanguard: Saga of Heroes’, slug = ‘vanguard-saga-of-heroes’ where term_id = 13 ;
…
I then opened up the database administration tool that was provided by my web host, located the Wordpress database, opened the SQL tab and copied in the SQL statements above. At that point I held my breath, crossed my fingers, and executed the statements.
As I said there were two tables to update, wp_terms and wp_term_taxonomy. Both required slightly different update statements, so I made changes for the second table and repeated the process.
So far everything seems to be fine. I’ve got my categories back to the state they were before the upgrade, and I think they are all set against the correct posts.
I’ll tell ya. It was a tense couple of hours. I was a bit scared that I’d mess up the database. Even though I’ve done DB work before, it’s not my forte, I’m a C/C++/C#/Python sort of guy and more comfortable deep in that sort of code.
Now I sort of suspect that part of the reason for this is that I was upgrading from an older older version. I was using WP 2.1 and I think a few of the other folks having problems with this were doing the same. Still, it’s unacceptable. If I wasn’t technical, I’d have been lost big time. The only option would have been to spend hours and hours deleting and recreating everything. Or going back to an old install and never upgrading again.
And on that note, if you’ve attempted the upgrade and are having this problem. Shoot me an email and I’ll see if I can give you a hand working it out.
Man. This post ended up being longer than I intended. It’s time to collapse into a heap. My brain hurts.
Popularity: 6%



Heya Stropp.
Im about to attempt to upgrade my blog to 2.6 as well - wish me luck! Also I have moved my blog from worldofwarcraftguru.blogspot.com to http://www.worldofwarcraftblogger.com
I would be really grateful if you could update your great reads section for “wow blog.” Thanks a bunch and gl with 2.6
Glad to see you’ve got the problems worked out!
Add A Comment