3

Okay, I have to admit, that I derped up. I've exported a database from a to-be-reinstalled server and didn't check that file.

Now, that I try to import it, I've discovered something very strange, the file was supposed to be GZIP compressed, yet it cannot be compressed, so I open it up in Notepad++ and I see that it's not compressed. BUT when I try to import it as plain SQL i discover something more strange, somewhere in the middle of the file starts a byte stream.

Looks like phpmyadmin derped up the export somehow. Here you can see that file.

Has anyone exprienced something like this? Is there any way to recover such file?

It's not a very imporatant database, It could be recreated within couple of hours, plus I can restore it from off-site backup. BUT probably there will be someone who doesn't make regular data backups (you really should!), since I haven't seen anything like this on the Internet, I'm sharing it here, maybe somebody knows what could have caused it, how to fix it and how to recover such files.

Enbyted
  • 33

1 Answers1

2

I had the same issue last night and was able to solve it. You'll need the gzrt package to repair the gzip. Here's how to fix it:

  1. Copy the beginning plaintext portion of your database.sql.gz file to a new file called database.sql
  2. Run gzrecover database.sql.gz
  3. Append the contents of database.sql.recovered into database.sql

You might have to manually replace a couple of characters.

See this issue for more info on why it happened.

ktross
  • 136