Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Wordpress installation that has a corrupt table, wp_posts. Unfortunately, I also had two hard drives fail recently and I do not have a backup of this database.

I want to make a local backup before I attempt to repair the table, but when I go to export the database as sql, I'm not able to get a complete backup. When I backup through wordpress, if gives me an error but gives me an sql file anyway, missing the data for this table. When I try to access the database directly and dump it, I get a 1kb file with no data in it.

I have seen online that a number of people have successfully repaired their Wordpress tables. There is even a script now that attempts to do this automatically. However, it would make me feel a lot better to get a local, broken copy of the db to operate on. Does anyone have any advice on how to do this?

Thank you. P.S. I use a GUI called Heidi SQL to access the db remotely.

share|improve this question
add comment

migrated from stackoverflow.com Dec 9 '11 at 15:53

This question came from our site for professional and enthusiast programmers.

1 Answer

Although this question should really be asked on serverfault, here's a hint:

When you have access to the server, simply copy the data directory (can be found by using show variables like 'datadir';) and copy it anywhere you like. Then you can issue the repair commands (or whatever wordpress happens to bring along).

Exporting a broken table to an sql file is, per definition, something that I would never expect to work.

share|improve this answer
    
If it's MyISAM, then you can just copy the wp_posts* files. There should be 3 of them. But if it's Innodb, you should copy the whole directory. –  Brent Baisley Dec 9 '11 at 1:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.