Support » Fixing WordPress » Whole Tables Gone Missing From DB! Hacked?

  • Resolved Chester


    Got a very nasty surprised when checking my site today: a generic “Not Found” error instead of any content…no posts accessible at all. Looks like everything’s gone:
    – First thing I try is to get into the WordPress admin panel, but I can’t: my login doesn’t work and when I request password via mail, WP tells me my e-mail address is not recognized as an existing account.
    – Check my hosting admin panel and take a look at phpMyAdmin: my WordPress database only has five fields: basically just Comments and Options.
    – No Users table, so that’s why I can’t login or even register an account.
    – No Posts table…so about a decade worth of material is gone.

    Still don’t know if I was hacked or if my host had some problem. It seems odd that someone would hack into an account and do nothing but delete database tables.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Mark Ratledge


    Forum Moderator

    Sounds like your web host had a disk crash. Ask them if they can restore a back up of the database. Or do you have a backup?

    Unbelievably, my host (Bluehost) says no automated backups of my site were being made…because I have “too many” files in my space. (Of course, I was never *told* there was a limit to qualify for automated backups.)

    I think I have a backup from around four months ago, but I’m not entirely sure. If I do, I still lose hundreds of unreplicatable entries. And if I don’t, I lose a decade’s worth of content. I feel like a family member is having a medical emergency.

    – I have other domains hosted on the account and…
    – One that had a WikkaWikki installation that I mucked with…and whose database seems to be corrupted/lost…
    – And another domain with a WordPress installation which is perfectly fine. This one is running WP 2.8.1, whereas the ruined one is running the 2.8.6.

    Moderator Mark Ratledge


    Forum Moderator

    All it takes is a small disk crash or a partial crash on one disk of a raid system. Doesn’t matter what you’re running; all that matters is that the database stay “whole.”

    I once woke up one morning to find all the content in my site gone – two years worth of articles – but I had my own nightly backups, so I restored with phpmyadmin.

    See if you can find your pages in Google cache: or try

    If so, you can copy and paste the content, but you’ll have to reenter it into wordpress.

    Sometimes, even if there were no account backups made, there may be a separate database backup made. You may want to consider having your host check to see if a backup of the working database might have been stored in another location.

    In the future you probably want to keep an occasional backup of your own. There is a little Backups icon in the cPanel you can use to get a quick backup of your databases, etc. Of course, you can always export the databases from phpmyadmin or use FTP to get a copy of your files if you want to as well.

    Thanks for your feedback…and I’ll check to see if there might have been a separate DB backup…though after talking to two support techs, they’re saying no backups were made.

    I definitely have been reminded of the need to do regular backups…to not assume that the host is taking care of it. A few minutes per week and I could have avoided losing so much irrecoverable labor.

    I found a backup I made of the DB back in May 2008, so worst case scenario isn’t absolute catastrophe (though the missing time constitutes, literally, a month’s worth of work…as in 750 hours of work…at least). But at least I don’t lose my deep archives.

    Also, I found an 11MB XML file created in November 2008, which I think might be a random XML export/backup I made. Currently trying to import than in to see if that shrinks down the time span I’ve lost…

    In case anyone finds this via a search, I want to conclude this…so if anyone is in the same situation as me, they’ll see a way out. And/or to offer up to everyone a poor-man’s way of backing up one’s site…not in the most useful way, but in a way easy to effect and one that one might as well have as a backup to more malleable backups.

    So, essentially, my “issue” was that my host’s server somehow lost the Posts table of my WordPress database (but the Comments table was somehow safe). They had no backups of my site/database and the last backup I had was from 11/2008. The question is: is there any way to recover my lost year of Posts and, if so, re-enter them in a way that will allow me to also re-integrate my Comments for that lost year of posts.

    There was no hope for me to recover my posts via stuff like cached Google searches or the Wayback Machine because I have always used robots.txt to block spiders.

    However, I found out that Google Reader will archive all entries in an RSS feed…essentially forever. Regardless of whether or not the user has read the entries or not. At any point, the user can click on an “All Entries” view and go back to every single post that was ever scraped by Google Reader, dating back to when the subscription was established.

    Luckily for me, I subscribed to my own feed on a date preceding my last backup *and* I had set my RSS feed to display full entries. So I can recover all my lost text/HTML…which is all I need, since my host’s server never lost any of my other files.

    The question for me is now: how to do it in an automated way.
    – Obviously, I can load up all my lost entries in Google Reader and then save that page as a flat HTML file.
    – Then I can just copy-and-paste all the entries, one-by-one.
    – And, if I add them in the right order (so that each post retains its original Post ID #), I imagine I can copy my complete Comments table over onto my reconstructed database.

    I don’t know my ass from a MySQL query, so I’ll need to find a programmer to help me with this, but I’m sure a script could be written to break up the Google Reader flat file into separate posts and “inject” them into the database (or into an importable file) in a way so that they’re bearing the correct Post ID #s. Then just copy the complete Comments table over upon the resulting database.

    Hopefully I can find a freelancer who’ll do it for a reasonable price, as I imagine that someone with the right knowledge base could take care of this situation pretty quickly.

    Moderator Mark Ratledge


    Forum Moderator

    Lucky that you have the feed with all your content. Use sed and/or grep to clean it up and delineate it into posts, then get it back to the database, retaining the original post IDs. There are scripts out there to post directly to WP: Post on your WordPress blog using PHP. So there’s a way to write to the database with already assigned post IDs. I’d take a stab at it, but I’m that great just yet with php and mysql…

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Whole Tables Gone Missing From DB! Hacked?’ is closed to new replies.