I want to update a site from Drupal 8.9 to 9.0. After copying all files and trying to execute update.php, I get the following error:

The website encountered an unexpected error. Please try again later.
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "entity.manager". in Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 1032 of vendor/symfony/dependency-injection/ContainerBuilder.php).

What can I do to update to Drupal 9.0?

My modules are up-to-date.

  • ctools
  • entity_reference_revisions
  • metatag
  • paragraphs
  • pathauto
  • redirect
  • svg_image
  • token
  • webform
  • That has been deprecated and you should be using entityType.manager. See: api.drupal.org/api/drupal/core%21lib%21Drupal.php/function/… – Kevin Jun 4 at 18:02
  • 1
    There is a module that is still using the entity.manager service, which doesn't exist anymore in Drupal 9. You should check if any of the modules you are using have a new version that is compatible with Drupal 9. For example, version 8.x-4.0 isn't compatible with Drupal 9, but version 5.0 (or 8.x-5.0) is compatible. – kiamlaluno Jun 26 at 9:21

Some modules still don't have a Drupal 9 compatible release. One option is to install the Upgrade Status module on your Drupal 8 site and resolve all compatibility issues before upgrading to Drupal 9 core.

After enabling the module, you can run the compatibility test from the Update Status UI (under Reports - admin/reports/upgrade-status). The test scans modules for the use of deprecated code, among other things. In the case of deprecated code, it'll tell you the file and line number of the problem so you know what needs to be fixed.

Here's a sample of the results when testing the Allowed Formats module, version 8.x-1.2:

Image showing an example of 2 deprecated code errors

As with any other modifications to contributed projects, make sure to use the project's issue queue and patches to modify the project's code.

| improve this answer | |

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.