Last updated November 18, 2014. Created on April 25, 2012.
Edited by kreynen, richardhayward, emilyf, synchlayer. Log in to edit this page.

The Backup and Migrate module simplifies the task of backing up and restoring Drupal databases or copying databases from one Drupal site to another. It supports gzip, bzip and zip compression as well as automatic scheduled backups.

This module dumps some or all database tables to a file downloaded or saved to a file on the server. It also restores from an uploaded or previously saved database dump. Choose which tables and data to backup. Cache data is excluded by default.

This documentation explains how to configure and install Backup and Migrate as part of a Community Media installation.

Enabling Backup and Migrate

  1. Navigate to Administer > Modules
  2. Select Backup and Migrate in the Other block
  3. Scroll to the bottom of the page and click Save Configuration

Configuring Backup and Migrate

Navigate to Administer > Configuration > System > Backup and Migrate
Download a backup of the default (Drupal) database by clicking Backup now. For occasional manual backups no further information is required.

Always download a backup prior to updating or installing modules.

Backup to Server

Create a Private directory to store backups on the server but prevent them being accessible via web browsers.

  1. Navigate to Administer > Configuration > Media > File System
  2. In the Private file system path field enter sites/default/files/private
  3. Click Save configuration
  4. To test that this new directory is private, and therefore all your backups are private, navigate to EXAMPLE.COM/sites/default/files/private/
  5. Your browser should return a Forbidden response (see below) even if you are logged in as an administrator, which indicates your files are private.

Forbidden

Navigate to Administer > Configuration > System > Backup and Migrate and then choose the Destinations tab. Two new directories for Manual and Scheduled backups will have been created, as shown in this screenshot:
Backup Destinations

Receive email confirmation of successful and/ or unsuccessful backups

  1. Navigate to Administer > Configuration > System > Backup and Migrate > Profiles
  2. Click Override in the Operations column of the Default Settings row.
  3. Click Advanced Options
  4. Change the default email address if you wish, then select both Send an email if backup succeeds and Send an email if backup fails
  5. You can also select Take site offline if you wish to make sure no one is using it while a backup is in progress
  6. Click Save profile

Schedule Weekly Backups

Weekly backups run when the next cron job runs.

  1. Navigate to Administer > Configuration > System > Backup and Migrate > Schedules
  2. Select Enabled
  3. In Schedule Name field enter "Weekly Backup"
  4. In Backup every field select "1 Weeks"
  5. Everything else can be left on default settings including the Destination field - "Scheduled Backups Directory"
  6. Click Save Schedule

Restoring from Backups

Check with an experienced admin before attempting to restore from backups.

AttachmentSize
backup_destinations.png37.92 KB
forbidden.png15.76 KB

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

crutch’s picture

5. You can also select Take site offline if you wish to make sure no one is using it while a backup is in progress

What can potentially happen if this is not selected?

In our case, we have varnish cache as well as 30 minute Drupal cache. What happens when this box is checked is that it goes into maintenance mode and maintenance mode screen is cached so it appears the site is down longer than just a few seconds.

On high-availability sites, this is an issue because maintainers complain that the site is down.

Is it okay to not have this box checked or what would the result be if the an editor is working during the backup process?