Trouble restoring SQL backup
-
I manage a website with a WP blog located in a subdirectory. The hosting company is Dot5. We recently discovered that the blog had been infected with the WP trojan that ClamXav calls PHP.Shell-38. (Here is the best info I could find on it: http://security.stackexchange.com/questions/37111/wordpress-hacked-found-a-suspicious-class-wp-style-table-php.)
Our hosting service detected 180 some infected files. I read up on the WP folder hierarchy, backed up, then deleted all the infected files. Well, they scanned again and found more. Based on my understanding of the maliciousness of this trojan, I decided the thing to do was delete everything in the directory, restore the website from a clean local copy, do a fresh WP install, and then selectively upload files containing our settings and content to restore the blog.
Needless to say, this did not work. I had no idea what SQL beyond the fact that it was some kind of database language. My assumption was that it must be in the files that I had backed up. When I learned it was not, I assumed all was lost. Checking in with the Dot5 people, however, I now understand that they store SQL databases in a different location, and that all of our content is preserved intact. (Whether is has been corrupted by the trojan is, of course, a separate issue…)
I found instructions for how to use use phpMyAdmin to export and import SQL databases. The export seemed to work. I have one document named wrd_e7aohid1d5.sql (25.2 MB) and another named custsql-d505.eigbox.net.sql (26.5 MB) from two separate attempts. Initiating the import from different places, I think. (I am entirely ignorant of SQL and do not understand all the options.)
Yet, when I attempt to import either of these files into the SQL database for the current, clean WP install, phpMyAdmin errors when I attempt to import it. I am able to successfully select the file I wish to import, but then it displays this error: “You didn’t enter any data to import!”
Although the text of the error message did not suggest this, it occurred to me that the problem might be the size of my files, which both exceed the stated 10,240 KB max, could very well be the problem. Zipping the larger one down to 6.1 MB, I instead get the error message, “Error in ZIP archive: Compressed size is not equal with the value in header information.” Same with the other. (I just used the Mac OS compression utility, if that is relevant: right click, Compress “filename.”)
Does this mean my original database is corrupt? Or did I do something wrong exporting it? Or…?
These are the instructions I have been trying to follow: http://codex.ww.wp.xz.cn/Restoring_Your_Database_From_Backup.
Any suggestions tremendously appreciated. This is the blog of an academic journal, and we have a lot of high-quality content we do not want to lose. I can see that it is there in the original database, but am at a loss for how to extract it in a form that I can then get back online for our readers.
Just one other idea, is there any way to simply redirect the current, blank WP install to the old database? They are on the same server. If I can fix this just editing a line or two in a handful of .php files, that would be fantastic and probably much easier than all this mucking about in phpMyAdmin.
Many thanks,
Patrick
The topic ‘Trouble restoring SQL backup’ is closed to new replies.