1

My root access linux server has crashed and I cannot SSH into it or interact with it. I can, however tell the online console to do a network boot to a "rescue system" which allows me to access the files on the server.

This means I can only get the raw folder of my database and I can't perform an SQL dump.

It doesn't work if I just copy the folder of my database, because on my new working server it says some tables are not available. Apparently it is because of InnoDB and that I should copy the ibdata1, ib_logfile0 and ib_logifle1 files as well.

Can I just overwrite the ib* files on my news server with the ib* files of the old server? Is there any way I can transfer this database just by copying files?

1 Answer 1

1

If you copy the ib* files and all the subdirectories in /var/lib/mysql (or whatever you MySQL data directory was) along with the my.cnf from /etc to the new server, it should start up as if nothing had happened. There is no way to transfer InnoDB tables or databases other than that. Even with the innodb_file_per_table option, InnoDB still stores metadata in the central database file, so you cannot recover without it.

4
  • My DB's name is "istyla". I've copied the istyla folder to the new server and it shows the db exists. If I copy the ibdata1, ib_logfile0 and ib_logfile1 to the news server, will it work. Should I overwrite the ib* files on the new server? (I don't have any other DB's on the new server.) Mar 13, 2013 at 13:05
  • Yes, you must replace the ib* files. The content in the folder is just descriptive, and does not constitute the database contents. Mar 13, 2013 at 13:57
  • The one table, "user" does not have an MYD or MYI file. Looks like my server has been hacked? :( Lost about 5000 user's data. I still have the other 41000, though. Thanks for the help! :) Mar 13, 2013 at 14:31
  • Make sure that your ib_logfile? files have the same size. If you had set their size to a different value in my.cnf, it won't replay the transaction log. Mar 13, 2013 at 14:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .