[[prevent-backups]]

=== Concept: Data Backups

[role="summary"]
Overview of data backups and what should be backed up on a site.

(((Backup,overview)))
(((Content,backing up)))
(((File,backing up)))
(((Database,backing up)))

==== Was man wissen sollte

* <<understanding-drupal>>
* <<install-prepare>>

==== What is a site backup?

If something happens to the computer (or computers) that your site and its
database are running on, or if you lose access to this computer, you could lose
some or all of your site's data. You could also lose data if your site is
hacked, or if someone with administrative privileges on your site deletes or
alters data mistakenly from the administrative interface. In order to prevent
scenarios like this from being permanent, expensive data losses, it is important
to make regular backups of your site's data, and to store them in a location
that is separate from the computer where your site is running.

The frequency with which you should make data backups, and how many backups you
should keep, depends on how frequently your site is changing. If you have a very
large amount of content on your site that is being added to or updated many
times per day, you would want to make more frequent backups than you would for a
site that changes rarely. Also consider that some time could pass between when a
data problem occurs and when you notice that it is a problem, so storing a
sequence of backups (so that you can go back to the last known good data and
retrieve that), rather than overwriting a single backup repeatedly, is a
good practice.

Another consideration is that whatever format you store your backups in, it is a
good idea to verify that you can actually retrieve lost data from your
backups. You might want to test several possible data loss scenarios, and make
sure that your data can be restored to the site in all cases.

In order to make a complete backup of your site, you will need to make copies of
the following:

* The data in the _sites_ directory, including the _sites/default/settings.php_
file.

* The data in your site's database. A few tables can be truncated, such as those
storing the temporary data cache and user login session information, but it is
always safe to back up the entire database.

* Uploaded files, such as images and other attachments. The location of these
files is configurable; the standard location is the _sites/default/files_
directory under your site root. In the _Manage_ administrative menu, navigate
to _Configuration_ > _Media_ > _File system_ (_admin/config/media/file-system_)
to check the file upload locations; to change them, you'll need to edit your
_settings.php_ file.

* Modules, themes and any other software files you have customized. You can find
customized modules and themes in the _modules_ and _themes_ directories
respectively. Some people prefer to back up all software files, including core
files and contributed modules and themes (which you could recover by downloading
them again from the source), rather than trying to pick out specific files that
definitely need to be backed up.

You can perform a test to confirm whether your backup has been done right by
making a development copy of the site (see <<install-dev-making>>).

==== Ähnliche Themen

* <<security-update-core>>
* <<install-dev-making>>
* <<prevent-cache>>

==== Additional resources

* https://www.drupal.org/docs/7/backing-up-and-migrating-a-site/backing-up-a-site[_Drupal.org_ community documentation page "Backing up a site"]

* The https://www.drupal.org/project/backup_migrate[contributed Backup and Migrate module],
which can be used to set up automatic backups of the database and uploaded
files.


*Attributions*

Written by https://www.drupal.org/u/jhodgdon[Jennifer Hodgdon].
