Last Reviewed: December 12, 2022
Upgrade Drupal Core Using Composer
Use Composer to update your site requirements:
composer require drupal/core-recommended:^9 \ drupal/core-composer-scaffold:^9 \ drupal/core-project-message:^9 \ -W --no-update composer require phpunit/phpunit:^9 \ behat/behat:^3 \ drupal/drupal-extension:^4 \ --no-update -W --dev
If you have
core-dev
installed, enter the following command (skip this step if you do not havecore-dev
installed):composer require drupal/core-dev:^9 \ --dev -W --no-update
Run
composer update
:composer update -W --optimize-autoloader --prefer-dist
If this command returns an error, check the output for any incompatible modules or themes and check the Upgrade Status under Reports in the Multidev environment.
Commit the changes and push them to the development environment:
git add composer.json composer.lock git commit -m "upgrade core to d9" git push origin drupal-upg-latest