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 --devIf you have
core-devinstalled, enter the following command (skip this step if you do not havecore-devinstalled):composer require drupal/core-dev:^9 \ --dev -W --no-updateRun
composer update:composer update -W --optimize-autoloader --prefer-distIf 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