PDA

View Full Version : Understanding a restore



sabaker
January 8th, 2009, 02:15 PM
Background mysql 5.0.45-log, zrm v2.1 open community on a centos 5.2 system.

I'm trying to understand how how to do two things properly.

1) How do I simple test of backup and restore on the slave for a single db?
Is this a correct test sequence...
Before the backup, stop the slave,
run mk-table-checksum test on my database and save the output.
Do full backup on the slave (I used the instructions in http://www.zmanda.com/quick-mysql-backup.html for an innodb db and set the bit for replication), drop the database and do a restore with those same instructions.
again run run mk-table-checksum test on my database and save the output.
compare for checksum output to second with ck-checksum-filter
and they should be the same.

I'm not clear on what the --replication option is used for.
Do I need to include that in my restore action? Is that going to restore
the master.info/relay-log.info files? In this scenario it may be a no-op because the file actually doesn't change. But if I took a backup in the past
and want to turn back the clock starting at the backup, then I think it is
probably important. Am I correct?

2) How would I restore a backup (of a single db) to a new master system (previously crashed/corrupted)?
Let's simplify in that we only have a single full and good backup to deal with.
So I'm guessing I move the backup directory in question from the slave to my new master.
Do I need to indicate a --backup-set directory? So do I need to copy that over too from the slave?
Do I need to indicate --noreplication (or can I rely on default)?
Am I going about this the wrong way?

Thanks for any assistance.