-3

I can run this command to upgrade drupal 9.4 to 9.5, but I can also do it in drush. Which method is better and why?

composer require drupal/core-recommended:9.5.0 drupal/core-composer-scaffold:9.5.0 drupal/core-project-message:9.5.0 --update-with-all-dependencies

1
  • 4
    As far as I know it cannot (should not) be done with Drush. Everyone should be leveraging Composer at this point.
    – Kevin
    Jan 17 at 18:42

1 Answer 1

4

Let me preface with what each of these are:

Drush is a command line shell and Unix scripting interface for Drupal. Drush core ships with lots of useful commands and generators. Similarly, it runs update.php, executes SQL queries, runs content migrations, and misc utilities like cron or cache rebuild.

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.


You cannot use Drush to update/upgrade Drupal 9. That particular Drush functionally/feature got deprecated. As Drupal 9 requires Drush 10 or higher, it doesn't have it.

enter image description here

source: Updating Drupal core via Drush

Composer is a very popular PHP tool used outside the Drupal world to manage dependencies.

Drupal decided to adopt it. Once this happened, there was no need for Drush to re-invent the wheel when there is already a dedicated tool built for this job specifically and that does it very well.

Not the answer you're looking for? Browse other questions tagged or ask your own question.