Preparing Lagoon for Drupal 9 Launch Day

Lagoon + Drupal 9

Preparing Lagoon for Drupal 9 Launch Day

As everybody knows, Drupal 9 is just around the corner. As a hosting provider, we need to be able to make sure that our customers who wish to utilize Drupal 9 can do so. The release comes with a few environment requirements that we need to make sure we can handle, and adds a few more behind-the-scenes actions we needed to prepare ourselves.

Lagoon 1.6.0 supports Drupal 9, meeting all those requirements, and helping our customers to migrate across to D9 as soon as possible.

PHP7.4 (also PHP7.3)


We’ve been providing PHP7.4 images alongside 7.2 and 7.3 for a few months now, so we’ve got that covered! We’ll be looking to support PHP8 once it’s out in December – hopefully, we can get some RC images out to test with beforehand!

Drush 10

Although all our drupal-specific PHP images contain Drush 8.3 as a fallback, we also install drush-launcher to allow for project-specific Drush versions to be utilized. In the case of Drupal 9, Drush 10 is the minimum, so as long as that version is specified, you’ll be fine! All PHP containers have included default drush.yml files since Drush 9 was released.



MariaDB 10.3.7+

In every version of Lagoon up to v1.5.0, we’ve had to use the 10.2 version of MariaDB for compatibility reasons (mostly around Galera) – this means that we’ve had to base the MariaDB install on the Alpine 3.8 images (which is now EOL). To meet Drupal 9 minimum requirements, we’ve switched to the Alpine 3.11 packaged version (10.4). In doing this, we’ve dropped support for the mariadb-galera images (no-one was using them anyway). We’ve also included a script in the entrypoint of the image to ensure that any databases are properly upgraded prior to use. This will give us the flexibility to use the upstream alpine version going forward (hopefully no more image pinning!).  Note that there is a Drupal module available for customers that *must* use an older version of MariaDB with Drupal 9.0 – it can be installed via composer, and requires some settings.php to enable.

We’ve also checked the PostgreSQL requirements – we have a compatible version of PostgreSQL installed (11.6 at the time of writing) and the necessary extensions (pg_trgm) installed. Note that as of the Drupal 9.0 release, the extension isn’t actually utilised yet, but will be checked and enabled in a future release.

Contributed Drupal modules possibly in use

https://www.drupal.org/project/lagoon_logs will be D9 compatible from 1.1 onwards


Redis

https://www.drupal.org/project/redis is D9 compatible from 1.3 onwards

Solr 

https://www.drupal.org/project/search_api_solr is D9 compatible from 3.9/4.0 onwards

https://www.drupal.org/project/search_api is D9 compatible from 1.17 onwards


Varnish

https://www.drupal.org/project/lagoon_varnish has D9 compatibility in the 1.x-dev branch

https://www.drupal.org/project/varnish_purge is D9 compatible from 2.0 onwards
https://www.drupal.org/project/purge is D9 compatible from 3.0 onwards

Drupal Console


Our previous Drupal-example projects included Drupal Console in addition to Drush to manage aspects of your Drupal site.  Drupal Console is not yet compatible with Drupal 9 (there is an open issue to make it Symfony 4 compatible).  In order to upgrade an existing site to Drupal 9, you will first need to “composer remove” Drupal Console if you have it installed.  The base images we provide only have drupal-console-launcher installed, which will not conflict with your site or requirements.

Testing

We’ve also implemented some new Drupal 9 tests in Lagoon – currently just one test (PHP7.4 and MariaDB), but we will be porting more tests across shortly.

In order to demonstrate how to set up a Drupal9 project, we’ve redeveloped our drupal-example project, and also taken on board some feedback that needs simplifying. We’ve created a new project at https://github.com/amazeeio/drupal-example-simple – which is by default a Drupal 8 install (that now takes advantage of the improvements in the Drupal "Composer in Core" initiative, and uses a more widely compatible scaffold technique), but also has a 9.x branch that includes all the necessary changes for D9 (hint: there aren’t many).

We’ve worked really hard to ensure that Lagoon is ready for Drupal 9, and we look forward to seeing your sites as they start to go live.


Writer