Drupal · template

Catch a replaced field in a Drupal config export

The image field became a media field with a new name. Every decoupled site had to follow.

Import your Drupal content model once, then get pass or fail for each change, with the name of every field that breaks. Recorded with Umami, the demo site that comes with Drupal core.

What you get

You import the configuration files of your content types once. After the next change, your assistant compares the new export with them and names each removed field, each changed type and each list that lost a value. The answer is a pass or a fail.

What we didWhat CoreModels answeredTime
Imported the files of 5 November 20191 type in the model7 s
Audited the files after the changefail: 1 error (a field was removed)2 s
Audited the first files againpass: 0 errors1 s

Recorded on 4 December 2026 with Umami, the demo site that comes with Drupal core (repository). In November 2019 its authors replaced field_image with the media field field_media_image on the recipe content type. Licence: GPL 2.0 or later; this page links to the files and does not copy them.

What you need

  • A CoreModels account with one project. Every plan starts with a 14-day free trial; a card is required to start.
  • An assistant that can use MCP servers, for example Claude Code or Cursor.
  • No Drupal login. CoreModels reads files from public links.

Run it

1. Connect your assistant

In Claude Code, run this command. Then sign in when it asks. This address can write to your projects, because an import creates a model.

claude mcp add --transport http coremodels https://go.coremodels.io/mcp-admin

Cursor, Claude Desktop and other clients: connect guide.

2. Import the version the site was built on

This is the content model of 5 November 2019, read from GitHub.

Create a CoreModels project named "Drupal example". Then call import_vendor_project on it with vendor "drupal" and these links in artifactUrls (name: link):
node.type.recipe.yml: https://raw.githubusercontent.com/drupal/drupal/f10a3971f2e71687f75d544f191c1a455d002b5c/core/profiles/demo_umami/config/install/node.type.recipe.yml
field.field.node.recipe.field_cooking_time.yml: https://raw.githubusercontent.com/drupal/drupal/f10a3971f2e71687f75d544f191c1a455d002b5c/core/profiles/demo_umami/config/install/field.field.node.recipe.field_cooking_time.yml
field.storage.node.field_cooking_time.yml: https://raw.githubusercontent.com/drupal/drupal/f10a3971f2e71687f75d544f191c1a455d002b5c/core/profiles/demo_umami/config/install/field.storage.node.field_cooking_time.yml
field.field.node.recipe.field_difficulty.yml: https://raw.githubusercontent.com/drupal/drupal/f10a3971f2e71687f75d544f191c1a455d002b5c/core/profiles/demo_umami/config/install/field.field.node.recipe.field_difficulty.yml
field.storage.node.field_difficulty.yml: https://raw.githubusercontent.com/drupal/drupal/f10a3971f2e71687f75d544f191c1a455d002b5c/core/profiles/demo_umami/config/install/field.storage.node.field_difficulty.yml
field.field.node.recipe.field_image.yml: https://raw.githubusercontent.com/drupal/drupal/f10a3971f2e71687f75d544f191c1a455d002b5c/core/profiles/demo_umami/config/install/field.field.node.recipe.field_image.yml
field.storage.node.field_image.yml: https://raw.githubusercontent.com/drupal/drupal/f10a3971f2e71687f75d544f191c1a455d002b5c/core/profiles/demo_umami/config/install/field.storage.node.field_image.yml

Your assistant calls create_project, then import_vendor_project. The answer we got:

import_vendor_project (part of the answer)

{
  "success": true,
  "vendor": "drupal",
  "datasetsAdded": 1,
  "nodesEnriched": 4,
  "errors": []
}

Your model has 1 type now. Each has its fields, with the type from Drupal.

3. Audit the newer version

In November 2019 its authors replaced field_image with the media field field_media_image on the recipe content type.

