0

I am attempting to upgrade my Drupal 8.9.2 multi-site installation to D9. I was hoping to work this all out on a development installation, that is located in a subdirectory of my home directory on my NameCheap Shared Hosting plan.

When I first installed this installation, I did so using the tarball method from years ago. I then followed the instructions given here (https://www.drupal.org/docs/installing-drupal/add-composer-to-an-existing-site). I was able to get the current running prod version converted to use composer with out an issue.

Before I go and start messing with the files, and attempting to upgrade to D9 through composer on a prod installation, I wanted to copy these files over to another installation where I can use it as a sandbox. To do this I:

  • copied the files on my server to a new directory
  • made clone databases for the new installation
  • truncated all the cache tables in the cloned DB
  • changed all the database settings in the settings files to point to the cloned databases

I've done this before without any issues, and now I seem to be getting a WSOD error on all the sites running from the new installation. The error I'm getting is

PHP Fatal error: Uncaught Error: Class 'Drupal\Core\Cache\DatabaseBackend' not found in ~/{new installation dir}/public_html/index.php:16.

If anyone has any thoughts what's going on I am all ears.

Thank you in advance

1

I was able to get the current running prod version converted to use composer with out an issue.

If you have converted your site to use composer , you dont need to copy the whole code base into the new server. Just copy the config,custom modules, composer.json, composer lock files and other reqired files except the core, vendor and contributed modules into new server along with sites directory folder and run composer install in the root directory of the server.This can be done by initiating a git repo in the current code and using the default .gitignore file which is available in code.And cloning the same repo in new server.

As you have already copied all the files into new server.

Just run rm -Rf vendor , rm -Rf web/core and rm -Rf web/modules/contrib and run composer install from the root directory in the new server.

After doing this you will probably get your site running in Dev environment as well.

| improve this answer | |
  • This worked like a charm! I figured there was an easy solution, I'm just rather new with composer, and trying to figure this all out as I go. Thank you very much @miststuden2011. I did have to change the web directory to public_html since that's where my host looks for files on my main domain, but I caught that before I started running the commands blindly ;) – Glaze Aug 8 at 16:30

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.