Closed (fixed)
Project:
Backup and Migrate
Version:
6.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Jan 2010 at 10:18 UTC
Updated:
9 Jun 2015 at 03:02 UTC
Jump to comment: Most recent
Comments
Comment #1
supersteph commentedsubscribe
Comment #2
ericdfields commentedIt works like this
drush bam-restore db manual "nodes.mysql"The bam-restore args are source, destination, file, and file must be in quotes.
To get a list of destinations, run drush bam-destinations.
Filename must be in quotes. That took a lot of trial and error to figure out…
Comment #3
ericdfields commented… and I only got destinations working when I applied this patch: http://drupal.org/node/715472
(how does one 'subscribe' to updates on a thread here??)
Comment #4
supersteph commentedthanks for the link to that patch! i've been wondering about that, but hadn't taken the time to search
re: drush - i would *highly* recommend upgrading to drush v3. there were evidently a ton of bugs in v2.x that have been resolved. and thank goodness for that! can you imagine going back to life without drush??
if you do upgrade, however, take note of the remarks about spaces in the readme. you will have to uncomment a line in one of the php files to allow spaces until the bam module's drush script is updated.
re: subscribing - unfortunately (afaik) there is no way to enable email notifications on this forum. i know it seems crazy...but it's true. hopefully they'll find a solution when d.o is upgraded...
Comment #5
ronan commentedThe latest dev is Drush 3 compatible thanks to mikey_p #720580: Drush 3.0 doesn't allow spaces in commands so I think I can close out this ticket.
Comment #7
raven_web commentedThank you for that clarification ericdfields, #2 got it working for me.
Comment #8
charlie-s commentedIf I wanted to run something like this via cron, to restore my database form the latest backup every day at midnight (or w/e the case may be), how could I get the filename of the latest backup?
Comment #9
loopduplicate commentedto get the name of the latest file added to a single directory:
ls -t1 | head -n1so, to use drush to restore the latest backup from the manual backup folder, to the default database:
to get the name of the latest file added to a directory tree:
find . -not -type d -printf "%p\n" | sort -n | tail -1so, to use drush to restore the latest backup from any directory in the backup_migrate folder:
Cheers!
Comment #10
bserem commentedexcellent idea but I can't make it work!
any ideas?
Comment #11
z3cka commentedI got tripped up over this as well because when you run, for example:
drush bam-backups scheduledYou will get something like:
Notice that the file extension is not included in the above output. Adding .mysql did not help me because the default backup profile has "GZip" selected as the compression. This causes the backup file to have .mysql.gz as the file extension.
The command that worked for me was:
drush bam-restore db scheduled "drupstage-2012-06-19T16-16-33.mysql.gz"I Hope that helps some one that was struggling to get this to work, like I was.
Comment #12
rwilson0429 commentedYelp, that helped someone, me. Thank you very much z3cka. It's an old post but the solution provided in #11 still works today (6/8/2015).
My site was down and running update or clearing the cache would get it back up. I spent a couple of hours trying to figure out how to use drush to restore from a scheduled backup. Nothing I tried worked until I stumbled upon the post above by z3cka (#11). Following the solution in #11, I was finally able to get the restore completed by running the following drush command from the scheduled backup folder:
The restore completed and my site was up again.