1. Prepare for upgrade

2. Upgrade on your local

3. Deploy to Pantheon

4. Upgrade to integrated composer

In a nutshell you need only 2 changes to upgrade to integrated composer: pantheon.upstream.yml and upstream-configuration folder

pantheon.upstream.yml may look something like the following

api_version: 1
web_docroot: true
# See https://pantheon.io/docs/pantheon-yml/#enforce-https--hsts for valid values.
enforce_https: full+subdomains
php_version: 7.4
database:
  version: 10.4
drush_version: 10
build_step: true
protected_web_paths:
  - /private/
  - /sites/default/files/private/
  - /sites/default/files/config/

Feel free to update pantheon.yml file to remove any non-required values that are duplicated in this new file. Make sure you keep api_version: 1 in both.

In the root of your project on the same level as your web root create a folder upstream-configuration. It will host 2 files: .gitignore and composer.json

Your composer.json in that folder may look something like that as a starter point

{
    "name": "pantheon-upstreams/upstream-configuration",
    "type": "project",
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "php": ">=7.3",
        "composer/installers": "^1.8",
        "drupal/core-composer-scaffold": "^9",
        "drupal/core-recommended": "^8.8 || ^9",
        "pantheon-systems/drupal-integrations": "^8 || ^9",
        "cweagans/composer-patches": "^1.0",
        "zaporylie/composer-drupal-optimizations": "^1.2"
    }
}

And .gitignore

composer.lock
/vendor/
.csslintrc
.editorconfig
.eslintignore
.eslintrc.json
.gitattributes
.ht.router.php
.htaccess
INSTALL.txt
README.txt
autoload.php
example.gitignore
index.php
robots.txt
update.php
web.config

In the CircleCI config keep the theme compilation - node related options in the CI.

Remove composer related config from the CI.

Add vendor directory to .gitignore-deploy file.

Commit to the same environment and you should have the site building with integrated composer. Test it on multidev, then deploy to dev.

Official Pantheon documentation: https://pantheon.io/docs/guides/drupal-9-migration


Review History

Who

When

Status

Bob

20230530

Current