Skip to content

Upgrade Drupal 8.x

Olivier Bouwman edited this page Jan 17, 2019 · 5 revisions

8.2.x to 8.3.x

Ensure you have the latest stable version of the site and are in the primary code branch. Get the db and (optionally) files from the live site.

Review the repo README/wiki to see if there are any notes regarding special cases or other misc issues.

Update Core

Follow the steps below to update your core files.

  1. Create a upgrade branch using the target core version: upgrade-8.3.4.
  2. Run composer update drupal/core --with-dependencies to update Drupal Core and its dependencies.
  3. Run robo install to ensure the site installs correctly.
  4. Update composer.json to reflect the updated versions (not needed for minor version changes like in most security updates).
  5. Run drush updb, drush entity-updates, and drush cr.
  6. Review any patch that threw Could not apply patch! Skipping. messages. IF it has been integrated into the project, you can remove it (Q: How can you tell?). This message is frequently misleading, so be sure to check! (the patch may have been previously applied if you have an existing version of the site or re-run composer update for example).
  7. Run git diff to determine if any of the scaffolding files(?) have changed. Review the files for any changes and restore any customizations to .htaccess or robots.txt.
  8. Commit everything all together in a single commit, so web will remain in sync with the core when checking out branches or running git bisect.

Common Errors (composer)

Your requirements could not be resolved to an installable set of packages.

A locked/specific version of a module being incompatible with core or an updated module. Usually resolvable by upgrading to a more recent version. In the case of devel modules, they may often be removed.

[InvalidArgumentException] Package is not installed:

This is an intermittent composer bug that fixes itself simply by re-running composer update.

Common Errors (robo)

PHP Fatal error: (something was not found)

Happens when a library/dep/module is no longer available. For example, if you remove a module from composer.json without uninstalling it first from a working site, the config files will still be in place and config/core.extension.yml will still look for it. (It will also be lingering in the db causing errors after you import the live db).

PHP Fatal error: Function previously declared

A patch needs to be re-rolled.

Common Errors (post-install)

Display Suite horribly broken

Display Suite does not like file-based configuration. To upgrade DS, have the site built pre-upgrade and:

  1. Disable file-based config in web/sites/default/settings.php. Search for $settings['bootstrap_config_storage'].
  2. Import the live DB.
  3. Update the code as above.
  4. Export the site configuration using either the admin interface /admin/config/development/configuration/full/export or drush cex.

Deploy to Pantheon, Create Multidev

Need D8 Deploy process here.

Clone this wiki locally