So long Drupal 7, welcome Drupal 9
Drupal 7 was released back in 2011. Having served the Drupal Community and its users for more than 8 years, it’s now due to reach end-of-life (EOL) in November 2021. Meanwhile, Drupal 9 is due to be released in 2020, which means Drupal 8 will also reach EOL at the same time as Drupal 7. This is a first for the Drupal platform and raises a host of questions for those with websites built on both the soon-to-be-retired versions.
What does Drupal end of life mean for websites owners?
If you haven’t moved yet to Drupal 8, now is the right time! The development of Drupal 8 has consistently improved the framework, making it easier to migrate websites. Though you should be aware, while the path from D6/D7 to D8 is well known, it’s not straightforward.
As Drupal 8 is an – almost complete – rewrite of previous versions of our beloved CMS, your content must be migrated, as well as your code, your themes, and your templates. So there is quite some work, but don’t worry! There is plenty of documentation around as lots of companies and organisations have already gone through that process, and this blog post has quite a few links and tips to make this task super-easy.
Let’s start with mentioning that Drupal 8 (and Drupal 9) ships with a migration framework out of the box. This means migrating your content from previous versions – as well as other systems – is an easy, (and often) non-technical job.
Your code is also covered, as the community has created a dedicated page for “Converting Drupal 7 modules to Drupal 8” which covers all common scenarios and issues. Plus we have a few more links and tips to share with you to make a painless D6/D7 to D8 transition.
After moving to Drupal 8, do I have to do it all again for Drupal 9?
The Drupal community has decided to stop breaking websites after each major version by adopting more granular release processes and policies.
For this reason Drupal 9 code will be EXACTLY like the last minor version of Drupal 8; stripped of all deprecated code.
This means if you follow Drupal best practices and don’t use deprecated code on Drupal 8, your website may require ZERO development time. The same should be true for all of the following major version updates.
What does it mean for module, profile and theme maintainers?
Either you have a module (or profile, or theme) hosted in Drupal.org or you have built custom ones for your organisation. You need to check if your code is compatible with Drupal 9, otherwise people will stop using it when they migrate. Keep reading to see some tips on how to make this an easy task.
OK, I’m excited! Tell me more
Below you will find some scenarios and best practice suggestions for site and module owners. If you need more info please don’t hesitate to get in touch with us.
… on Drupal 6
Well, you are quite behind. We strongly suggest a direct move to Drupal 8 as soon as you can. Although we said 8-to-9 will be straight forward, Drupal 8 includes migrations facilitations for Drupal 6 which probably won’t be included in Drupal 9. There is the possibility that these might be available as contrib modules, but it’s better to be safe than sorry, and start moving now!
…on Drupal 7
You have about 2 and a half years to migrate to either Drupal 8 or Drupal 9. However it’s strongly recommended to start planning the migration to Drupal 8 now, to make sure you have enough time to do the work and tests you may require.
In fact, since the release of Drupal 9 is set for June 2020, choosing to jump straight to D9 will leave you with just 12 months between the release and the Drupal 7 end-of-life deadline. We’ve already shared some links to help you migrate your code and content, but you may also find the Drupal Module Upgrader module really useful.
If moving to D8 is really impossible for your website, there is another possibility to stay on this version by using one of the approved Long Term Support providers. There may be additional fees to stay on these programmes, but it worked very well with D6. Check this out to know more and stay up-to-date.
…on Drupal 8
Well done! If you are already on Drupal 8, either because you’ve already migrated or built your website directly with version 8, you’ll be glad to know you may already be ready to move to the next major version with zero effort!
As the big difference between last D8 release and the first for D9 is all of the deprecated code being removed, you only need to check that your modules, themes and profiles don’t contain deprecated code. So there’s no need to worry about migrating your content at all!
And don’t worry about the code either, as the community has already created some tools and practices to facilitate this work.
For example if you maintain some contrib modules on Drupal.org, you can already test if the code is D9 ready. The task is as easy as uploading a really small patch in an issue and waiting for the testbot’s results. I’ve done this for the Chatbot API module: see the issue and the results yourself. There are only four deprecation messages for Chatbot API, which isn’t bad. Almost D9 ready!
And if you want to test your module’s code directly, you can download and use Matt Glaman’s drupal-check right now. Follow the steps to download and run the tool against the modules you’ve built, or use, for your website and find out if they are ready for D9.
Also Drupal API has “Deprecated”. Through this interface you can look for the deprecation message and explore the code and how to fix it.
And – of course – the best way to stay up-to-date is keeping an eye on Drupal Change Records. However, as that interface is a UI for the actual Drupal code itself, you can always find the same info in your codebase files too.
You now know what you have to change to be compatible, but not yet how. The deprecation messages always try to point you in the right direction with helpful suggestions.
Take, for example, the first deprecation error on Chatbot API:
“\Drupal\Component\Utility\Unicode::strtolower() is deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. Use mb_strtolower() instead. See https://www.drupal.org/node/2850048.”
It says exactly what’s going on and the link also explains even further the issue and the reason for the change, as well as giving you some examples. I just need to scan my code for “Unicode::strtolower” instances and replace them with “mb_strtolower”.
…on Drupal 9
Nope, not yet. But if you are up-to-date on D8 you are really close!
Check this list of useful links, and always get in touch with us if you need more info.
- Dries on Drupal 7, 8 and 9 plans: https://dri.es/drupal-7-8-and-9
- Dries about the Plan to release D9: https://www.drupal.org/blog/plan-for-drupal-9
- Requirements before opening 9.x branch: https://www.drupal.org/project/drupal/issues/2608062
- Help contributed modules prepare for Drupal 9: https://www.drupal.org/node/3032484
- Gábor Hojtsy about helping contrib modules to be D9-friendly: http://hojtsy.hu/blog/2018-dec-17/how-automate-testing-whether-your-drupal-8-module-incompatible-drupal-9
- Video podcast with Dries and Gábor about Drupal 7, 8 and 9 migration tasks: https://www.youtube.com/watch?v=yPSPopoZdDw