Score:0

Locked to version problem when upgrading

cn flag

Every time I run the composer command to upgrade Drupal 8.9.16 to Drupal 9, it notifies me that there is a problem with a module.

For example, I run:

composer require drupal/core --with-all-dependencies

I get:

Using version ^9.2 for drupal/core
./composer.json has been updated
Running composer update drupal/core --with-all-dependencies
Gathering patches from patch file.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/twig_tweak is locked to version 2.9.0 and an update of this package was not requested.
    - drupal/twig_tweak 2.9.0 requires drupal/core ^8.7 || ^9.0 -> satisfiable by drupal/core[9.2.0-alpha1, ..., 9.3.x-dev].
    - drupal/core[9.2.0-alpha1, ..., 9.3.x-dev] require symfony/routing ^4.4 -> satisfiable by symfony/routing[v4.4.0-BETA1, ..., 4.4.x-dev].
    - symfony/routing v4.4.25 conflicts with symfony/routing v4.4.25.
    - symfony/routing v4.4.24 conflicts with symfony/routing v4.4.24.
    - symfony/routing v4.4.22 conflicts with symfony/routing v4.4.22.
.....
.....

In this case, twig_tweak is already at 2.9.0, which supports Drupal 9, but it is complaining about it. I have been removing the problem module from composer.json and then running composer update, but every time I run composer require drupal/core --with-all-dependencies another module shows up with the same issue. I feel like I may be doing something wrong.

cn flag
Are you using `core-recommended` as described in the docs? https://www.drupal.org/docs/updating-drupal/updating-drupal-core-via-composer
albertski avatar
cn flag
My composer.json doesn't currently use `core-recommended`.
cn flag
You need to update all the contributed modules before attempting the core upgrade - see https://www.drupal.org/docs/upgrading-drupal/how-to-prepare-your-drupal-7-or-8-site-for-drupal-9/upgrading-a-drupal-8-site. [Upgrade status](https://www.drupal.org/project/upgrade_status) is very useful to get a list of what needs updating and what's available
albertski avatar
cn flag
Hi @Clive, I did run Upgrade Status and everything should be updated but I'm still getting these errors. For example, in this case, twig-tweak is at 2.9.0 which should support Drupal 9.
cn flag
Did you use composer to update the modules? If not then composer won’t know you’ve done it
albertski avatar
cn flag
@Clive I did update all with composer.
cn flag
Assuming your project is checked in to version control, try deleting `composer.lock` and `/vendor` and then running `composer update`. This is the nuclear option but I've used it on several sites to update to D9.
Score:-1
cn flag

Once you need to update the current code follow the below steps:

Step 1: Run command:

composer update

Step 2: You need to update the current code with an update to Drupal 8 and update using custom theme and module version

core_version_requirement: ^8.9 || ^9

SO current code and modules are ready to be upgraded with Drupal 9. This way we can reduce errors.

Step 3: Create a default folder and set the file to be editable.

chmod 777 web/sites/default find web/sites/default -name "*settings.php" -exec chmod 777 {} ; find web/sites/default -name "*services.yml" -exec chmod 777 {} ;

Step 4: Run These Commands (This Command Edits Your Composer File to Be Upgrade Ready)

composer require drupal/core-recommended:^9 drupal/core-composer-scaffold:^9 drupal/core-project-message:^9 --update-with-dependencies --no-update

If you have drupal/core-dev installed.

composer require drupal/core-dev:^9 --dev --update-with-dependencies --no-update

Step 5: Run command

composer require "drupal/core:9.2.1 as 8.9.16" --no-update && composer update

Step 6: Run Drush updatedb command

If you face any problem with core then

Step 6.1: Run Composer outdated "drupal/*" and update this listed module into the Drupal 9 version and upgrade the appropriate custom modules and themes with Drupal 9.

Step 6.2: $config_directories['sync'] change to $settings["config_sync_directory"]

https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-to-drupal-9-or-later

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.