Backup: create an archive of your Drupal database and files

Last modified: March 29, 2009 - 07:52

The backup module performs a backup of your entire Drupal website. An archive file, or tarball, of your Drupal database and all your files is created on the webserver. You can then download this file with your web browser.

You can:

  • create a backup tarball at administer >> content >> backup.
  • file issues, read about known bugs, and download the latest version on the Backup project page.

Restoring from a backup

The backup module doesn't have the capability to restore from a backup, as this would involve Drupal having its own files and database pulled from under it as it runs.

To restore a backup archive from a unix / linux command line:

  1. Untar the tarball into your document_root directory. This will recreate the file structure.
  2. Unzip the database file. You'll need to use the gzip program for that.
  3. Re-create the database by typing "mysql < database-dump-filename". Depending on your configuration, you may need to supply credentials via parameters to MySQL as necessary.

$PATH

gaele - July 17, 2007 - 07:27

The backup module uses the (Unix / Linux) commands tar, gzip and mysqldump. Make sure they are included in the webserver's $PATH before installing this module.

Configuring open_basedir

DawnLight - September 9, 2007 - 16:13

I've gotten warnings about "open_basedir restriction". It turned out to be because my server was running suPHP and did not specify the location of the required binaries in the server wide open_basedir option. To solve this I had to add the following to my .htaccess file.

suPHP_ConfigPath /home/username/public_html
<Files php.ini>
order allow,deny
deny from all
</Files>

And also create a php.ini file in Drupal's root containing the following.
open_basedir=".:/proc/uptime:/tmp:/home:/usr/local/lib/php:/nfs/home:/usr/home:/usr/local/bin/:/usr/bin/:/bin/"

trouble in shared hosting

andrabr - November 11, 2007 - 04:09

Some cheap shared hosting services, like doDaddy economy plan, restrict "exec cmd", and access to mysqldump.

The module will still backup your biles, but not the database.

Solution: spend an extra $5/month on decent hosting, your boss can survive with one less latte :-)

A>

 
 

Drupal is a registered trademark of Dries Buytaert.