View Full Version : Need quick help Restoring logical back-up

July 30th, 2009, 03:18 PM
I have a large back up that contains multiple databases. Some are raw, some are Logical. I need to restore one of the logical databases so I can actually get at the SQL dumps to do some emergency data surgery. My image is on a server separate from my production database. The backup is encrypted (and Compressed I believe)

Some facts:

1) I have never used Zmanda. One of our staff did, and he is no longer with us. I like it, and plan to buy enterprise, but right now I am stuck.

2) I have never restored one of the back-ups, again the other guy did.

3) I am in the middle of nowhere on vaca, thank God I found a restaurant with WiFI.

So My back up set looks something like


it contains:

Some more info, Maybe I am running that wrong.

/usr/bin/mysql-zrm-reporter --where backup-set=db-daily/20090730001502 --show restore-info
reporter:ERROR: Missing file /backup/db-daily/20090730001502/backup-data/index, can not parse this index file
reporter:ERROR: Missing file /backup/db-daily/20090730001502/index/index, can not parse this index file
reporter:ERROR: Missing file /backup/db-daily/20090730001502/zrm_checksum/index, can not parse this index file

I want to restore one data base, but not to a production server. In fact if I can just read the dump files that would be good enough, but if I need to restore I have a server I can use.

Pls help, and THANKS!!

July 30th, 2009, 03:46 PM
You're going to need to use the mysql-zrm-restore command to restore to an alternate server. From there if you'd like you can re-export the database you want to manipulate the data from to get a workable SQL file. To do the restore, you will need to issue a command like:

/usr/bin/mysql-zrm-restore --backup-set db-daily --user user --host host --password password --source-directory /backup/db-daily/20090730001502/

Type /usr/bin/mysql-zrm-restore by itself to get the full syntax. Please let me know how that goes. Because the data is encrypted, yo uwill need to use ZRM to restore it somewhere.

July 30th, 2009, 03:52 PM
Thank you for the awesomely quick reply. I really appreciate it.

Where you say user password and host, is that MySQL user? So it will restore as a database on that MySQL server? I only want to restore one Database, if thats possible. If so what do I add?

July 30th, 2009, 03:55 PM
The user and password and host are going to be the user and password in the MySQL enviroment you are trying to restore to, so you'll need to do a grant to a user so you can do the restore.

July 30th, 2009, 03:56 PM
ok I added username and password and host and that worked. Awesome. Now I just need to define the database I want. Do I need to enter the passphrase for the encryption anywhere?

Do I just add --databases nameofdb ? after the backup set?

July 30th, 2009, 04:02 PM
The passphrase for the encryption is located somewhere...I think in /etc/mysql-zrm/db-daily as a hidden file so do ls -la /etc/mysql-zrm/db-daily and you'll see it. You shouldn't need to specify it as long as it is in the proper place ZRM will use it.

You are correct...--databases nameofdb

So something like:

/usr/bin/mysql-zrm-restore --user user --password pass --host hostname --backup-set db-daily --source-directory /backup/db-daily/20090730001502/ --databases nameofdb

If it doesn't find the passphrase file then you can specify it using the --passfile <path> argument.

If you need to restore over ssh you can do that too. All of these options are revealed if you just type;


It will tell you all the arguments you can use.

July 30th, 2009, 04:06 PM

I tried and got:

/usr/bin/mysql-zrm-restore --user username --host --password somepassword --source-directory /backup/20090730001502 --databases databasename
restore:INFO: ZRM for MySQL Community Edition - version 2.1
BackupSet1:restore:ERROR: Cannot find source directory /backup/20090730001502

I am runing this from the server with the image, and the host I am specifying has MySQL running.

July 30th, 2009, 04:12 PM
Looks like it should be

--source-directory /backup/db-daily/20090730001502/


July 30th, 2009, 04:46 PM
it seemed to be running ok, but it was uncompressing and un encrypting and placing every database in my backup directory. My shell timed out and the restore quit. Why would that happen? if it needs to unencrypt and uncompress 170 gb its going to take a long time.

July 30th, 2009, 05:24 PM

Thank you very much for the express help. I think my restore is running we will see. Since I had never used this product before myself, I needed some hand holding. You guys are awesome. I will be purchasing Enterprise ZRM for both of my data centers (if your sales folks ever send me a quote).

Thank you again for the great help, and great support.

July 30th, 2009, 05:38 PM

Great to hear! What changed from restoring every database to just the one you wanted?

I will make sure sales contacts you!

Now get back to showing those refugee kids some fun!


July 30th, 2009, 06:05 PM
Its restoring only the database I needed. It just had to un-encrypt and decompress the huge .sql image and all he raw backups into he backup directory. So I see how it works.

Thanks again.

If you ever get interested in Refugee Resettlement http://community.wr.org/Page.aspx?pid=1823 is the link for he organization I have worked with through my Church.

Its very interesting and eye opening when you help a family who doesn't speak English, came to your country with only the close on their backs, and in some cases have never lived in a "modern" home. Its very humbling, we have so much.

Thanks again for your help. Its the kind of service you guys showed, that make small companies into great companies!

July 30th, 2009, 08:04 PM
Interesting. I appreciate the link and your perspective.

Glad, again, to hear about the successful restore. Thanks for the comments.