1

I have a site with Drupal 9.2.5 and the site was clobbered after installing WordPress in the web root.

I have a backup of the site database, and the sites/default/* files, but I just can't get Drupal up and running again to restore it to the way it was.

I have tried installing again and placing the files back, but this doesn't work.

I have looked at the Drupal docs and searched for migrating or restoring a Drupal site, but nothing seems to be working out.

Once I create a new database, and import all data from the old one, update my settings and restore the folders and files, I get this error:

The website encountered an unexpected error. Please try again later.

Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /"
in Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest()
(line 136 of vendor/symfony/http-kernel/EventListener/RouterListener.php).

I am not sure what to do here: the issue is obviously with routing but I am stuck.

I can get to the install script, but it tells me Drupal is already installed, and to empty the database and start again (not what I want!)

I have tried the upgrade script, but I get an error:

The website encountered an unexpected error. Please try again later.
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a
non-existent service "access_check.db_update". in
Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition() (line 1032 of vendor/symfony/dependency-injection/ContainerBuilder.php).
Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition('access_check.db_update') (Line: 600)
Symfony\Component\DependencyInjection\ContainerBuilder->doGet('access_check.db_update', 1) (Line: 558)
Symfony\Component\DependencyInjection\ContainerBuilder->get('access_check.db_update') (Line: 186)
Drupal\Core\Update\UpdateKernel->handleAccess(Object, Object) (Line: 101)
Drupal\Core\Update\UpdateKernel->handleRaw(Object) (Line: 75)
Drupal\Core\Update\UpdateKernel->handle(Object) (Line: 27)

This is very frustrating. I can't find any useful information on restoring an existing Drupal site and how to do this.

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Sep 8, 2021 at 15:16

1 Answer 1

1

After restoration the database you need to reload cache. If drush is installed globally you can do it by executing this command from docroot drush cr . If drush is installed locally ../vendor/bin/drush cr

If drush is not installed you need to Truncate cache tables from database. But it should be considered as last resort and not advisable.


TRUNCATE `cachetags`;
TRUNCATE `cache_bootstrap`;
TRUNCATE `cache_config`;
TRUNCATE `cache_container`;
TRUNCATE `cache_data`;
TRUNCATE `cache_default`;
TRUNCATE `cache_discovery`;
TRUNCATE `cache_dynamic_page_cache`;
TRUNCATE `cache_entity`;
TRUNCATE `cache_menu`;
TRUNCATE `cache_page`;
TRUNCATE `cache_render`;
TRUNCATE `cache_rest`;
TRUNCATE `cache_toolbar`;
TRUNCATE `cachetags`;
TRUNCATE `cache_bootstrap`;
TRUNCATE `cache_config`;
TRUNCATE `cache_container`;
TRUNCATE `cache_data`;
TRUNCATE `cache_default`;
TRUNCATE `cache_discovery`;
TRUNCATE `cache_dynamic_page_cache`;
TRUNCATE `cache_entity`;
TRUNCATE `cache_menu`;
TRUNCATE `cache_page`;
TRUNCATE `cache_render`;
TRUNCATE `cache_rest`;
TRUNCATE `cache_toolbar`;

2
  • 1
    Thank you, my issue was that I tried to restore a database with truncated cache tables. Once I restored the modules and all files in the same place, and imported the database with the cache tables, it worked as expected. (drush did not work for me though). Commented Sep 12, 2021 at 3:08
  • 1
    thank you , that worked for me
    – Ali Mhanna
    Commented Mar 24, 2022 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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