{"id":60660,"date":"2024-03-05T10:47:20","date_gmt":"2024-03-05T05:17:20","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=60660"},"modified":"2024-03-07T13:29:53","modified_gmt":"2024-03-07T07:59:53","slug":"step-by-step-guide-to-upgrade-drupal-9-to-drupal-10","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/step-by-step-guide-to-upgrade-drupal-9-to-drupal-10\/","title":{"rendered":"Step-by-Step guide to upgrade Drupal 9 to Drupal 10"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">The process of upgrading a Drupal Project from 9 to 10 can be a bit of a challenging task. This blog covers the basic guidelines that will help you to upgrade major versions of simple or complex projects.<\/span><\/p>\n<h2>\u00a0 1. Check for pre-requisites<\/h2>\n<h3><strong>\u00a0 Platform requirements:\u00a0<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">\u00a0Drupal 10 requires PHP 8.1+. These platform updates must be done before starting the upgrade process. Here is the overview of full requirements for php, server, database etc &#8211; <\/span>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<a href=\"https:\/\/www.drupal.org\/docs\/getting-started\/system-requirements\"><span style=\"font-weight: 400;\">https:\/\/www.drupal.org\/docs\/getting-started\/system-requirements<\/span><\/a><span style=\"font-weight: 400;\">\u00a0<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-60637 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/Screenshot-from-2024-02-29-12-09-22.png\" alt=\"\" width=\"711\" height=\"333\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/Screenshot-from-2024-02-29-12-09-22.png 711w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/Screenshot-from-2024-02-29-12-09-22-300x141.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/Screenshot-from-2024-02-29-12-09-22-624x292.png 624w\" sizes=\"(max-width: 711px) 100vw, 711px\" \/><\/p>\n<h3><strong>\u00a0Drush version:<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">\u00a0If you have Drush installed, you must check the <\/span><a href=\"https:\/\/www.drush.org\/12.x\/install\/#drupal-compatibility\"><span style=\"font-weight: 400;\">recommended version<\/span><\/a><span style=\"font-weight: 400;\">. <\/span><span style=\"font-weight: 400;\">Drupal 10 requires drush 11 or later. Following is the command you can follow to install Drush 11\u00a0 &#8211;\u00a0<\/span><\/p>\n<pre><span style=\"font-weight: 400;\"> composer require 'drush\/drush:^11' -W<\/span><\/pre>\n<p><b>\u00a0TIP<\/b><span style=\"font-weight: 400;\">: Some developers prefer to remove it temporarily and reinstall it later.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60638 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade_drush_short.png\" alt=\"\" width=\"885\" height=\"451\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade_drush_short.png 885w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade_drush_short-300x153.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade_drush_short-768x391.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade_drush_short-624x318.png 624w\" sizes=\"(max-width: 885px) 100vw, 885px\" \/><\/p>\n<h2>\u00a0 \u00a02. Preparation for the D10 upgrade<\/h2>\n<h3><strong>\u00a0Install <a href=\"https:\/\/www.drupal.org\/project\/upgrade_status\">Upgrade Status<\/a> module<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">This provides a good overview of the site\u2019s upgrade health and helps to check the deprecations and compatibility of contrib modules\/projects. Following are the commands to install and enable this module:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">composer require 'drupal\/upgrade_status:^4.1'\r\n<\/span><span style=\"font-weight: 400;\">drush en upgrade_status<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Review the report at page &#8211; <\/span><span style=\"font-weight: 400;\">\/admin\/reports\/upgrade-status<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60639 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgradestatus_start.png\" alt=\"\" width=\"1912\" height=\"891\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgradestatus_start.png 1912w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgradestatus_start-300x140.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgradestatus_start-1024x477.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgradestatus_start-768x358.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgradestatus_start-1536x716.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgradestatus_start-624x291.png 624w\" sizes=\"(max-width: 1912px) 100vw, 1912px\" \/><\/p>\n<p><strong>Update the entire site (core and contrib modules) to the latest version of 9.4 or, at best 9.5.<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">You can manually edit the composer.json file and update the version for Drupal\/core-* packages to recommended version (eg 9.5.11) and then run the following command to update all modules to their latest d9 release &#8211;\u00a0<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">composer update --with-all-dependencies\r\n<\/span><span style=\"font-weight: 400;\">drush updb<\/span>\r\n<span style=\"font-weight: 400;\">drush cr<\/span><\/pre>\n<p><span style=\"font-weight: 400;\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60640 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/9.5update.png\" alt=\"\" width=\"1920\" height=\"1080\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/9.5update.png 1920w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/9.5update-300x169.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/9.5update-1024x576.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/9.5update-768x432.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/9.5update-1536x864.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/9.5update-624x351.png 624w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/>\u00a0 \u00a0 \u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now ensure that the site is working properly.<\/span><\/p>\n<h3><strong>\u00a0Deal with all the <a href=\"https:\/\/www.drupal.org\/docs\/core-modules-and-themes\/deprecated-and-obsolete#s-recommendations-for-deprecated-themes\">deprecated modules or themes<\/a> being used in your site.<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 Core Modules removed from d10 are &#8211;<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Aggregator<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">CKEditor (CKEditor5 now)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Color<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">HAL<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Quick Edit<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">RDF<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 Core Themes removed from D10 are &#8211;<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Bartik<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Classy<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Seven<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Stable<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">There are three options to deal with these: &#8211;\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Option 1.<\/strong> Simply uninstall it if not of any use on your site.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Option 2.<\/strong> Switch to the different supported projects if available in core. E.g. change Bartik to Olivero, seven to Claro, ckeditor to ckeditor5<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>Option 3.<\/strong> If you can\u2019t uninstall\/switch, Install the corresponding contributed version from drupal.org<\/span><\/p>\n<p><span style=\"font-weight: 400;\">E.g. If you have a custom or contributed theme that depends on classy(removed from d10 core), install the contributed Classy theme with Composer:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">composer require \u201cdrupal\/classy:^1.0\u201d<\/span><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60641 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/getclassy.png\" alt=\"\" width=\"1243\" height=\"564\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/getclassy.png 1243w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/getclassy-300x136.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/getclassy-1024x465.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/getclassy-768x348.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/getclassy-624x283.png 624w\" sizes=\"(max-width: 1243px) 100vw, 1243px\" \/><\/p>\n<h2><strong>CKEditor migration from 4 to 5<\/strong><\/h2>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Turn on CKEditor5.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Ensure that your CKEditor plugins have CKEditor 5 versions (or remove those that don&#8217;t)<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Navigate to Content Authoring&gt; Text Formats and Editors using the admin menu. In the column Text Editor, you can tell which text formats use CKEditor.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">For each text format that uses CKEditor, select Configure. Under Text editor, select CKEditor You can see status messages letting you know what has changed.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Do the above steps for all the text formats using CKEditor.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Check that CKEditor 5 is working ok and uninstall CKEditor.<\/span><\/li>\n<\/ul>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60642 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/ckeditor5.png\" alt=\"\" width=\"1852\" height=\"862\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/ckeditor5.png 1852w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/ckeditor5-300x140.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/ckeditor5-1024x477.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/ckeditor5-768x357.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/ckeditor5-1536x715.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/ckeditor5-624x290.png 624w\" sizes=\"(max-width: 1852px) 100vw, 1852px\" \/><\/p>\n<h3><strong>Deal with the \u201cRemove\u201d section on the Upgrade status page (\/admin\/reports\/upgrade-status).<\/strong><\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60643 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/removesection.png\" alt=\"\" width=\"1429\" height=\"617\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/removesection.png 1429w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/removesection-300x130.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/removesection-1024x442.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/removesection-768x332.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/removesection-624x269.png 624w\" sizes=\"(max-width: 1429px) 100vw, 1429px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">To remove uninstalled modules\/themes, simply remove their entries from composer.json file and run the composer update, OR you can run the composer remove command for each.<\/span><\/p>\n<p><b>Note<\/b><span style=\"font-weight: 400;\">: If this list has some module\/theme that is absent in composer.json, then you will need to remove it manually from the filesystem.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\"><strong>Deal with the \u201cUpdate\u201d section on the Upgrade status page.<\/strong><\/span><\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60644 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade_status_update_section.png\" alt=\"\" width=\"1416\" height=\"546\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade_status_update_section.png 1416w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade_status_update_section-300x116.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade_status_update_section-1024x395.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade_status_update_section-768x296.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade_status_update_section-624x241.png 624w\" sizes=\"(max-width: 1416px) 100vw, 1416px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Ensure all the contrib modules\/themes\/profiles are at the latest D10 stable release. Simply run the composer require command to fetch the latest version of the D10 stable release. Eg:-<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">composer require 'drupal\/acquia_search:^3.1' -W <\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Once this step is repeated for all the modules here and scanned again, nothing will be left in this section.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\"><strong>Deal with the modules in \u201cCollaborate with maintainer\u201d section with no D10 compatible release available on drupal.org.<\/strong><\/span><\/h3>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60645 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/collaborate_section.png\" alt=\"\" width=\"1715\" height=\"732\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/collaborate_section.png 1715w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/collaborate_section-300x128.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/collaborate_section-1024x437.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/collaborate_section-768x328.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/collaborate_section-1536x656.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/collaborate_section-624x266.png 624w\" sizes=\"(max-width: 1715px) 100vw, 1715px\" \/><\/p>\n<ul>\n<li><span style=\"font-weight: 400;\">Ensure from the drupal.org project page that this is the latest D10-compatible version module. If not, run composer require &amp; drush updb.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">Otherwise, Lookout for a patch in the issue queue for D10 compatibility or create your own patch. Install cweagans plugin and add a compatibility patch in composer.json.\u00a0<\/span><\/li>\n<\/ul>\n<pre><span style=\"font-weight: 400;\">composer require cweagans\/composer-patches<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Install the composer <\/span><a href=\"https:\/\/github.com\/mglaman\/composer-drupal-lenient\"><span style=\"font-weight: 400;\">lenient<\/span><\/a><span style=\"font-weight: 400;\"> plugin and add the patched module to the allowed list so that the composer can accommodate it for the D10 upgrade. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">For this, run the install command and specify the required module (eg drush_delete):-\u00a0<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">composer require mglaman\/composer-drupal-lenient\r\n<\/span><span style=\"font-weight: 400;\">composer config --merge --json extra.drupal-lenient.allowed-list '[\"drupal\/drush_delete\"]<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">After running the above commands, the lenient section will be added in composer.json :-<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60646 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/lenient.png\" alt=\"\" width=\"849\" height=\"232\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/lenient.png 849w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/lenient-300x82.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/lenient-768x210.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/lenient-624x171.png 624w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/p>\n<p><span style=\"font-weight: 400;\"><b>Tip<\/b><\/span><span style=\"font-weight: 400;\">: Be sure you have added ALL patched modules to composer-drupal-lenient. <\/span><span style=\"font-weight: 400;\">If you miss even one, the composer will skip all of your requests for leniency, which can be very confusing.<\/span><\/p>\n<h3><strong>Deal with the modules which don&#8217;t have a single release compatible with both D9 &amp; D10\u00a0<\/strong><\/h3>\n<p><span style=\"font-weight: 400;\">To resolve this, Composer require both versions required by D9 as well as D10 to allow the module to be automatically upgraded when you upgrade Drupal core. Eg-\u00a0<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">composer require drupal\/csv_serialization:^3.0 || ^4.0<\/span><\/pre>\n<h3><strong>\u00a0 Update custom modules &amp; themes in the \u201cScan\u201d section<\/strong><\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Update the version requirement in info.yml file of all these modules for D10 compatibility.\u00a0<\/span><\/li>\n<\/ul>\n<pre><span style=\"font-weight: 400;\">Eg: \r\n<\/span><span style=\"font-weight: 400;\">Change from <\/span><em>\r\n<span style=\"font-weight: 400;\">core_version_requirement: <\/span><span style=\"font-weight: 400;\">^9\r\n<\/span><\/em><span style=\"font-weight: 400;\">To<\/span><em><span style=\"font-weight: 400;\">\r\nc<\/span><span style=\"font-weight: 400;\">ore_version_requirement: <\/span><span style=\"font-weight: 400;\">^9 || ^10<\/span><\/em><\/pre>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Scan all items and resolve the deprecation errors either manually as per the suggestions or using the Drupal rector plugin.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">To minimize the manual efforts, install the rector plugin for automatic fixing of deprecated code:\u00a0<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">composer require --dev palantirnet\/drupal-rector<\/span>\r\n<span style=\"font-weight: 400;\">cp vendor\/palantirnet\/drupal-rector\/rector.php .<\/span>\r\n<span style=\"font-weight: 400;\">vendor\/bin\/rector process modules\/custom\/[MODULE\/THEME_NAME] --dry-run<\/span><\/pre>\n<p><b>Note<\/b><span style=\"font-weight: 400;\">: Run without \u201c&#8211;dry-run\u201d once you have looked into what changes would be made.<\/span><\/p>\n<h2><b>3. Start the D10 upgrade<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">By now, the site should be ready for the D10 update. You can verify this from the readiness percentage shown on the Upgrade status page.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60648 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade100.png\" alt=\"\" width=\"1853\" height=\"483\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade100.png 1853w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade100-300x78.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade100-1024x267.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade100-768x200.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade100-1536x400.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/upgrade100-624x163.png 624w\" sizes=\"(max-width: 1853px) 100vw, 1853px\" \/><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Edit composer.json file and update the version for Drupal\/core-* packages to ^10 (or any specific D10 version you want Eg 10.1.8).<\/span><\/li>\n<\/ul>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60651 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/10.1_short.png\" alt=\"\" width=\"763\" height=\"332\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/10.1_short.png 763w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/10.1_short-300x131.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/10.1_short-624x272.png 624w\" sizes=\"(max-width: 763px) 100vw, 763px\" \/><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Test the update before performing the actual update:<\/span><\/li>\n<\/ul>\n<pre><em><span style=\"font-weight: 400;\">composer update --with-all-dependencies --dry-run\r\n<\/span><\/em><\/pre>\n<p><em><span style=\"font-weight: 400;\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60653 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/updatedryrun10.1.png\" alt=\"\" width=\"1048\" height=\"977\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/updatedryrun10.1.png 1048w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/updatedryrun10.1-300x280.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/updatedryrun10.1-1024x955.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/updatedryrun10.1-768x716.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/updatedryrun10.1-624x582.png 624w\" sizes=\"(max-width: 1048px) 100vw, 1048px\" \/><\/span><\/em><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">If it fails, run the following command to check for dependencies prohibiting the upgrade:<\/span><\/li>\n<\/ul>\n<pre><em><span style=\"font-weight: 400;\">composer why-not drupal\/core ^10<\/span><\/em><strong> OR <\/strong><em><span style=\"font-weight: 400;\">composer update \"drupal\/core:^10\" -W --dry-run<\/span><\/em><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60658 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/update_dryrun_fail.png\" alt=\"\" width=\"1364\" height=\"821\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/update_dryrun_fail.png 1364w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/update_dryrun_fail-300x181.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/update_dryrun_fail-1024x616.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/update_dryrun_fail-768x462.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/update_dryrun_fail-624x376.png 624w\" sizes=\"(max-width: 1364px) 100vw, 1364px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Once the issue is identified, resolve it and again run the test update command until it runs successfully.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Run the actual update without dry run flag, run database updates, and clear the cache.<\/span><\/li>\n<\/ul>\n<pre><em><span style=\"font-weight: 400;\">composer update --with-all-dependencies <\/span><\/em>\r\n<em><span style=\"font-weight: 400;\">drush updb<\/span><\/em>\r\n<em><span style=\"font-weight: 400;\">drush cr<\/span><\/em><\/pre>\n<p><span style=\"font-weight: 400;\">And the site is now fully upgraded to the Drupal 10 version !!<\/span><\/p>\n<h2><b>Patch verification.<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Verify that all old patches added in composer.json file have been applied successfully.<\/span><\/p>\n<h2><b>Remove <\/b><a href=\"https:\/\/www.drupal.org\/node\/3158256\"><b>jquery dependency on once<\/b><\/a><b> as it is removed from the D10 core.<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Find every call of jquery.once() in custom modules\/themes and update it with the new javascript once function. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Alos if you have any dependency on core\/jquery.once library in your libraries.yml file, switch it with the core\/once library.<\/span><\/p>\n<p><b>Tip<\/b><span style=\"font-weight: 400;\">: Turn off the aggregation first if it&#8217;s enabled before doing this step.<\/span><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-60659 size-full\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/03\/once_sheet.png\" alt=\"\" width=\"1215\" height=\"803\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/03\/once_sheet.png 1215w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/once_sheet-300x198.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/once_sheet-1024x677.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/once_sheet-768x508.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/03\/once_sheet-624x412.png 624w\" sizes=\"(max-width: 1215px) 100vw, 1215px\" \/><\/p>\n<h2><b>Test the entire website<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Check all the features and ensure the site is working properly. On every page load in the browser, look at Drupal logs for errors and\/or warnings. Also, look in the browser console for any errors. Fix them as needed.<\/span><\/p>\n<h2><b>Some Common php errors faced due to incompatible php code:<\/b><\/h2>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">-&gt;<\/span><a href=\"https:\/\/www.drupal.org\/node\/3201242\"><span style=\"font-weight: 400;\">accessCheck<\/span><\/a><span style=\"font-weight: 400;\">() must now be explicitly specified while using content entity query.<\/span><\/li>\n<li style=\"font-weight: 400;\"><a href=\"https:\/\/www.drupal.org\/node\/3256890\"><span style=\"font-weight: 400;\">Twig output <\/span><\/a><span style=\"font-weight: 400;\">using {% spaceless %} is changed to {% apply spaceless %}.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Support for the \u201cif\u201d clause removed from \u201cfor\u201d statements in twig files.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Test setUp() methods need a void return type (i.e. protected function setUp(): void<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Fix these issues as per the suggestions in change records.<\/span><\/p>\n<h2><b>Some issues faced during the upgrade process:\u00a0<\/b><\/h2>\n<ol>\n<li><span style=\"font-weight: 400;\">If composer update results in error, &#8220;<\/span><i><span style=\"font-weight: 400;\">Your requirements could not be resolved to an installable set of packages<\/span><\/i><span style=\"font-weight: 400;\">.&#8221;. There can be two reasons for this:-<\/span><\/li>\n<\/ol>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">One or more of your contributed modules isn&#8217;t D10 compatible. To resolve this, Identify the culprit module in the composer error, visit the project page, look for the latest D10 stable release, and install it. Eg<\/span><\/li>\n<\/ul>\n<pre><span style=\"font-weight: 400;\"><em>composer require drupal\/MODULE_NAME:^2.0.0-rc1 --no-update<\/em><\/span><\/pre>\n<ul>\n<li><span style=\"font-weight: 400;\">Some of your project dependencies are not up-to-date to their latest version for core updates. To resolve this, follow the steps <\/span><a href=\"https:\/\/www.drupal.org\/docs\/upgrading-drupal\/upgrading-from-drupal-8-or-later\/how-to-upgrade-from-drupal-9-to-drupal-10#common-issues\"><span style=\"font-weight: 400;\">here<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 2. <\/span><span style=\"font-weight: 400;\">Some utilities like Drupal console or drush might hinder the core upgrade process. To resolve this, you can remove it altogether before the update and reinstall after the update. Eg<\/span><\/p>\n<pre><em><span style=\"font-weight: 400;\">composer remove drupal\/console --no-update<\/span><\/em>\r\n<em><span style=\"font-weight: 400;\">composer remove drush\/drush --no-update<\/span><\/em><\/pre>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0 3. If you use the module <\/span><a href=\"https:\/\/www.drupal.org\/project\/advagg\"><span style=\"font-weight: 400;\">Advagg<\/span><\/a><span style=\"font-weight: 400;\">, entire JS might break on your site after the D10 upgrade.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">One of the possible reasons is using Jsqueeze for minifying JS. Switch it to Jshrink or another mode as <\/span><a href=\"https:\/\/www.drupal.org\/project\/advagg\/issues\/3263702\"><span style=\"font-weight: 400;\">Jsqueeze is abandoned now<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h2><strong>\u00a0<\/strong><strong>Conclusion<\/strong><\/h2>\n<p>Through this blog, we learnt how to make things D10 compatible while still using Drupal 9.\u00a0 This included examining custom and contributed modules for compatibility. Once everything is ready, we upgraded the Drupal core. We also shared a few common problems faced during the upgrade and their solutions.<\/p>\n<p><span style=\"font-weight: 400;\">Hope that now you don\u2019t find this process that tough next time. <\/span>Check out our other blog posts for more insights.<\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>The process of upgrading a Drupal Project from 9 to 10 can be a bit of a challenging task. This blog covers the basic guidelines that will help you to upgrade major versions of simple or complex projects. \u00a0 1. Check for pre-requisites \u00a0 Platform requirements:\u00a0 \u00a0Drupal 10 requires PHP 8.1+. These platform updates must [&hellip;]<\/p>\n","protected":false},"author":1087,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":165},"categories":[3602],"tags":[5695,4862,5253,5691],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/60660"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1087"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=60660"}],"version-history":[{"count":12,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/60660\/revisions"}],"predecessor-version":[{"id":60679,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/60660\/revisions\/60679"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=60660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=60660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=60660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}