Comments table crashed, HostGator to the rescue

I finally upgraded my WordPress install today, and like a responsible web admin, I backed up my database and also my file tree. After my upgrade I noticed that my comments were all gone! I grumbled a bit and figured I’d extract the files from my backup. I opened my file up and noticed there were no comments. Doh! Where are they? I checked my backup from June, no comments. The latest backup I had with comments included was from February. The phpMyAdmin console showed the table “in use”. Not sure exactly what to do, I opened up a quick Live Chat with my hosting provider, HostGator, and noticed that I was #1 in queue with what, 147 agents available? My problem was fixed in less than 5 minutes. The fix also recovered a few comments that were posted after my last good backup.

I apologize to those of you that tried posting comments the past few months, because they were all eaten up due to the table being locked. I’m not sure what happened, but the support guy told me how to fix it myself if it ever happens again. Essentially, there’s a GUI in the cPanel to check and repair individual databases. I work with MySQL quite a bit at work, but I wouldn’t consider myself a DBA. Now I need to find a better WordPress backup plugin, because I think it should have thrown out some type of error if the table wasn’t readable.

Anyway, I’d like to take this opportunity to recommend HostGator. If you need hosting, please check them out. Any signups done through my link will help pay for my web hosting. Also, you can use code SCIFI25OFF for 25% off your first order. They offer 1 click WordPress installations if you are looking for something like that.

Here are my steps prior to all WordPress upgrades:

  1. Backup Database via Plugin, also can be done through phpMyAdmin
  2. Open cPanel and through File Manager, copy my WordPress directory “/installdir” to another directory like “install2011backup”. I think you can only do this quickly if your blog is not installed directly into the root /  – note, this takes just SECONDS, rather than downloading thousands of individual files
  3. Run upgrade, hope for the best

Here is how I restore

  1. Restore Database via phpMyAdmin
  2. rename install directory to /install-bad
  3. rename backup directory from /install2011backup to /install

Do you have a blog? What is your disaster recovery plan?

1 thought on “Comments table crashed, HostGator to the rescue”

  1. Sounds a lot like a case of broken tables. You can fix this yourself in phpmyadmin a lot of the time by using the query

    REPAIR TABLE $tablename

    that will restore the table quickly for you should this happen in the future.

    You can probably make a crontab to auto check / repair tables once every so often to help prevent down-time.

    Hope this helps out 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

Please prove you are a human * Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Post

Yes, I am still aliveYes, I am still alive

Where have I been lately? A number of factors have resulted in me not posting since December. One of which was that over the past few months I’ve been chipping away at The Collected Stories of Arthur C. Clarke. At just shy of 1,000 pages, it has been my lunch time reading for a while now. There are a couple short stories that I plan on reviewing, as soon as I can remember to bring the book home from work. I’ve also been filling most of my free time, 177 hours now, with playing Battlefield 3 (my stats).

I’ve watched a few movies, but I didn’t get around to reviewing those. One was Gamer, which I didn’t expect much from. The other was Battle: Los Angeles, a cookie cutter “aliens attack, let’s fight back” movie. I didn’t really “watch” these as much as listened to them as I cleaned out my office. After going through my recent posts, I noticed that I never reviewed 28 Weeks Later. This was actually one of the sequels I’ve seen that I liked more than the original. I might have to re-watch, then write up a review. I watched a decent movie last night though, The Adjustment Bureau, which I plan on reviewing in the next few days, if not tonight. My goal for myself is to have it done before the end of the month. Thank goodness for leap years!

OK, enough excuses. Thanks to all of you that still have me in your newsreader. I’ll try to be better about posting updates in the future.

Blog formatBlog format

I have been unsatisfied with my site layout since I launched the domain back in 2006. It was rather simple, but having all of my reviews on one page is getting rather cumbersome. Rather than cut and paste my reviews into unique files I figured that moving to a blog format might be the best move. This will also give me the opportunity to post about things unrelated to what I am currently reading. I’m hoping I can organize things better this way and possibly go back and work on some short story reviews also.

I haven’t yet enabled user comments, but I will as soon as I finish minor tweaking to my template.

Snowtrooper meet Luke Skywalker, time to die!Snowtrooper meet Luke Skywalker, time to die!

The Empire Strikes Back snow trooper

Snowtrooper action figure

I had the opportunity to meet a couple “online” friends this past weekend. I’ve talked to these guys for several years through various online games, instant messaging, Ventrilo/TeamSpeak, and e-mail. Meeting them was a very interesting and enjoyable experience. BrainAlien, a guy I’ve known online since 1999, gave me a Snowtrooper action figure. He knows I’m a huge Star Wars fan, so I really appreciate it. If I ever find my Luke Skywalker in X-Wing suit, I’ll have to have a little battle to relive some childhood moments.

Thanks BrainAlien!