Support » Fixing WordPress » Importing or restoring certain tables of a database

  • I had a problem with my host (Warning: don’t use Yahoo!) described in Basically I was getting a database “error 127 from storage” engine. Beside the phpmyadmin and the mysql database I have 2 databases on there. One for my phpbb message board and one for wordpress. The database tables, etc on the forum database are fine however once I was finally able to communicate with my databases using phpmyadmin I tried to run the repair option on the some of the wordpress tables and it basically wiped them out. I ran repair on the ‘wp_posts’ and ‘wp_links’ tables for wordpress and instead of repairing it basically took my 2186 post down to 1! Not sure what that was about but I had enough sense to have my database backed up. I have like 3-4 copies of the database stored on my host in the backup directory and I’ve downloaded them to my pc too.
    Files names in the format mysqldata.2007-03-01-03-26.tar.
    Also the database sizes are around 70,000kb which makes them rather large and also larger than the 51,200KB max the SQL Query tab on phpmyadmin appears allow to be uploaded.

    Here is the problem I have. I want to restore the post I lost from my wordpress database but I don’t want to use my host restore utility because I don’t want to lose all the post in my message board in the last couple of days (the message board started working several days before the blog) and I suspect there “utility” may have been related to my “error 127” which I started getting seemingly after I attempted a restore. I am using phpMyAdmin 2.6.3-pl1 version. I tried following the instructions posted at but it didn’t quite work. First off when I “un-tarred” my database I didn’t get any .sql file. It broke the database backup into folders bases on the database and then for each table in the database there are 3 files. So say for my ‘wp_post’ table there are files wp_posts.MYI, wp_posts.MYD, wp_posts.frm. The .MYD file seems to be the one with the actual data in it (though it’s in a text format & seems to have some funny/bad characters in it when viewed in wordpad).

    Due to the size of the database and the way it’s zipped up it seems I am going to have to do upload my database by some method. There doesn’t appear to be an import option on the phpmyadmin page. Also I noticed the “Export” option under phpmyadmin does express what’s in the tables in a very easy to read way. If I got an old copy of my database and then exported the ‘wp_post’ table then saved it to a wordpad file or something like that is there a way for me to re-add those post? Or re-upload? I really need those post. Is there anyone out there that can help me with this restoration of my post?

Viewing 1 replies (of 1 total)
  • Actually I answered my own question. It took several hours but I was able to fix the database by restoring an old copy. Then exporting only the tables I believed were broken or corrupt. I exported them in the .sql format so the file basically was a list of sql statements (mostly inserts). I saved these documents as Rich Text Format. I then restore a more recent version of the database where those tables that were broken in the old database were empty. I then re-inserted my past post from the rich text format containing my exported database. It was a tedious process but I learned a lot. I’m still no expert but hopefully this can help anyone who runs into a similar issue.

Viewing 1 replies (of 1 total)
  • The topic ‘Importing or restoring certain tables of a database’ is closed to new replies.