Preparations for upgrading your Developer Portal to Drupal 11

Make all the custom modules and themes in your Developer Portal are Drupal 11 compatible before you start the upgrade process.

If your Developer Portal contains custom modules and themes that are written by yourself or downloaded from elsewhere, ensure that they are Drupal 11 compatible before you start the upgrade process. This action can help create a seamless IBM® API Connect upgrade experience. For more information about your modules and themes compatibility, download the Upgrade status module from Upgrade status in the Drupal documentation.

Note: Before you start the upgrade, check the status of your modules and themes and if they are in use. Remove the ones that you do not use.
For more information about how to prepare your Developer Portal for the Drupal 11 upgrade, see the following steps:
  1. Installing the upgrade status module
  2. Upgrading your module to be Drupal 11 compatible
  3. Import your module into your Developer Portal
  4. Verifying that your module is Drupal 11 compatible

Installing the upgrade status module

  1. Log in to your Developer Portal as the administrator.
  2. Install the Upgrade Status module. For more information about how to install the Upgrade Status, see Installing custom modules.
  3. When you finish your Upgrade Status installment, click Admin > Reports > Upgrade-status.

    Drupal 11 upgrade status page

    You can ignore the Drupal core and hosting environment section as this area is managed by IBM API Connect and gets resolved when the upgrade is complete.
    Important: Your custom modules and themes must be PHP 8.3 compatible before you upgrade to Drupal 11, and you are responsible for doing the upgrade.

    The list of projects displayed on the Drupal 11 upgrade status page are the ones that are not compatible with Drupal 11. The Upgrade status module categorizes these projects into different sections. For example, Remove, Update, Collaborate with maintainers.

    Note: When you upgrade IBM API Connect, the Drupal 11 compatibility is automatically given to the modules and themes that you have not created or installed manually.
  4. If you find your custom modules and themes on the Drupal 11 upgrade status page, select your custom modules and themes and then click Scan selected to reveal what changes are needed to make them Drupal 11 compatible. If your custom module or theme requires updates, you see a link to the corresponding themes or custom modules once the scan completed. For example, the following image demonstrates the process of scanning an installed custom module, named Masonry API.
    Note: For the Upgrade status module to identify all the Drupal 11 compatibility issues in your custom modules and themes, you must enable the custom modules and themes before scanning it.

    A screen capture showing your custom module and themes that require a change

  5. Click Export as HTML to get a clear view.

    A screen capture of upgrade status report

  6. Add the new version in the info.yml file and change the code for the deprecated functions to upgrade your module and make it compatible with Drupal 11.
  7. When your module becomes compatible with Drupal 11, import your updated module by reinstalling it using the Developer Portal UI. For more information about how to install custom modules, see Installing custom modules.
  8. Return to Upgrade status report page and rescan the module to verify that your module is Drupal 11 compatible.

Upgrading your module to be Drupal 11 compatible

This module is an example of how you can read the report and fix your code to make it compatible with Drupal 11.

  1. Add the new version into the info.yml file. Keep Drupal/Core/Extension/Extension List as it is still present in Drupal 9 and Drupal 10, and add on support for Drupal 11.
    Note: If any custom modules use deprecated APIs that are not compatible with Drupal 11, it is your responsibility to make it compatible with Drupal 11.
  2. When you make a change to the module, modify the version number as shown in the following example.

    Before

     name: 'IBM APIC Portal - custom icons'
    type: module
    description: 'IBM API Connect Developer Portal tutorial - Example of custom product icons'
    package: 'Custom'
    core_version_requirement: ^9 || ^10
    version: 1.0.1
    project: 'custom_icons'
    dependencies:
      - ibm_apim

    After

    name: 'IBM APIC Portal - custom icons'
    type: module
    description: 'IBM API Connect Developer Portal tutorial - Example of custom product icons'
    package: 'Custom'
    core_version_requirement: ^9 || ^10 || ^11
    version: 1.0.2
    project: 'custom_icons'
    dependencies:
      - ibm_apim

Import your module into your Developer Portal

Import the module by using Developer Portal Toolkit CLI. For more information about how to use the Developer Portal CLI, see Getting started with the Portal CLI commands.

For example,

❯ apic login -s $SERVER -r provider/default-idp-2 -u steve Warning: Using default toolkit credentials. Enter your API Connect credentials Password? Logged into api.fyre-ci-134466-master.fyre.ibm.com successfully ❯ apic -s $SERVER -m portaladmin custom-module:create-import -o ibm -c api-connect-catalog-2 /tmp/custom_icons.zip Loading File (Large files may take a while)... 201 CREATED - Task ID: wp5fhmm9l74pmkw1 Response Code - 202: Message(s) - The status of this task is: QUEUED Response Code - 202: Message(s) - The status of this task is: RUNNING Response Code - 200: Message(s) - 2023-02-27 14:39:38: CLI task (custom_module:import) starting. 2023-02-27 14:39:40: Deleting existing custom module /var/aegir/platforms/devportal-9.x-10.0.5.2-20230105-1720/sites/ibm.api-connect-catalog-2.portal.fyre-ci-134466-master.fyre.ibm.com/modules/custom_icons 2023-02-27 14:39:40: Importing custom module custom_icons 2023-02-27 14:40:25: CLI task (custom_module:import) completed successfully.

Alternatively, import your updated module by installing it again using the Developer Portal UI. For more information about how to install custom modules, see Installing custom modules.

Verifying that your module is Drupal 11 compatible

The updated module is now imported into the Developer Portal. Return to the Upgrade status report page to rescan the module. When it becomes compatible with Drupal 11, it appears at the end of the page.

A screen capture of your updated module that's now compatible with Drupal 10.

Results

You used the Upgrade status module to identify and fix the Drupal 11 compatibility problems with your custom modules and themes. However, this process might not cover everything that you need to be ready for the upgrade to Drupal 11. Drupal 11 requires PHP 8.3, so you might need to change your custom modules and themes to support it. Remember to keep your custom modules and themes up to date, and to remove deprecated code within your own written custom modules and themes.