Drupal multisite database backup

I'm currently in the middle of moving all my sites over to a new VPS, so I needed to quickly dump all the databases to migrate them. I had a script that handled drupal db dumps pretty well, but it didn't do multisite, so I threw this together:

  • Copy that into something like "multisite_db_backup.sh"
  • Change the "MYSQLDUMP_DIR" variable to wherever you want the sql dumps stored
  • Move it somewhere within your PATH (I use ~/bin/)
  • Make it executable (chmod +x multisite_db_backup.sh)
  • Run it in the root directory of your drupal install (cd drupal6; ./multisite_db_backup.sh"

Tested on debian and Mac OS 10.5.