Now call audit_vendor_project on the same project with vendor "drupal" and the newer files in artifactUrls. Tell me the gate and list every Error:
node.type.recipe.yml: https://raw.githubusercontent.com/drupal/drupal/b3a5877a85102836514d17d6b41a9470430158ac/core/profiles/demo_umami/config/install/node.type.recipe.yml
field.field.node.recipe.field_cooking_time.yml: https://raw.githubusercontent.com/drupal/drupal/b3a5877a85102836514d17d6b41a9470430158ac/core/profiles/demo_umami/config/install/field.field.node.recipe.field_cooking_time.yml
field.storage.node.field_cooking_time.yml: https://raw.githubusercontent.com/drupal/drupal/b3a5877a85102836514d17d6b41a9470430158ac/core/profiles/demo_umami/config/install/field.storage.node.field_cooking_time.yml
field.field.node.recipe.field_difficulty.yml: https://raw.githubusercontent.com/drupal/drupal/b3a5877a85102836514d17d6b41a9470430158ac/core/profiles/demo_umami/config/install/field.field.node.recipe.field_difficulty.yml
field.storage.node.field_difficulty.yml: https://raw.githubusercontent.com/drupal/drupal/b3a5877a85102836514d17d6b41a9470430158ac/core/profiles/demo_umami/config/install/field.storage.node.field_difficulty.yml
field.field.node.recipe.field_media_image.yml: https://raw.githubusercontent.com/drupal/drupal/b3a5877a85102836514d17d6b41a9470430158ac/core/profiles/demo_umami/config/install/field.field.node.recipe.field_media_image.yml
field.storage.node.field_media_image.yml: https://raw.githubusercontent.com/drupal/drupal/b3a5877a85102836514d17d6b41a9470430158ac/core/profiles/demo_umami/config/install/field.storage.node.field_media_image.yml

Your assistant calls audit_vendor_project. The answer we got:

audit_vendor_project (part of the answer)

{
  "gate": "fail",
  "errorCount": 1,
  "warningCount": 0,
  "findings": [
    {
      "severity": "Error",
      "code": "field-removed",
      "subject": "recipe.field_image",
      "message": "Field is governed in CoreModels but no longer exists on the estate dataset."
    }
  ]
}

An audit only reads. The model still holds the first version.

4. Check that the gate also passes

A check that always fails is of no use. Audit the first version again.

Call audit_vendor_project again, this time with the first links. The gate must be pass.

Your assistant calls audit_vendor_project. The answer we got:

audit_vendor_project (part of the answer)

{
  "gate": "pass",
  "errorCount": 0,
  "warningCount": 0
}

Now with your own project

The YAML files from drush config:export. CoreModels reads the content types, the fields and the vocabularies and skips the rest. Run this, then give your assistant the prompt.

drush config:export --destination=./config-export
Create a CoreModels project for our Drupal content model. Import the node.type, field.field, field.storage and taxonomy.vocabulary files of our config export (config-export/*.yml) with import_vendor_project, vendor "drupal". Then audit the same files and show me the gate. Keep the project id: we will audit each later change against it.

In a pull request

This command gives the same answer without an assistant. It needs jq, a project id and an API key from Settings, API Keys. It ends with an error when the gate is fail, so a pull request check stops.

for f in config-export/{node.type,field.field,field.storage,taxonomy.vocabulary}.*.yml; do [ -f "$f" ] || continue; jq -n --arg n "$f" --rawfile t "$f" '{($n): $t}'; done |
  jq -s '{artifacts: add, failOn: "error"}' |
  curl -sS -X POST "https://go.coremodels.io/v1/$PROJECT_ID/integrations/drupal/audit" -H "Authorization: Bearer $COREMODELS_KEY" -H "Content-Type: application/json" -d @- |
  jq -e '.data | .gate, (.findings[] | select(.severity == "Error") | .code + " " + .subject), (.gate == "pass")'

The service answers 200 also when the gate is fail. Read gate, as the command does. If the command prints null, no file was found at that path.

What it does not do

  • A field that becomes required is not reported.
  • A content type that is deleted is not reported. Its fields are no longer compared.
  • CoreModels reads the files you give it. It does not connect to your Drupal site.

← Back to Drupal

Start building

14-day free trial. Builder $49/mo after the trial. Cancel any time.