Backend and Infrastructure
Topic

Back up Your Drupal Site for Drupal 8, 9, 10, and 11

A reliable backup will allow you to restore your site if something goes wrong, whether it is a server failure, site code or database problems, or user error. Everyone should have a regular back up schedule for their site, and know how to restore the site from those backups. A new backup should also be created before every update of core or a contributed project made to a site. For a Drupal site, you need to make sure to have backups for both your site code, including your site-specific settings and files, and the user-generated content that lives in the database and filesystem.

Example tasks

  • Back up a database and user-generated files
  • Back up Drupal site code
  • Restore a Drupal site from backups

Confidence

Backups are not an integral part of Drupal itself; the procedures and tools are widely used across all web applications. This means the information is widely available and reliable.

Drupalize.Me resources

Quick reference

Using Drush:

drush sql:dump --gzip --result-file=backup.sql

Or using mysqldump, replace {DATABASE_NAME} with the name or your MySQL database:

mysqldump -q --opt --add-drop-table {DATABASE_NAME} | gzip > backup.sql.gz

Both examples will result in a file named backup.sql.gz that contains a compressed backup of your database.

Drupal 8, 9, 10, and 11
More information

Overview of data backups and what should be backed up on a site.

Drupal 8, 9, 10, and 11
More information

How to make a copy of a live site for development purposes.

Guides

Not sure where to start? Our guides provide useful learning tracks for all skill levels.

Navigate guides

External resources