Posted on
Using Composer to Upgrade to Drupal 8.8

Drupal 8.8 brings some changes to Drupal's update system. For the first time, composer is the default method for updating - if you've got sites set up using expanded file sets, now is the time to make the switch to a composer setup.

There are also a few 'gotchas' to be navigated along the way, here is a rundown of our recipe for a safe and happy update experience.

If you are switching from a non-composer setup to a composer setup, your first action is to create a new site using composer

> composer create-project --prefer-dist drupal/recommended-project my_site_name_dir

this uses the latest Drupal recommended project composer.json file

Next change the 'web' directory to be 'public_html' - so that you can deploy the site easily, assuming that your web directory on your live server is called 'public_html'. Then do a composer update

> composer update

Copy your themes, files and libraries directories over to the new site

Next add all of the modules to your new site, in a terminal window, navigate to your old site's module directory and type:

> ls > file.txt

this puts all of the contents of that directory into a text file. You can easily manipulate into the format

> composer require drupal/module1 drupal/module2

If you need specific versions of modules you can specifically require them separately

Now enable the backup and migrate module and restore from a backup. Piece of cake!

Tags

Add new comment

Request a Free Quotation

Your Name