Backup and Migrate provides a quick easy Web based way to backup your Drupal Web site for recovery, migration, or to produce a test version.
Download from drupal.org/project/backup_migrate. This page is based on version 6.x-2.2, a 64.43 KB download from December 14, 2009.
There is a competing module named Snapshot. The Snapshot page has an out of date comparison of Snapshot versus Backup and Migrate plus has the following disadvantages.
- Snapshot uses Drush to actually preform the work, a distinct disadvantage for those people who do not want to regress to the 1950s style of computing.
- Snapshot copies the database files instead of exporting the data as SQL. You can only use the copied files on nearly identical systems. You cannot perform a release upgrade and a whole lot of other things you often need to do when restoring to a new system.
Migration is a backup followed by a restore to a system different from the original. The difference might be a new Web server or you might be creating a test version of your site. When your current server bursts into flames and destroys your data centre, your planned backup and recovery usually becomes a migration because the replacement system has different releases software from the operating system up.
Database migrations work best when you export to SQL then import the SQL into the new database. For MySQL, you can copy the database files most of the time but some times they do not work. For a lot of people, Web hosting plans do not provide access to the database files. Exporting the SQL from the database is far easier. You can edit the exported SQL for conversion to a totally different database.
A backup and eventual recovery is a migration without a data conversion. On your current system, you export the database to SQL. On the new system, you recover the database by importing the SQL. PHPMyAdmin has a database import. PHPMyAdmin is provided as a standard feature of cPanel and other Web hosting management applications.
The module has a companion module, Backup and Migrate Files, to backup files. The file backup module unfortunately requires a PEAR library to perform part of the work. CPanel has an option to install PEAR libraries.
ISP backup or your own?
Some ISPs provide backup services. Their services are usually aimed at restoring your Web site after a hardware crash and their backup is usually daily. They rarely make their backup available to you and rarely in a form suitable for migration. They might not provide documentation on their backup or restore. Thoroughly investigate their backup and restore before depending on it. You will still need something to export the database for test sites.
The module exports with no compression, Gzip, or Bzip compression. Gzip reduced a 123 megabyte backup to 15 MB. Bzip produced just 10 MB. There is no 7zip option. Use bzip.
Create a directory for your backups,
/home/example/backup, and make the directory writeable with Linux/Unix permission 777. You can perform this operation in cPanel or Filezilla.
Install the module in the usual way. Go to Administer > Content management > Backup and Migrate. Change both manual and scheduled backups to use the
/home/example/backup directory. Create a schedule for a daily backup.
Number of Backup files to keep: 10 or more (You will, occasionally, want to restore from last week to recover something you accidentally deleted.)
There are other ways of performing backup and migration. This module happens to be a quick easy flexible Web based way to create the backups you need.