Restore Mysql Databases from hard copies.

7 posts / 0 new
Last post
#1 Thu, 12/18/2008 - 13:17
rebrain

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.

Thu, 12/18/2008 - 13:43
Joe
Joe's picture

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:

http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html

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.

--

Check out the forum guidelines!

Fri, 12/19/2008 - 03:01 (Reply to #2)
rebrain

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

Bummer...

Fri, 12/19/2008 - 03:04 (Reply to #3)
Joe
Joe's picture

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.

--

Check out the forum guidelines!

Fri, 12/19/2008 - 04:33 (Reply to #4)
rebrain

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

Happy holidays and thanks again! ;)

Wed, 05/09/2012 - 03:56
chencho

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

Wed, 05/09/2012 - 04:18
Locutus

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. :)

Topic locked