As Drupal 9 approaches its end of life (EOL) this November, there has been a significant drive to upgrade to Drupal 10 across our client base. In this post, we will delve into the lessons we've learnt and the challenges we've encountered during this transition process.
Given Drupal 9’s dependency on its primary web application framework, Symfony 4, which reaches its end of life in November 2023, it has become critical for all sites running on Drupal 9 to undergo an upgrade to Drupal 10. This transition will ensure continued security and stability for Drupal platforms beyond the Symfony 4 end of life date.
In addition to resolving the issues surrounding Symfony 4, a Drupal 10 upgrade is necessary in order to gain access to the latest features and enhancements that the new release has to offer, as well as underlying performance improvements and long term support, whilst safeguarding the integrity of client projects.
How Zoocha Prepared for the Drupal 10 Upgrade
At Zoocha, we are host to a diverse range of client sites which involve many different components from intricate API integrations and customised search features to large scale commerce solutions. Consequently, it was crucial to take a proactive approach and plan in advance to allow clear communication and transparency with our clients as we moved closer to commencement.
Living Document
In order to create an upgrade process which proved to be progressively smoother and more efficient with each project, it was essential for us to maintain a living document. At Zoocha, we use Confluence to house documentation both internally and in collaboration with our clients. Given the substantial number of clients that required a Drupal 10 upgrade, the maintenance of living documents entailed a best practice of consolidating and folding valuable learnings and challenges into a dedicated space within Confluence
Consistency
Furthermore, ensuring consistency in our approach and workflow was extremely significant in the lead up to the Drupal 10 upgrade. This was established across all projects, enabling the team access to efficiencies such as:
- Standardising naming conventions within Git for the Drupal 10 branch to enable alignment across testing environments.
- Establishing processes to ensure the Drupal 10 branch remained up to date and in sync with any ongoing active deployments.
- Creating consistent templates for pull requests and QA by providing information on module updates and key areas of functionality.
The Assessment Phase
Existing Drupal Core Versions
Before commencing the upgrade process, it was essential to optimise each site to ensure they were operating on the latest versions of either Drupal 9.4.x or Drupal 9.5.x. This proactive approach played a pivotal role in simplifying the transition to Drupal 10.
Upgrade Paths and Compatibility
By leveraging the upgrade status module, we gained access to invaluable data and recommendations regarding Drupal 10 compatibility for each project. This not only supported our estimations in gauging the level of effort needed from our team across our client base but also significantly influenced our overall approach to the upgrade process.
Upgrade status before:
Upgrade States after addressing issues:
CKEditor Plugins
Some of the most notable changes within Drupal 10 to take into consideration upon the commencement of the assessment phase were the introduction of CKEditor 5 to core, replacing CKEditor 4 due to its EOL in June this year, and deprecated themes: Seven, Stable, Classy and Bartik.
The introduction of CKEditor 5 to Drupal core represents significant change, therefore making the assessment of the extent of the CKEditor plugin reliance across the client base was crucial to accurately guide estimates. The CKEditor plugin report alongside the outlook for modules offering plugins offered valuable insights into this process and provided us with the initial understandings of what to expect in reference to upgrade paths and plugin compatibility.
Deprecated and obsolete extensions
Regarding the reliance on deprecated themes, Zoocha needed to identify any dependencies on base themes that were removed in Drupal 10. This identification was crucial in order to accurately gauge the scope and effort required during the upgrade process.
Challenges and Learnings
Throughout the process, we have been faced with challenges related to upgrade paths and compatibility with particular contrib and custom CKEditor plugins. Consequently, we found it necessary to utilise the CKEditor 4 contrib module as a temporary solution, which provided us with the time required to address these issues. Within this, a number of security assessments were conducted to ensure that the decision to use CKEditor 4, given its EOL, did not introduce any security risks.
Similarly, in the interest of time and effort, we were able to alleviate the Stable and Classy contributed themes, allowing Zoocha to continue the utilisation as base themes during the investigation into the level of effort required to transition away.
JQuery Once
Furthermore, the removal of JQuery once from core within Drupal 10 meant that it became necessary to apply the required updates to utilise JavaScript once to maintain functionality and compatibility. Some of these updates were:
- To replace jQuery once, which was still used in contrib modules by looking for patches or creating them ourselves.
- To replace jQuery once in all of our custom modules and custom themes to make sure the code produced by Zoocha is behaving as desired under the new Drupal guidelines.
Twig 3
Drupal 10's adoption of Twig 3 (from Twig 2) is another noteworthy change. While there were no major changes, a few features were deprecated and removed in Twig 3. Some of the main encounters (so far) include:
- {% spaceless %} should now be {% apply spaceless %}
- A template that extends another one cannot include content outside Twig blocks
Final Thoughts
As we navigate our way through each project, encountering fresh challenges and overcoming hurdles, it is vital to embrace the mindset of contributing to the Drupal community. This includes providing any patches or solutions that we may develop along the way to further grow and enhance the community.