I'm pretty new to Drupal and I'm trying to update a website from 8.0.0 to 8.6.1.
I've followed the guide here: https://www.drupal.org/docs/8/update/update-core-via-composer
The composer part went pretty well. However, when I run the command:
drush updatedb
I get the following error:
Command updatedb needs a higher bootstrap level to run - you will need to invoke drush from a more functional Drupal environment to run this command.
The drush command 'updatedb' could not be executed.
I've read online that I had to use cc all
first, but when I do:
drush cc all
I get the following:
No Drupal site found, only 'drush' cache was cleared.
I thought that I might have to update my Drush version since I was running on 8.1.17 because version 9.x was not supporting Drupal 8.0.0. Therefore, I updated to 9.4.0.
Now when I execute the updatedb command, I get the following:
Bootstrap failed. Run your command with -vvv for more information.
And the stacktrace:
Exception trace:
Drush\Boot\BootstrapHook->initialize() at /root/.composer/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:34
Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->callInitializeHook() at /root/.composer/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/InitializeHookDispatcher.php:27
Consolidation\AnnotatedCommand\Hooks\Dispatchers\InitializeHookDispatcher->initialize() at /root/.composer/vendor/consolidation/annotated-command/src/CommandProcessor.php:117
Consolidation\AnnotatedCommand\CommandProcessor->initializeHook() at /root/.composer/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:391
Consolidation\AnnotatedCommand\AnnotatedCommand->initialize() at /root/.composer/vendor/symfony/console/Command/Command.php:217
Symfony\Component\Console\Command\Command->run() at /root/.composer/vendor/symfony/console/Application.php:964
Symfony\Component\Console\Application->doRunCommand() at /root/.composer/vendor/symfony/console/Application.php:248
Symfony\Component\Console\Application->doRun() at /root/.composer/vendor/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at /root/.composer/vendor/drush/drush/src/Runtime/Runtime.php:112
Drush\Runtime\Runtime->doRun() at /root/.composer/vendor/drush/drush/src/Runtime/Runtime.php:41
Drush\Runtime\Runtime->run() at /root/.composer/vendor/drush/drush/drush.php:66
require() at /root/.composer/vendor/drush/drush/drush:4
And if I open my drupal website, I'm getting a fatal error:
Fatal error: Class 'Drupal\Component\Utility\String' not found in /home/username/public_html/themes/name/name.theme on line 548
I'm executing all commands from the root of my drupal website. I've also tried to execute it from sites/default/
.
Update
I've restored to the version before the update, then performed the following steps in order:
- Updated composer.json to
"drupal/core": "8.6.1"
- Executed the command:
composer update drupal/core --with-dependencies
- Changed directory into the
core/
folder - Executed the command:
composer install
in the subdirectory - Opened domain.com/update.php.
If I don't perform step 3 & 4, I get an error when trying to load my website saying that it cannot load the file core/vendor/autoload.php
.
Then I'm still getting the same fatal error as mentioned above.
composer.json
This is the original composer.json before the update.
{
"name": "drupal/drupal",
"description": "Drupal is an open source content management platform powering millions of websites and applications.",
"type": "project",
"license": "GPL-2.0+",
"require": {
"composer/installers": "^1.0.20",
"drupal/core": "8.0.0-beta6"
},
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [],
"config": {
"preferred-install": "dist",
"autoloader-suffix": "Drupal8"
},
"extra": {
"_readme": [
"This is an example file to show how a Drupal website can be managed via",
"Composer. It does not work out of the box but requires a Git subtree",
"split of the core directory to be added to the repositories",
"section above."
]
}
}