Upgrade to the latest version of D10 (10.3.6)
We visited Drupal Cafe Lutsk #26 and were inspired to write an article, and we have enough projects on Drupal CMS.
So it's time to update the system of our social project to the latest version... Burn the barn, burn the house, as they say)
Drupal 10 has already proven itself well, but it's scary to upgrade to version 11. But we are not afraid)
Initial data
Let's start with the fact that we have already gone through the problem of upgrading CKEditor 4 to CKEditor 5. And we already had a project with Drupal 10.1.8.
It's probably clear what problems we had to go through to upgrade from D10.1.8?
After this major upgrade, registration stopped working, and the problem was simple: we had to update all the modules, all of them! And not just the ones with the red light...)
Well, the OpenID Connect / OAuth client update team successfully fixed the error:
composer require 'drupal/openid_connect:^3.0@alpha'
Perhaps it's better to show screenshots and comment on it a bit. Maybe someone else is going to upgrade their projects...
Drupal 10
At the moment, the current version of Ten is 10.3.6.
The correct sequence of actions when updating:
Check for current versions.Update all modules to current working versions.Upgrade in a minor way (sequentially, not immediately to the latest version).In the process, update Drush.You will also need to update php 8.3, the DBMS.
So, now one by one.
Drupal 11 requirements:
- Apache 2.4.7 or higher, Nginx 1.1 or higher, or any other web server with proper PHP support.
- Database
- MySQL 8.0 or higher.
- MariaDB 10.6 or higher.
- Percona Server 8.0 or higher.
- PostgreSQL 16 or higher.
- SQLite 3.45 or higher. - PHP
- PHP version: Drupal 11 requires PHP 8.3.
- PHP extensions needed: PDO, XML, GD-library, OpenSSL, JSON, cURL, Mbstring, zlib.
Updating Drush and other modules
Our project didn't allow us to update to the latest version of Drush, so we're going to go sequentially. minor:
composer require drush/drush:^12.5.2 -W
Next, we update Drupal itself to version 10.3.6
composer require drupal/core-recommended:10.3.6 drupal/core-composer-scaffold:10.3.6 drupal/core-project-message:10.3.6 --update-with-all-dependencies
The -W switch makes it quite easy to use, as it updates all dependencies.
Interestingly, there is also a problem with the Gin Toolbar module, so we recommend disabling it:
drush pmu toolbar
Run the database update:
drush updb
And with that, the system is updated to the maximum “ten”.
Preparing for the Drupal 11 upgrade
Since Drupal 11 already requires php8.3, it's time for us to do the same.
Commands to help you update PHP:
Save existing php package list to packages.txt file
sudo dpkg -l | grep php | tee packages.txt
Add Ondrej's PPA
sudo add-apt-repository ppa:ondrej/php # Press enter when prompted.
sudo apt update
Install new PHP 8.3 packages
sudo apt install php8.3 php8.3-cli php8.3-{bz2,curl,mbstring,intl}
Install FPM OR Apache module
sudo apt install php8.3-fpm
OR
sudo apt install libapache2-mod-php8.2
On Apache: Enable PHP 8.3 FPM
sudo a2enconf php8.3-fpm
When upgrading from an older PHP version:
sudo a2disconf php8.2-fpm
Remove old packages
sudo apt purge php8.2*
There is one more thing to update/install:
sudo apt-get install php8.3-gd
sudo apt-get install php8.1-xml
Drupal 11 update
Let's update Drush 13:
composer require drush/drush:^13 -W
We have a small project, nothing critical has been changed, except for updating the models, because some modules depend on the version of Drupal.
Let me remind you how the modules are updated:
composer require 'drupal/<name_module>:^<version>'
This command can be found on every page of the module project.
So the next step was to update Drupal:
composer require drupal/core-recommended:^11 drupal/core-composer-scaffold:^11 drupal/core-project-message:^11 --update-with-all-dependencies
Conclusion
Upgrading to Drupal 11 is a strategic move that unlocks new opportunities for growing your business in the digital space. This version not only offers cutting-edge solutions for creating high-quality content but also ensures improved performance and security. Drupal 11 enables organizations to remain agile and responsive to change, facilitating faster implementation of new features and integrations, which is a key advantage in an increasingly competitive environment. Careful preparation for the upgrade and leveraging the new tools and capabilities of this version will help optimize your workflows and enhance site management efficiency. Upgrading to Drupal 11 signifies your business's readiness to meet modern challenges and embrace technological innovation, ensuring stability and long-term success.