Best practices
Maintaining Drupal has several best practices that can help promote efficacy and ease maintenance.
Backups
Before performing any maintenance, ensure environments are effectively backed up. While the aforementioned Drush commands are capable of exporting databases or downloading files, backups are often offered by platform hosting providers. Some providers have policies to perform automated backups periodically. Doing so can help ensure quick and effective restoration should there be an issue.
Restoring Drupal can be performed with a series of commands. Releases of a specific Drupal application often correspond to tags in Git. As an example, suppose there was an issue with the deployment of the application’s 1.1.20 release. The following example restores Git tag 1.1.19 and loads the database from a backup.sql
file:
$ cd my_directory $ git fetch –all $ git reset –hard 1.1.19 $ cd web $ ../vendor/bin/drush sql:cli < backup.sql $ ../vendor...