Updating Drupal modules
This documentation is incomplete. Add more information.
Since the recommended method for installing and updating a Drupal 8 site is via Composer, this page also describes how to update modules using Composer. And because you're using the command line, we also use Drush for some tasks.
Those who are used to updating modules with Drush should note that in Drush 9 and 10 (the current version), all up
, pm-update
, pm-updatecode
, and pm-updatestatus
commands are deprecated. You should use the appropriate Composer commands instead.
List Available Updates
Use the built-in Composer command to list packages with available updates:
composer outdated 'drupal/*'
You can also use the composer show
command to get similar information.
List Security Updates
Security status from Drupal.org is not available through Composer. Fortunately, Drush can help:
drush pm:security
Install Updates
To update a specific module/project:
composer update drupal/modulename --with-dependencies
Then, run all database updates, rebuild the cache, and export any changed configuration, reviewing changes with --diff
:
drush updatedb drush cache:rebuild drush config:export --diff
Drupal’s online documentation is © 2000-2020 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.