Upgrading to WordPress 2.6
17 July 2008
Blogtender was hacked yesterday, resulting in a handfull of posts getting a list of invisible links added to the bottom, I assume in the hope that Google will pick them up. After changing my passwords (probably unnecessarily) I decided to upgrade to WordPress 2.6. The upgrade process is easy enough in theory: just back up your updated files (themes etc), delete everything, then upload the new files. Add your stuff back on, hit the upgrade.php file, and you’re done. Unfortunately I forgot to back up the database, a bad move as the upgrade wiped all my categories. Luckily all the posts were unafected, but it took a while to fix.
In case anyone finds themselves in this position, here’s what I did, bearing in mind that just beacause it worked for me doesn’t nessesarily mean it won’t screw your site up even more.
- Connect to the WordPress database with phpMyAdmin and open up the wp_terms table.
- Run the following sql to replace the blank category names with their id number. Without doing this you can’t easily edit the categories with the WordPress admin interface.
UPDATE `wp_terms` SET `name` = `term_id`; - Now log in to WordPress and go to Manage > Categories.
- Clicking links in the ‘Name’ column will open up the Edit Category page. Clicking the number under ‘Posts’ will show you all the posts in that category. I was able to figure out the categories based on the posts in each. Luckily I don’t have too many categories, though I did delete a couple that only had one post.
Next time I’ll be a bit more careful upgrading, and will definately make sure I have a backup of the database. I was lucky I didn’t get burnt worse than I did!



David Cumps
18 July 2008 @ 2:03 am
Had the same problems upgrading :/
Made a small post about it as well, with screenshots, in case someone reads this and want some more reference material.
Valuable lessons though, backups are holy! :p