How I Fixed WordPress' Broken Upgrade
This morning I was greeted by a big upgrade button on my wordpress admin page. Clicking on it returned:
WordPress database error: [Unknown column 'user_nickname' in 'field list']
What's worse, it also broke my blog, because all the plugins were turned off by default. Here's how I fixed it.
There wasn't much any material explaining how to get past this problem, so I went about hacking wordpress until it was working again.
I later found that, somehow, a file had been uploaded designed to compromise my machine. It was left in /tmp/ - with a random.txt name. Update I've since upgraded the latest version following these instructions. I recommend you do the same if you found yourself in the same position.
Step 1
Add the missing column it was looking for. In MySQL run the following:
alter table wp_users add column user_nickname varchar(250);
Step 2
If you go back to the admin login page, and then proceed, it will show a half empty page. It's because the code is bombing out and throwing a fatal error.
Edit wp-admin/upgrade-functions.php, and edit this line (around line 654):
$all_options->{$option->option_name} = stripslashes($option->option_value);
To read:
if ($option->option_name) $all_options->{$option->option_name} = stripslashes($option->option_value);
Step 3
Go back to the login page, and proceed. It will complain about a missing category list table, but it will proceed.
You can then re-enable all the plugins. I noticed the upload folder is corrupted as well, so you'll need to update that from the admin page.
I'll be upgrading the base code shortly, but hopefully this helps anyone else stuck in the same position I was this morning.
[...] was a considerable amount of pain fixing my tagging structure after I got semi-hacked. In the end, I decided to ditch Simple Tagging, and covert my existing tags to the new Wordpress [...]
[...] So I started Googling and found I was far from alone. Great! There must be a solution out there somewhere, I thought. To my surprise, the vast majority of links led to users that had not yet resolved the issue. Luckily I came across a post on remy sharp’s b:log titled How I Fixed WordPress’ Broken Upgrade. [...]
I had a similar issue over at my blog. Seems like a lot of people are having a problem with the upgrade.php file - perhaps some of it of their own doing.
I simply wanted to upgrade to keep my blog up to date.
When I tried to run the upgrade.php page, it kept saying all went fine, only to ask me to upgrade again - it went in a loop. Anyways, i have described the problem in more detail on my post here http://www.dnxpert.com/2008/04/16/wordpress-25-upgrade-how-to/
The solution? It turned out I had the WP-Security plugin installed which was inadvertantly blanking out the WP version - and confusing the upgrade.php file. Once I got rid of the security plugin, the upgrade went fine.
I hope that helps someone.
John
[...] resolve this problem. I tried going by this entry by Rabid Gadfly, which in turn goes off of an entry by Remy Sharp. I managed to follow Rabid Gadfly’s how-to pretty well, but I couldn’t figure out what [...]
It didnt work. when i try to run that code in mysql it gave me this error:
SQL query:
ALTER TABLE wp_users ADD COLUMN user_nickname varchar( 250 )
MySQL said: Documentation
#1060 - Duplicate column name 'user_nickname'