Steve
Steve

Reputation: 23

Upgrade Drupal Website from version 8.7 to 9.3

I'm having an issue upgrading my Drupal website from Drupal version 8.7 site to 9.3 Tried to run the automatic update script from Drupal on the staging environment, but even though the script displayed a success message, somehow the website return an unexpected error and is totally inaccessible.

I have a freshly installed Mac Book Pro with only a local web server (MAMP) installed and a locally cloned git of website code without a composer build, so any help with detail on a step-by-step workaround is greatly appreciated. Thanks in advance for your support.

I already check the application.log and it produces this error below. But I can't find any of these files on my site build, can someone help me out with what do I need to do to fix this issue?

==> app.log <== Error: Class 'Drush\Log\DrushLog' not found in /app/core/lib/Drupal/Component/DependencyInjection/Container.php on line 262 #0 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(176): Drupal\Component\DependencyInjection\Container->createService(Array, 'logger.drupalto...') #1 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(437): Drupal\Component\DependencyInjection\Container->get('logger.drupalto...', 1) #2 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(276): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) #3 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(176): Drupal\Component\DependencyInjection\Container->createService(Array, 'logger.factory') #4 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(437): Drupal\Component\DependencyInjection\Container->get('logger.factory', 1) #5 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(240): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) #6 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(176): Drupal\Component\DependencyInjection\Container->createService(Array, 'autologout.mana...') #7 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(437): Drupal\Component\DependencyInjection\Container->get('autologout.mana...', 1) #8 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(240): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Array) #9 /app/core/lib/Drupal/Component/DependencyInjection/Container.php(176): Drupal\Component\DependencyInjection\Container->createService(Array, 'autologout_even...') #10 /app/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(136): Drupal\Component\DependencyInjection\Container->get('autologout_even...')

Upvotes: 2

Views: 209

Answers (1)

Anton
Anton

Reputation: 36

I would suggest first, checking the Drupal status report and making sure that there are no alerts and warnings still present on the information.

If there are no critical issues reported on the status, backup existing source code and database for safekeeping. These particular error messages are related to missing Drupal components and dependencies, so the best approach is to run the composer.

If you're on a new device, download the composer first. Open the Mac Terminal and run this command to download and set up the composer on your devices.

sudo php -r "copy('https://getcomposer.org/installer','composer-setup.php');" 

sudo php composer-setup.php

sudo php -r "unlink('composer-setup.php');"

To install globally and make composer executable on any folder, run

sudo mv composer.phar /usr/local/bin/composer

change the directory to the local website code and run

composer install

wait until it finished installing the required dependencies and run

composer update

just to make sure, the dependencies are updated as well.

your error mentioned missing drush so run composer with drush, and add all the installed files that was just been added to the local git source code

composer require drush/drush

git add composer.lock -f

then just add all the new files, commit and push all the changes to the staging website

git add .

git commit -m "message about dependencies"

git push

If your cloud provider has CI/CD integrated into the repository, the code push should have deployed everything directly on the site.

Upvotes: 2

Related Questions