Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

my OS died today, so I have to copy the data onto working machine. I've set up the new environment including MySQL, then copied contents of /var/lib/mysql from an old machine to the new one. Unfortunately, while looking at the results I have noticed that some (yes, only some) databases are completely empty - while the others survived untouched. The only thing connecting those databases with "lost" tables and records, is the fact they were all created recently, comparing to the survived ones. [by recently I mean half a year or so]

My question is quite obvious now - how should I restore the data correctly?

Thanks in advance

share|improve this question
How did perform your backups? Without knowing how you performed your backups telling you how to restore, or even if you can restore is pretty difficult. If you just copying the files without from /var/lib/mysql you may have lost your data. – Zoredache Aug 10 '10 at 17:50
up vote 0 down vote accepted
  1. What is your Data Storage Engine (MyISAM, InnoDB)?
  2. How did you perform the backup/restore (scp, cp, tar, rsync ?)
  3. Was fsck run on your old system ? did it notice any issues ?
  4. did you try using mysqldump from the old box ?
  5. Was your OS and data on same partition ?
  6. if you are able to mount the MySQL data partition from the old machine, and have a new instance of MySQL use it, then you could run a mysqlcheck and then do the necessary ?
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.