Posted on 19 August 2007

Blog Backup Scare

Written by Robert Merrill

Topics: Uncategorized

Ouch.  Well, the fact that you can read this is a good thing.  I had an issue today when suddenly my blog went down.  It appears that, while I was posting something, mySql freaked out on me right then and corrupted my wordpress_options table.

The end-result was that my homepage said “Looks like you haven’t installed wordpress yet.  Try install.php” which scared the heeby-jeebes out of me, because I worried that I had lost all three years of my posts!

Since I was on the site when it happend (it was there, then not there), I immediately logged into phpMyAdmin and backed up my database… or whatever was left of it.  Luckilly, it appeared as if all my posts were still there–which are, the most important thing.

Using google, I found this interesting post where he mentions somehow his wordpress “uninstalled” itself and gave an error message.  Going back through my db in phpMyAdmin, I  found that the _options table was corrupt and I mulled over how to fix this.  Here’s what I did:

Goal: Redirect WordPress to a new location in my DB, then create a fresh install.  Use the fresh tables to replace my corrupted ones, thereby keeping my data present, but just losing some of my configurations/customizations.

  • I created a copy of my wp-config.php file in the root directory.
  • I edited the wp-config.php file to use another prefix to the table names… I put an “aa_” in front of it.
  • Going back to my website, I went ahead and installed wordpress again, thereby letting it create a “fresh” install of wordpress, but (this is CRITICAL) pointing at this new, temporary location in my DB.
  • In  phpMyAdmin, I  had verified that my  options table was the only one crashed.  I selected that table and DROPPED it, which deleted it.
  • Then, I selected the aa_wordpress_options table, which was from the fresh install I just did.  Under Operations, I renamed the table to replace the wordpress_options table I just deleted.
  • Then I deleted the new wp-config.php and renamed the old one back to wp-config.php.  This points the database back where it belongs.
  • When I reloaded the blog homepage, it seemed to work.  But logging in with my old username/password yeilded a “You do not have permissions to access this page” error.
  • I almost gave up at this point.  I checked my DB to be sure the userIds were matching.  Check.
  • I checked to be sure my user had admin priviledges.  Check.
  • I the googled the error code, and found Mark on wordpress’s force-install script. Which comes under the theory that wordpress didn’t complete an update.
  • To be sure, I went ahead and uploaded the latest version of WordPress and tried to update it, but it said I was already at that version.
  • Then, I ran the force-install script and everything unlocked beautifully.
    • Except now I had to enable all my plugins and reconfigure a few things I had customized.

1 Comments For This Post I'd Love to Hear Yours!

  1. Jonas Says:

    Hey, there is a new blog backup service at

1 Trackbacks For This Post

  1. Bruce Lawson’s personal site  : WordPress blog ate itself Says:

    […] cursing my webhost all day, who then explained that it’s a known WordPress problem, found a solution, restored the database and began patiently putting the permissions right. So more good service from […]

Leave a Comment Here's Your Chance to Be Heard!