Skip to main content
Working from scratch, following simplicity

My site renews: a brief description of the migration to Drupal 9

Just four years ago, I migrated my site from Drupal 7 to 8 and now I was forced to update to the new version, which is Drupal 9. Indeed the expiration date, the next November, is nearby, but above all I wanted to change my obsolete theme. Now it has a more modern and optimized look. Below I will describe my brief experience which fortunately was less complicated than expected.

My site renews: a brief description of the migration to Drupal 9

The migration is easy to do because the difference between the 8 and 9 versions is really small, while the update process is the same, indeed you have to:

  1. check if your hosting service supports PHP 7.3+ e MySQL 5.7.8+;
  2. replace the core and vendor folder with those in the last release (in my case 9.2.4) and obviously fix the content in .htaccess and settings.php;
  3. put your site in maintenance mode;
  4. link to the page yoursite/update.php.

So I did it immediately when I verified that Altervista was compatible with the minimum requirements (it supports PHP 8 and MySQL 8.0.21). But the incompatibilities due to modules and theme installed in my 8 version were a lot (read my article How to copy a Drupal website from remote to local to see how many they were).

Advice: don't install the Upgrade Status module, in my case I wasted a lot of time because I had to install a new version of Drupal with composer. At the end the report was more robust and complete than the one shown with update.php, but the incompatibilities are the same.

Theme

The main problem was the theme, in my case an old version of Bartik with a lot of code customized by me! At that time, I had edited a lot of files, adding JavaScript, CSS and Twig code. Today I don't remember anything about Twig as I have never used it anymore.

Therefore I searched for a new theme available also for  Drupal 9 and I found two awesome ones:

I chose Tara and I bought the PRO version because it has the features I need and it is easy to customize with CSS code. The only trouble was to render the slideshow in the home page multilanguage. In this theme, you have to put the HTML code inside a form, while I was used to creating content in a views (as described here Slideshow of the last articles with Views). Sure I could keep my original views, but in Tara it is easier to edit and to customize.

I resolved, after creating two CSS classes:

/* Hide element from English and Italian language */
.hideEn:lang(en) {display: none !important;}
.hideIt:lang(it) {display: none !important;}

And so my slide became:

 <div class="slider-item">
    <div class="slider-img">
        <img src="../sites/default/files/banner_from_remote_to_local.jpg" alt="slider" />
    </div><!-- end slider-img one -->
    <div class="slider-text-container">
        <div class="container">
            <div class="slider-text">
                <h1 class="hideIt layer1">How to copy a Drupal website from remote to local</h1>
                <p class="hideIt layer2">Generally speaking, it is the opposite, because people need to port online their website after creating it in a private environment. But it happened in 2017 and I removed it from my computer after installing a new operating system. Recently I have discovered that the support of my Drupal 8 site will end in November 2, 2021 and I have a lot of incompatibilities with Drupal 9x.  So I have to fix them in order to migrate to the new main release of Drupal. This article is born to describe the process that I followed to do the copy of my site and make it run on my computer.</p>
                <div class="hideIt layer3"><a class="button" href="/en/copy-drupal-remote-to-local">read more</a></div>
                <h1 class="hideEn layer1">Come copiare in locale il proprio sito online di Drupal </h1>
                <p class="hideEn layer2">In generale è sempre il contrario, perché si desidera portare online il proprio sito Web dopo averlo creato e modificato a piacimento in un ambiente privato. Ma questo succedeva nel 2017 e dopo non ho più avuto bisogno di tenermelo sul computer. Recentemente però ho scoperto che il supporto del mio sito Drupal 8 terminerà il 2 novembre 2021 e ho molte incompatibilità con la nuova versione 9x. Questo articolo nasce per descrivere il processo che ho seguito per fare la copia del mio sito e farlo girare di nuovo sul computer.</p>
                <div class="hideEn layer3"><a class="button" href="/it/come-copiare-drupal-da-remoto-a-locale">Maggiori informazioni</a></div>
            </div><!-- /.slider-text -->          
        </div><!-- /.container -->
    </div><!-- /.slider-text-container -->
</div><!-- end slider-item one -->

Modules

All the modules have a new version that supports Drupal 9.x, the bother is that you have to remove and install it again by hand (I can't use Composer or Drush). In the case of Video Filter and Header and Footer Scripts I have to patch them. I only made a mistake when deleting Footnotes, Mathjax and Video Filter (plugins of CKEditor) I lost also the text format used to add the content to my site. In a few words: my site became empty. I fixed this issue by recreating a new text format with the same name.

In the end, was it necessary to create a local version of my site?

I think that it was a useful choice, for three reasons:

  1. Apply the patch for two modules described above;
  2. Avoid to made catastrophic mistakes in the online version.
  3. Configure a version without touching the online.

PROS

  • The migration was easy and simple;
  • I suggest making a local version of your site in order to reduce the errors to zero.

CONS

  • Upgrade Status module is useless, for me the update.php page is enough.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Add new comment

The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Sponsored Links
Pubblicità

Nicola Rainiero

A civil geotechnical engineer with the ambition to facilitate own work with free software for a knowledge and collective sharing. Also, I deal with green energy and in particular shallow geothermal energy. I have always been involved in web design and 3D modelling.