Updates in Drupal
General knowledge of Drupal updates
What are Drupal updates? We'll be talking a little technical, but not too much.
The different types of release
Drupal releases for the core, modules and contributing themes receive different types of updates:
- Security updates: a priority,
- Functional updates, which allow the module to evolve,
- Technical updates: often not visible, these are the patches received in the "issues" lists on drupal.org: https://www.drupal.org/project/issues/

Drupal core update
Since Drupal 8, the core of Drupal is based on Symfony. Modules are sometimes dependent on libraries stored in Vendor (PHP) or Libraries(Javascript).
Processes have become more professional. Downloads are no longer manual. The Composer tool is used to install modules and dependencies. Drupal documentation helps with version or global updates. Each release suggests the command line to execute. List of Drupal releases: https://www.drupal.org/project/drupal/releases.
Executing the command via Composer automatically imports the Drupal core, containing the core modules and the associated JS (libraries) and PHP (vendor) libraries. The former are stored in the libraries directory, the latter in the vendor directory.
After updating the Drupal core, it is necessary to update the database and clear the caches.
This second step is performed by drush commands:
drush updb
drush cr
The heart receives a security update about once a month.

Update contribution modules
As with importing the Drupal core, each contribution module is imported using the command composer update drupal/<module>
composer require drupal/<module>
It can happen that module versions are incompatible and require time to investigate the libraries in place, but overall, updating on the Drupal side is fluid.
From a functional point of view, contribution modules sometimes evolve. These cases require investigation and sometimes reconfiguration, or even adaptation of the associated custom modules.
After updating the modules, the database structure and caches can be updated:
Drush updb
Drush cr
Important note: updates are first tested in development environments,to be distinguished from test and production environments.

Update entities
On rare occasions, the Drupal status report may inform you of an entity update. In this case, you need to temporarily activate the Devel module that provides the tools. This operation must be performed in all environments.
In the development environment, open the command terminal and navigate to the site directory containing the composer.json and composer.lock files.
Execute the following commands:
- Import of the Devel module:
composer require drupal/devel
- Installing the module in Drupal
drush en devel
- Execute entity update command:
drush entup
- Uninstalling the Devel module:
drush pmu devel
- Devel package removed:
composer remove drupal/devel

Functional testing
The functionality of your site must not have changed between 2 releases of the Drupal core.
It is necessary to check any changes in module configuration and the correct operation of the site in the development and/or test environment before deployment, using non-regression tests. Ideally, non-regression tests should be automated so that they can be run before each deployment.
In cases where automated tests have not been developed, it is necessary to :
- navigate the site, both desktop and responsive,
- add, modify content,
- submit forms.
During these tests, logs should be activated to capture any PHP or module error messages.

The importance of backup
Before any deployment, the production project must be backed up: tree and database backup.
This backup must be able to be restored in the event of a problem after deployment.

Rolling out the update
Deployment involves transferring the update to production servers (hosting).
It can be carried out by automated deployment tools or manually via FTP/SSH file transfer protocols.