Adminstering Drupal
Backups
To properly back up a Drupal system (on a daily or weekly basis) you need to back up two elements:
- The database
- Any uploaded files
Drupal database backups
If you have the "Backup and Migrate" module installed (and it's highly recommended that you do) you can do this from within Drupal itself. If you don't, you will have to use whatever utilities are supplied with your database, eg for a MySQL data you could use PHPMyAdmin (or possibly MySQL Administrator if you have direct access to the database)
Using the Backup and Migrate module
Go to the main page for the module: Administer - Content - Backup and Migrate (admin/content/backup_migrate)
You will be presented with two lists of tables:
- Tables to be excluded altogether
- In general you would back up all the tables listed (i.e. all the tables in the database schema) - so you don't need to select anything from this list
- In some Drupal installations it's possible to have more than one instance of Drupal running - each instance will be distinguished by a prefix to the table name. In this case you can exclude the tables which do not relate to the instance you want to back up. Note - you can select more than one table by holding down the control key as you click n each table.
- Tables to exclude the data backup - ie backup the table structure only
- Several of Drupal's tables are used for data caching. These all begin with cache_ (or {prefix}cache_ if your site uses table prefixes). The cached tables can be quite large and it is not necessary to back them up. To reduce the size of your backup file it is a good idea to exclude them - i.e. back up the structure, but not the data.
Other options you might wish to change:
- Backup file name: the system present a default value based on the site name, which you can change
- Conpression: this defaults to none - but it's a good idea to select "gzip"
- Destination: you can choose whether to download or save the file to a directory on your server. If you choose to save it on the server, you can view the saved backups in the "Saved backups" tab - this also lets you download the backup file, delete it or restore it. Note: the restore prompt checks for confirmation but it makes it very easy, perhaps too easy, to restore to an older backup - use with care.
- Append a timestamp: if you check this, the file name for the backup will be given a timestamp - it's recommended that you select this
- Save these settings: you should select this - then click the "Backup database" button to create a backup
Backing up using other tools, such as database tools
See the previous section "Tables to be excluded altogether" and "Tables to exclude the data backup" for guidance on which tables to back up. Then perform a backup using your chosen method.
Drupal file backups
To back up any files that have been uploaded by users, you will need to use an FTP program (or if you have direct access to the files any backup utility will do).
Uploaded files are generally placed in a sub-directory of the main website, called /sites/{your website name}/files. In a normally configured Drupal system all uploaded files are in this dircetory (or its subdirectories). This should be all you need to back up on a regular basis.
NOTE: if you are backing up prior to upgrading to a new version of Drupal (or moving to another host location) you will need to back up all files on the website, not just the files directory.
