4

Just that. I've a backup using the backup and migrate module. I've done some changes and now the site is down. I can't restore the site using the admin interface (because it's broken).

Can I use Drush to restore it?

  • Just as a side note, BAM backups can usually also be restored with normal MySQL administration tools. – mpdonadio Aug 22 '12 at 10:36
7

Yes, you can restore your backup with Drush.

Here are Backup and Migrate commands for Drush explained: http://www.only10types.com/2011/03/drush-backup-and-migrate-command.html

I think drush bam-restore command is what you are looking for.

bam-restore Restore the site's database with Backup and Migrate.

Examples: drush bam-restore db manual "LCC-31.03.2011-14.01.59.mysql.gz" - restore the default database using the given dump file, which can be found in the destination called "manual"

Arguments: source - Required. The id of the source (usually a database) to restore the backup to. Use 'drush bam-sources' to get a list of sources. Defaults to 'db' destination - Required. The id of destination to send the backup file to. Use 'drush bam-destinations' to get a list of destinations. Defaults to 'manual' backup id - Required. The id of a backup file restore. Use 'drush bam-backups' to get a list of available backup files.

  • What if the dump file is on the filesystem and not in the bam list – frazras Dec 18 '12 at 1:52
  • 1
    It appears that drush bam-restore only handles db backups. I think you will need to extract the files tar.gz file manually (without using drush). – Jay Haase Jul 21 '14 at 1:48
0

I can't comment, but for completeness' sake I'd rather add the official bam-backup command help too.

$ drush help bam-backup

Backup the site's database using default settings.

Examples:
 drush bam-backup                          Backup the default database to the manual backup directory using the default settings.                                                            
 drush bam-backup db scheduled mysettings  Backup the database to the scheduled directory using a settings profile called "mysettings"                                                       
 drush bam-backup files                    Backup the files directory to the manual directory using the default settings. The Backup and Migrate Files module is required for files backups.

Arguments:
 source                                    Optional. The id of the source (usually a database) to backup. Use 'drush bam-sources' to get a list of sources. Defaults to 'db'            
 destination                               Optional. The id of destination to send the backup file to. Use 'drush bam-destinations' to get a list of destinations. Defaults to 'manual' 
 profile                                   Optional. The id of a settings profile to use. Use 'drush bam-profiles' to get a list of available profiles. Defaults to 'default'

Aliases: bb

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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