Opigno LMS User manual
Upgrade to 3.2.x release (Drupal 10)
Preliminary considerations
The primary step to updating opigno_lms to the Drupal 10 version is to prepare the root composer.json and the custom modules for the update.
The best practice notes:
Create a backup of the database
Make sure that your server meets this requirement before you start the upgrade process. The server must use >= PHP 8.1
This manual will describe a brief list of steps.
In your composer.json, update to the latest version, usually ~3.1.0.
As a second step, Opigno LMS and all modules can be updated to >= 3.2.7.
Step 1: Prepare for update to the Drupal 10 version
Create a backup of the database and ensure that the PHP version and libraries are up to date and supported by Drupal.
Before updating to OpignoLMS 3.1.3, prepare the
drupal/color
module for the update. Refer to the Preparing drupal/color module for update section for guidance.Change "opigno/opigno_lms": "~3.1.0" in require section. OpignoLms 3.1.3 update requires the group module to be updated to version 1.5 so that it can be upgraded to Drupal 10. This change won't affect any existing content and will simplify updating existing sites. Please note that the group entity will become revisionable after the update from version 1.2 to 1.5. While we don't anticipate any issues, it's recommended that you double-check to ensure that the update has been completed properly.
Resolve all dependencies before upgrading to Drupal 10 and OpignoLms. Note that Opigno_lms >= 3.2.x only supports Drupal 10 (after Drupal 9 became deprecated).
Install the Upgrade Status module to check if the site is ready to update.
composer require drupal/upgrade_status
After this, on the page Reports > Upgrade status, you will be able to check what needs to be changed before moving the site to the Drupal 10 version.Report example:
The opigno_lms modules will be updated in a few steps when the version is switched to >=3.2.7
The main issues that need to be fixed:
The version of the Drupal core should be at least >=9.4.x <= 9.5.x (the latest version of Drupal 9 is recommended).
Check if all extra contrib modules (if they exist) are updated to the versions compatible with Drupal 10 and update them if needed using composer.
To check if all custom modules and themes (if they exist) are ready for this, select the list of modules and press the Scan selected button at the bottom of the page.
You need to ensure that:
There is no deprecated code.
All info.yml files are updated (should be - core_version_requirement: ^9 || ^10).
jQuery .once() function is changed to default JS once() everywhere.
Example:
$(‘.some-selector’, context).once(‘someOnceClick’).click(...)
needs to be changed to
$(once(‘someOnceClick’, ‘.some-selector’, context)).click(...)
Uninstall the next list of core modules (as these were removed from Drupal 10):
Aggregator
Color
HAL
Quick Edit
RDF
Switch the CKEditor module to CKEditor 5:
Enable the CKEditor 5 module.
Go to the page /admin/config/content/formats.
Select CKEditor 5 for all text formats that use CKEditor.
Disable the old CKEditor module.
Uninstall the following list of core themes:
Bartik
Classy
Seven
Stable
Step 2: Update to Opigno LMS based on Drupal 10
Only after all preparatory work has been completed the switch to the new Opigno LMS based on Drupal 10 can be done.
Uninstall and remove the Upgrade Status module.
Before updating to OpignoLMS 3.2.x, prepare the
drupal/color
module for the update. Refer to the Preparing drupal/color module for update section for guidance.Change "opigno/opigno_lms": "~3.1.0" in require section to "opigno/opigno_lms": "~3.2.7".
To the composer.json directory, you need to add an auth.json file.
Then run the composer update.
When composer update is done, run drush updb -y or use url your-site.com/update.php.
In the end, clear the cache drush cr and do the global testing of all functionality.
Troubleshooting
Troubleshooting 1:
If your project uses modules that cannot be updated or whose Drupal 10 version has not been released, you can use this workaround solution to fix it.
On http://drupal.org, find patches that prepare the module for Drupal 10 (or create a custom patch) and add them to the composer.json file.
Add a list of similar modules as an allowed list inside the "extra" section:
"extra": {
"drupal-lenient": {
"allowed-list": [
"drupal/some_module",
"drupal/example_module"
]
},
Troubleshooting 2:
If the preparation process was not done properly, you can see notices like:
Module SOME_MODULE has an entry in the system.schema key/value storage but is missing from your site.
To resolve it, use the next command:
drush php-eval "\Drupal::keyValue('system.schema')->delete('SOME_MODULE');"
Preparing drupal/color module for update:
There are two possible solutions for updating this module:
If the deployments for versions 3.1.3 and 3.2.x are scheduled within the same maintenance window:
Before updating to 3.1.3: Execute the command
composer require "drupal/color:1.0.3 as 2.x-dev"
. If the patch for the drupal/color module fails to apply, it can be ignored, as it will be removed in version 3.2.x.After updating to 3.1.3: Remove the line
"drupal/color": "1.0.3 as 2.x-dev"
and proceed with the update to version 3.2.x.
If the maintenance windows for the 3.1.3 and 3.2.x deployments differ:
Before updating to 3.1.3: Execute the following commands:
composer require mglaman/composer-drupal-lenient composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/color"]' composer require "drupal/color:2.x-dev#7486851 as 2.x-dev"
Before updating to 3.2.x: Remove the line
drupal/color:2.x-dev#7486851 as 2.x-dev
and thedrupal-lenient
section from the maincomposer.json
file.After upgrading to 3.2.x: Remove the
mglaman/composer-drupal-lenient
package.
Copyright 2008-2024 Connect-i. All Rights Reserved - https://www.opigno.org