Upgrade Drupal 8.6.9 to Drupal 10.0.7
Update Drupal core to a minor version( from Drupal 8.6.9 to Drupal 8.7.0)
Step 1:
- Change the core version to "drupal/core": "^8.7.0" in composer.json
- Change the "webflo/drupal-core-require-dev": "^8.7.0" version to same as a drupal core on composer.json
- Remove “webflo/drupal-core-require-dev” from composer.lock file
- Execute “composer update drupal/core --with-dependencies -v”
- Execute “drush updb -y” and clear cache “drush cr”
- Specify config sync patch in settings file
$config_directories[CONFIG_SYNC_DIRECTORY] = '../config/sync';
- Run database updates using “drush updb” or by running “update.php”
Step 2: Remove "webflo/drupal-core-require-dev" dependency
- Open your project's composer.json file in a text editor.
- Look for the line that includes "webflo/drupal-core-require-dev" in the require-dev section.
- Remove that line and any trailing comma, making sure not to remove any other dependencies that you need.
- Save the composer.json file.
- Once you have removed the package from your composer.json file, you can run the following command in your project directory to update the composer.lock file and remove the package: composer update --lock
- This command will update the composer.lock file to reflect the changes you made to your composer.json file, and it will remove any packages that are no longer required.
- It's worth noting that removing "webflo/drupal-core-require-dev" may impact your ability to run tests and perform other development tasks that rely on the Drupal core files and dependencies included in this package. So, you should only remove it if you are sure that you no longer need it.
Upgrade from Drupal 8.7 to 8.8
- Make sure you have Pathauto 1.6 or greater. If you need to update “composer require drupal/pathauto:^1.6”
- Backup site database and files at sites/default/files
- Remove/replace old dev packages “composer remove --dev webflo/drupal-core-require-dev”
- If you do not need the developer tools, you can stop here. If you would like to install them again using the official method, run: “composer require --dev drupal/core-dev”
- Require new Drupal core and dependencies:
composer require --update-with-dependencies
drupal/core:^8.8
symfony/finder:^3.4
symfony/filesystem:^3.4”
- Require new core-dev package and dependencies:
“composer require --dev --update-with-dependencies drupal/core-dev:^8.8 >symfony/debug:^3.4”
- Remove temporary required dependencies
“composer remove -n symfony/finder symfony/filesystem symfony/debug”
- Run database updates “dush updb”, in case you face this error “PHP Fatal error: Uncaught Error: Class 'Laminas\ZendFrameworkBridge\Autoloader' not found in /app/vendor/laminas laminas-zendframework-bridge/src/autoload.php:3 ”, remove composer.lock file and vendor folder from the project root and run “composer install”, then again run “drush updb”
- Clear site cache “drush cr”
- In Drupal 8.8.0 the sync directory is defined in $settings and not $config_directories, and so the Settings.php file should be updated.
- Change from “$config_directories['sync'] = 'foo/bar';” to “$settings['config_sync_directory'] = 'foo/bar';
Steps to Upgrade from Drupal 8.9.20 to Drupal 9.0.0
Step 1: remove drupal/console
composer remove drupal/console
Firstly please update all contrib module modules which is use in druopal 9 compatible.
Step 2: remove drupal/core or drupal/core-recommended from composer.json
Like:
"drupal/core-recommended": "^8.9.0"
"drupal/core": "^8.9.0"
And Remove Webflo from composer.json in require section Then rerun the composer update:
composer update
If you have drush and devel, which are widely used, also manually edit the versions:
"drupal/devel": "^4.0"
"drush/drush": "^10.0.0"
Step 3: add drupal/core-recommended:9.0.0 or drupal/core:9.0.0
- drupal/core-recommended": "9.0.0",
- “drupal/core”: “9.0.0”,
composer update
So, If you have faced issues like
- scaffold
- swift mailer
composer update
Step 4: Upgrade to the latest Drupal 9 version
Now we run the update the databasedrush updb
- I have faced the following issue regarding entity reference revision and paragraph entity does not exist. So, I have installed 2 modules, and the site issue is resolved.
"drupal/entity_reference_revisions": "^1.9"
"drupal/paragraphs": "^1.13"
And run Drush cr so, finally, our Drupal version is 9.0.0
Update from Drupal 9.0.0 to Drupal 9.5.7
Step 1: Checklist available Drupal Updated
composer outdated "drupal/*"
if your core version related to recommended run this composer
composer show drupal/core-recommended
If your core version related to core run these:
composer show drupal/core
Next, Remove scaffold composer.json and composer.lock And then edit these lines in the composer.json file.
"drupal/core": "9.5.7",
"drupal/core-recommended":"9.5.7"
And last Run
composer update
Note: composer version update in >=2.3 and Drush version >=11
Update from Drupal 9.5.7 To drupal 10.0.0
Step1: Update all custom and contrib modules compatible with Drupal 10 version.
Step 2: Remove the drupal-core-recommended line in composer.json and change “drupal/core”: 10.0.0” and remove the composer.lock and vendor folder and then Run the composer install Finally we are in Drupal 10 version and check all sites and change the default theme and Run command drush updb .
So, your composer.json file has some require Like,- symfony/finder
- symfony/filesystem
"symfony/property-access": "^5.3",