Drupal’s Backup and Migrate Module
There is nothing quite so important to a developer as backups.
Backup and Migrate makes the task of backing up your Drupal database and migrating data from one Drupal install to another easier. It provides a function to backup the entire database to file or download, and to restore from a previous backup. You can also schedule the backup operation. Compression of backup files is also supported. The database backup files created with this module can be imported into this or any other Drupal installation with the restore feature, or you can use a database tool such as phpMyAdmin.
Step 1. Download
You can download the module here: http://drupal.org/project/backup_migrate
There’s one other module you might want, but is not required: AES Encryption allows you to encrypt the backup file during download.
Step 2. Install
Go to Modules > Install new modules and click Browse to find the downloaded file on your server and install it. Follow the prompt to enable the module on the Modules page.
Step 3. Enable
On the Module page, click the ENABLED check box and scroll to the bottom of the page to find the save button and save your changes.
Step 4. Configure
Go to Configuration > System > Backup and Migrate to access the module.
Step 5. Add your private file system path
You will get a warning that you have not set up the private file system path if you haven’t already set it up for another module. Click on the blue line “file system settings” to specify the path
Specify the path that to the directory you are using for storing uploaded or private files from users. You probably created this directory if you installed or are using the File Field Module, or have added a file field to a content type. (Here’s more information in the drupal documentation http://drupal.org/documentation/modules/file)
Save your configuration.
Step 6. Return to the Backup and Restore page.
Go back to Configuration > Settings > Backup and Migrate. You will see these tabs on the backup and migrate page.
1. Quick Backup Tab
Use this form to run simple manual backups of your database. Visit the help page for more help using this module
2. Advanced Backup Tab
Use this form to run manual backups of your database with more advanced options. If you have any settings profiles saved you can load those settings. You can save any of the changes you make to these settings as a new settings profile.
3. Restore Tab
Upload a backup and migrate backup file. The restore function will not work with database dumps from other sources such as phpMyAdmin.
Destinations are the places you can save your backup files to or them load from.
Files can be saved to a directory on your web server, downloaded to your desktop or emailed to a specified email account. From the Destinations tab you can create, delete and edit destinations or list the files which have already been backed up to the available destinations.
Profiles are saved backup settings. Profiles store your table exclusion settings as well as your backup file name, compression and timestamp settings. You can use profiles in schedules and for manual backups.
You can create new profiles using the add profiles tab or by checking the “Save these settings” button on the advanced backup page.
Automatically backup up your database on a regular schedule using cron.
Each schedule will run a maximum of once per cron run, so they will not run more frequently than your cron is configured to run. If you specify a number of backups to keep for a schedule, old backups will be deleted as new ones created. If specify a number of files to keep other backup files in that schedule’s destination will get deleted.
Step 7. Make Quick Backup
Click Backup now.
You’ll get the download dialog. Save it to your computer and you have completed a data base backup.
To make a full backup you’ll need to click the Advanced Backup tab.
Step 8. Identify the file.
If you have done a previous backup, or you have created a profile from the profile tab at the top of the page, you can load the settings. Otherwise you can specify the details of the backup file here. A timestamp will be very helpful in keeping track of versions.
The AES Encryption Module is not necessary, but if you want to use file encryption when you download, you can get the module here. http://drupal.org/project/aes
Step 9. Choose any database tables to exclude
Only omit data that you know you will not need such as cache data, or tables from other applications.
IMPORTANT: Excluding tables can break your Drupal install, so do not change these settings unless you know what you’re doing.
Step 10. Set up notifications and take the site offline
You’ll probably want to take the site offline to prevent anyone from making changes while the backup is being made. Send yourself some emails so you know what’s happened. A large site can take a long time to backup.
Step 11. Set your download destination
You can specify the Manual Backups Directory and other paths from the Locations tab at the top of the page. If you choose download, you will see the download dialog box in your browser when the file is ready, as you did with the quick backup.
When you go to Destinations and click “Add Destination” you will get to choose from several locations. You will need to define the paths.
How to restore from backup if needed
Click the RESTORE tab, browse to find the file you saved, and click Restore now – that’s all you need to do to restore your data base.
It’s really a nice post. Keep up the good work.
Your tutorials are much appreciated!
Hi, am having problems with the restore of a database it is arround 20Mb, and after restoring the drupal site crush, i alrready edit my.ini and php.ini to support even larger file sizes, any help?
thanks so much for this !
You’re very welcome!