Skip to main content
Last Reviewed: December 12, 2022

Upgrade Drupal Core Using Composer


  1. 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
  2. If you have core-dev installed, enter the following command (skip this step if you do not have core-dev installed):

    composer require drupal/core-dev:^9 \
       --dev -W --no-update
  3. 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.

  4. 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