Best way to backup and restore the databases of a Drupal 7 multisite using Drush? I'm looking for an easy way to backup (and if needed restore) the databases of a Drupal multisite using Drush.

Drush command I use to backup all the databases:

drush @sites sql-dump --result-file --gzip


The backup of the databases seems to work. After executing the above command, databases are automatically stored in /root/drush-backups/DATABASENAME/TIMESTAMP/DATABASENAME_TIMESTAMP.sql.gz

What command can I use to restore the last backup of the databases automatically?

What is the best way to backup and restore the databases of a Drupal 7 multisite using Drush?

PS: I'm using Git, so I only need to backup databases.

Many thanks for your advice!
This is how I do the restore on a site-by-site basis:

drush @site1 sql-drop -y &amp;&amp; gunzip -c /path/to/backup/file1 | drush @site1 sql-cli


You could maintain a list of site aliases to database name and write a shell script to automate the process.

The database name for an individual site could be extracted as follows:

drush status @site1 --fields=db-name --field-labels=0


Unfortunately, there's no all-in-one solution for restore.

An alternate solution would be to use the Backup and Migrate module, which has drush integration. There are bam-backup and bam-restore commands which might be easier to work with.

As @Duncanmoo mentioned, it's also good to run drush rebuild-registry after the restore.