I have Drupal 8.8.* and I would like to migrate to Drupal 9 using Drush 8. I know, we can use composer however I just wanted to confirm, whether we can do by using Drush command?

I tried using Drush but it's showing no updates available.

$ drush pm-update drupal-9.0.0
Update information last refreshed: Thu, 06/11/2020 - 11:42
 Name    Installed Version  Proposed version  Message                     
 Drupal  8.9.0              8.9.0             Specified version not found 

No code updates available.

No, you can't. drush pm-update has been deprecated for a while. The command is still available in the Drush 8.x branch but in later revisions it only exists as a signpost to inform the user how to move to Composer:

The pm-updatecode command was removed. Please see composer update --dry-run and composer update.

Noting that Drush 8 isn't supporting revisions past 8.3.x or 9.x, you should look into upgrading Drush and moving to a Composer-driven upgrade process.


While this not neither bulletproof, here is what I did now to move from Drupal 8 to 9 using composer:

  1. make sure you are on the latest drupal 8 version (let's call this d8)
  2. verify you meet the d9 server requirements: php min 7.3, mysql min 5.7.8
  3. do yourself a favor and make a database backup (I did not out of lazyness)
  4. create a new project standard drupal 9 somewhere: composer create-project drupal/recommended-project d9 (let'S call it d9)
  5. use composer require drupal/module-name-xy in the new d9 folder for every contrib module the d8 site is using - chances are pretty high, that they are all compatible with 9 already - if not composer will tell you and ideally also some options to fix it
  6. optional: if you are not using drush jet: composer require drush/drush
  7. add core_version_requirement: ^8 || ^9 to your custom my-module.info and my-theme.info files
  8. override the d8 composer.json with the d9 one
  9. run composer update in the d9 folder - now the main update is happening
  10. some files that have been changed by this automatically might need a rollback depending on your local deveopment settings: web/sites/development.services.yml and web/.htaccess in particular
  11. update the DB (I'm using drush): drush --yes updb
  12. start drupal and check the php error logs - you might encounter a few coding issues in your custom modules and thems, but they should be relatively straight foreward to identify and fix.
  13. in the end have a short look to /admin/reports/status

Fingers crossed and best of luck!

(feel free to edit and extend this answer to make the best possible upgrade guide out of it)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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