Migration of the site to Drupal 8 and change of installation

Since October 2013, I've had a Drupal 7 site, part of the Drupal multi-site installation for École Centrale Marseille's association sites (referred to as "assos" in the rest of this article). It was accessible at assos.centrale-marseille.fr/ftorregrosa.

At the beginning of February I received an email telling me that this Drupal installation would soon be closed as the associations' sites were being redone using Wordpress.

Now, for the past 3 weeks, I've been putting a new version online using Drupal 8, on a dedicated server and with a dedicated domain name, florent-torregrosa.fr. I started preparing this new version after the Drupalcamp Paris 2019 that took place in mid-February.

Here's some feedback on this migration, the new features brought by Drupal 8, how the content was migrated, etc.

New features and improvements

With this redesign, I've taken the opportunity to rethink the design of the pages and the way I contribute my content.

Under Drupal 7, I was using the Media module, now in Drupal 8 core, but not using rich text insertion in favour of using fields, but on the other hand I was regretting that my articles didn't have more images inserted in the middle of the text where relevant.

I didn't want to bring out the heavy artillery that the Paragraphs module can be, so I turned to the Entity Embed module, which lets you embed entities (in this case what interests me the media) within RTEs by choosing the desired view mode and basing itself on the UUID of the inserted entity to find it.

This now allows me to put images, slideshows or documents (see videos later) directly in the body of articles in the appropriate place and no longer at the beginning or end of the content. As a result, there's no longer any need for dedicated file or image fields in the content, I've just kept a media field for teaser images.

Also on the content contribution, I took the opportunity to use the Linkit module, which allows you to make more robust internal links, using the UUID of the referenced entity and generating the link on display this allows you to manage an alias change if it occurs and if necessary in the event of a new migration, the UUID allows you to find the content better.

I use the Inline Entity Form module to contribute referenced entities, media and taxonomy terms, I preferred it to Entity Browser mainly for 2 reasons. The first being that the media library in the Drupal core being in experimental module, once stable it will be as if Entity browser was already integrated and the second being that I wanted a change from the systematic and sometimes abusive use of Entity browser that I encounter.

On the theming side, a lot of changes too:

  • use of Bootstrap 3: admittedly it's not recent, but at least I'm switching to a front-end development standard and I find the Drupal theme well maintained and stable. Even though I know it's regularly criticised :). In terms of customisation, I used the https://www.bootstrap-live-customizer.com site to use the Bootswatch Yeti theme. The site allows LESS export of variables, a little search and replace makes it easy to convert variables for SASS, with one or two manual adjustments to be made due to slightly different mixin syntaxes between LESS and SASS.
  • use of Slick for slideshows. Goodbye Colorbox and popins.
  • use of Blazy for lazy loading of images. For image format settings, I left the configuration provided by the standard installation profile, admittedly it may not be pixel optimal, but it does the job just fine.
  • use of Fontawesome 5 (in addition to the glyphicons provided by Bootstrap): this allowed me to redo the social networks block without using an image.

I was also able to install the classic modules used for SEO:

At the search level, I can now use Search API, and no longer the Search module in the kernel, with the database as the server, no need for a Solr.

For performance, controlling hosting, there is now a Redis and a Varnish that are used.

Continued content

Sometime before the release of Drupal 8, I had written a module to migrate the content of my Drupal 7 site to Drupal 8: https://github.com/FlorentTorregrosa/migrate_ftorregrosa

Since there were going to be structural changes to the content, and in order to be able to prepare the content on a development environment without having to use the development database for uploading, I chose to use CSV files unlike the first module which used the Drupal 7 site database directly.

So I:

  1. made CSV exports from the old site with the Views data export module,
  2. imported content via Migrate imports,
  3. re-exported the processed content, again with Views data export.

This allowed me to clean up my content as there was a lot of content that was incorrectly exported, for example:

  • HTML tags were now being interpreted,
  • internal links were no longer valid,
  • formatting no longer worked, Bootstrap classes had to be used for tables for example,
  • writing most of my articles on Libreoffice before turning them into content on the site, some words were made up of 4 links on different parts of the word instead of a single link, see the HTML contained a lot of useless span, results of formatting (colour, bold, etc.) removed and put back.

I also took the opportunity to retrieve tutorials I'd written on the École Centrale Marseille Drupal club site and improve the articles by adding teaser images to add a bit of illustration.

I recognise that finding an artistic image to illustrate an article can sometimes be quite laborious, and suddenly you have to illustrate an entire site that already exists...

Hosting

I took a dedicated "Classic Green" server as well as the domain name from web host Ikoula.

I wanted to test first with the smallest configuration possible and that's more than enough to have a Drupal 8 site that runs well.

This gave me my first experience of:

  • DNS setup (thanks to Bastien Rigon for the helping hand),
  • implementing Let's Encrypt: via Certbot, I was pleasantly surprised at how easy it was to set up,
  • using iptables to block certain ports (thanks to Dgeo for the advice),
  • installation of Matomo in production in a subdomain.

Problems encountered

At the theming level, there are a few points not handled by the Bootstrap theme:

Relating to theming, when I wanted to make content action links look like buttons, it highlighted a translation error. When a misplaced space affects the rendering! It's true that on https://localize.drupal.org, the translation tool didn't highlight the location of the space very well.

Explanation translation error

There is a space between "Learn more" and the following span when the space should be in the span.

Translation error corrected

Once the space is in the right place, the link looks good.

="" body="">

More annoyingly, to make it "clean", in the view settings, I wanted to remove the "_X" from the machine names of the view displays. This has the following effects:

  • fatal errors on some standard kernel views because there are kernel links that need these machine names,
  • the link to the RSS feed as well as the "see more" link (e.g. labels block and sidebar archives) for views that were no longer displaying, and impossible to find in views why this was no longer working even after resaving the configuration. For the sidebar blocks, even putting these machine names back in, the link didn't reappear, so I resorted to using text in the footer region of the view.

#DrupalWTF

At system level now, I had some trouble with the Nginx vhost configuration as the vhost for the site domain name was overriding the one for the subdomain for Matomo. Eventually this was resolved by using a single Nginx vhost and putting the subdomain instructions first.

And at the time of writing this article, I have yet to improve the sending of emails, some leave immediately while others don't arrive.

Conclusion

Even though I hadn't planned on migrating my site to Drupal 8 now, I'm still happy that it's done and that I'm now independent in terms of my hosting.

I can benefit from the latest features of Drupal 8 and am no longer stuck on a Drupal 7 with no custom code possible to implement and limited community modules.

The assos platform benefited from very good referencing, with the change of domain I lost referencing despite the redirection set up. I think this will come back with time.

Edit 18/06/2020: I've finally set up some site-specific image styles. See the dedicated article.

Comments

Add new comment