18.11.2015 Views

Beginning Drupal 8

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 14 ■ Administering Your <strong>Drupal</strong> Site<br />

Figure 14-5. The Manual Backups Directory and the file to restore<br />

In this example, we could restore our system to the state it was in at the time we did the manual backup<br />

by simply clicking the “restore” link for that backup file. If you have scheduled backups enabled and have not<br />

manually backed up your system, the process described would be identical, with the exception of selecting<br />

the “list files” link for the Scheduled Backups Directory. Clicking that link would reveal a list of backup files<br />

that were automatically created based on the schedule that you set in the previous steps.<br />

Restoring with Drush<br />

Using drush from the command line provides a simple solution for those who are comfortable with the<br />

command line. To restore the database only from a backup created using drush sql-dump simply execute<br />

the following drush command from a command prompt while positioned within the directory structure of<br />

your site (replacing example.sql with the name of the file you created using the sql-dump command):<br />

drush sql-connect < example.sql<br />

To restore an entire site from an archive-dump, use drush archive-restore , where<br />

is the name of the archive that contains the code, database, and files.<br />

Backing Up the File System<br />

The Backup and Migrate module only backs up the contents of your <strong>Drupal</strong> database. The <strong>Drupal</strong><br />

installation itself, meaning <strong>Drupal</strong> core, all of the contributed modules you have installed, all of the themes<br />

you have installed, any customizations you have made to modules, and any files that users have uploaded,<br />

will not be saved by the Backup and Migrate module.<br />

There are several options for backing up the file system:<br />

• Simply copy the entire <strong>Drupal</strong> directory to another destination (for example,<br />

download the site to your local PC if you are running on a hosted server).<br />

• Copy the <strong>Drupal</strong> directory to a USB/CD/DVD if you are running on your local<br />

desktop/laptop.<br />

• In the case of a hosted environment, work with your provider to ensure that your<br />

<strong>Drupal</strong> directory is being backed up often enough to ensure minimal disruption in<br />

the case of a disaster.<br />

• Use the command line and create an archive (e.g., tar) of the site.<br />

Whichever scenario you choose, you should back up the file system on a frequent basis if users are<br />

uploading and attaching files to content (even daily, just as you do with your Backup and Migrate schedule),<br />

and in a case where you do not allow file attachments and uploads, it is still a good idea to back up your file<br />

system on at least a weekly basis (due to module updates).<br />

161

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!