Mysql – restoring theisam thesql db on a different machine

MySQL

I have copied the web db directory(/var/lib/mysql/data/web/), when mysql is not running. I transferred this directory to another machine, where mysql is running.

web db's stuff is myisam based.

I am thinking about how to restore this on a different server. The strategy I have on my mind is the following.

  1. copy the data directory of web db to the new server.
  2. on new server, 'create database web', which creates a directory in /var/lib/mysql/data
  3. copy all files from the step to the new directory created in 2.
  4. bounce mysql

My question: how to deal with information_schema for this new db?

Best Answer

Six years after this question was asked, I had to copy an 80 million row MYISAM table to a backup database (it was using 80% of the disk space of our whole database).

I took the .MYI, .MYD, and .FRM files from the nightly backup, and copied them to the folder of a new running database. The information_schema was updated almost immediately, and all table operations worked as expected (ie the indexes and stuff were correct).
I'll run CHECK TABLE and OPTIMISE TABLE on them before sending them into a quiet retirement, but this backup method was painless.