Restore Mysql Databases from hard copies.

Good day,

my root server has gone offline and i needed to make a reinstall of the system some days ago. But as I said the server was offline and I could not make a backup through Webmin.

I had an FTP Account Setup that I was able to reach. I made a copy of the "var\lib\mysql" folder hoping to be able to just copy the contents to the new machine and have the mysql databases as i had them before. Although this is not the case. I am trying to copy in all possible ways but I does not seem right.

My backup database contains one more table then the one that is made after a clean install of the php script. When I restore the backup through root ssh connection Virtualmin shows me an error that the table does not exist (the one that was not there before).

This leads to a question:
Where is the information about mysql saved?

Regards, Rebrain

P.S. I have an ‘almost’ default Virtualmin set installed on a clean Debian Etch Server.

Copying the raw data files from one MySQL version to another will never work–identical versions, maybe. But the recommended way to transfer databases is always a dump of the database using the mysqldump command. Webmin, of course, can do this for you, but since you don’t have access to Webmin, you’ll need to do it from the command line. Here’s the docs:

If you only have FTP access, you might be out of luck, unless you know exactly which version of MySQL you have on the old system, and can setup an identical installation somewhere so the raw data will work.

Right now I only have the backed up version. Could there be any converter out there that can convert from raw files to sql?


As I mentioned, if you can exactly replicate the version and build of MySQL that was on the other machine, it will be able to read the files–this can be pretty easy to accomplish if you know what OS and version the system was running, and what MySQL version (assuming MySQL was installed from OS-standard packages). Otherwise, you will need a dump. I am, by no means, an expert on MySQL. I just dump all of ours every night, so we always have backups that I know I can restore anywhere. But, that’s always been my understanding…that if you want to move MySQL data, you have to dump it and then restore it.

You might want to ask on a MySQL forum or mailing list if the data is valuable and there is no way to obtain a dump.

Thank you very much,
you guys are always really helpful on the forum and the answers come very fast!

Happy holidays and thanks again! :wink:

Yes, its an old post, but… had you recovered yor sites? I’m in the same situation

What Joe said way back then is still valid. You very probably need an identical version of MySQL to get binary data files to work. For further help, you’d need to specify what exactly the problem is.

Oh, and there is no “converter” that extracts dump files from binary data. Well, that converter would be the MySQL server itself actually. :slight_smile: