This is a more detailed version of the Update Instructions directly above this section and assumes drush is installed.
- Always take a backup of your files and database before updating.
drush sql:dump
will dump the database.drush archive-dump
has unfortunately been removed from Drush 9, so you'll have to use a standard CLI tool to back up the needed directories - typically excluding the vendor directory.
- Read the core release notes. Some contributed modules or themes may need updating to work with a new minor version (e.g. 8.3 to 8.4) of Drupal core. Patch releases (e.g. 8.4.4 to 8.4.5) shouldn't require this. To detect the needed module or theme updates, you need to read the project page or release notes.
- Activate maintenance mode using
drush state:set system.maintenance_mode 1
and thendrush cache:rebuild
. - If you determined that some modules or themes need updating, follow the module update instructions.
- Determine if your Drupal install requires additional steps not included in this set of instructions:
- If you started your Drupal site using drupal-composer/drupal-project, please read the special considerations section for extra steps you may need to take the first time you update to version 8.8.0 or later
- If you did not install Drupal 8 via composer and it is not yet converted to a composer managed project, you'll need to do so by following the Add Composer to existing sites guide.
- If you started your Drupal site using drupal-composer/drupal-project, please read the special considerations section for extra steps you may need to take the first time you update to version 8.8.0 or later
- Update Drupal core and all its dependencies:
- Run the following Composer command:
- If you are using
drupal/core-recommended
:composer update drupal/core "drupal/core-*" --with-all-dependencies
- Otherwise, run:
composer update drupal/core --with-dependencies
- If you are using
- If you'd like to update to an unstable release, use one of these instead:
- For alphas, betas, RCs, etc.:
composer require 'drupal/core-recommended:^8.9' --update-with-all-dependencies
- For a development branch, e.g. 8.9.x:
composer require drupal/core-recommended:8.9.x-dev --update-with-all-dependencies
- For alphas, betas, RCs, etc.:
- Run the following Composer command:
- Next, apply any required database updates using
drush updatedb
and clear the cache usingdrush cache:rebuild
- If you are using config management to deploy your config, make sure to export the config with
drush config:export
after the database update because some core updates may change the structure of the config files or introduce new values to them. Add the option--diff
to view actual changes. - Check that your Drupal site is ok:
- Review the status report page for errors.
- If the Database Logging module is enabled, perform some basic operations and check the recent logs for errors, warnings, etc.
- Review the status report page for errors.
- Deactivate maintenance mode using
drush state:set system.maintenance_mode 0
and thendrush cache:rebuild
. - After deactivating maintenance mode, test the site also as an anonymous user.
- If you have separate dev/staging and production servers, ensure the updated composer.json and composer.lock files are on production and always run
composer install --no-dev
on production, rather thancomposer update
. The--no-dev
switch skips the installation of packages not intended for use on production sites.
No comments:
Post a Comment