You are reading the documentation of OpenCTI 7.260309 LTS · 7.260309.0-lts.8, supported until 2027-04.Latest is 7.261119.0 →
How-to guide

Upgrade

Upgrade an XTM stack deployed with Docker Compose to new images, after a backup, and know what each platform migrates on its own.

OpenCTIOpenAEVAll modulesFor platform engineers

This page upgrades an XTM stack deployed with the official Docker deployment, FiligranHQ/xtm-docker: back up, get the new deployment files, download the new images and start them. OpenCTI and OpenAEV migrate their databases when they start, so you can upgrade from any version to the latest one, even across several major releases.

BEFOREUPGRADEAFTER1. Stop, back updocker compose stop, then the volumes2. Get new filesgit pull, then clean .env3. Pull and startThe platforms migrate their data4. Wait until healthydocker compose ps5. Apply breaking changesActions after the upgrade
  1. 1. Stop, back up → 2. Get new files
  2. 2. Get new files → 3. Pull and start
  3. 3. Pull and start → 4. Wait until healthy
  4. 4. Wait until healthy → 5. Apply breaking changes
An upgrade backs up the stack, gets the new files and pulls and starts the new images, which migrate their data as they start, and ends with the actions the breaking changes ask for

Before you start

  • Read the breaking changes between your version and the new one. Some need an action before or after the upgrade.
  • Check the compatibility matrix when you upgrade one module and not the others.
  • Plan a maintenance window: the platforms are stopped during the backup and while they migrate their data. The first start after an upgrade can take longer than usual.
  • Run the commands from the xtm-docker folder that holds your .env.

What migrates on its own

WhatWhen
OpenCTI database schema and dataWhen the new OpenCTI starts
OpenAEV database schema and dataWhen the new OpenAEV starts
XTM One database schema and dataWhen the new XTM One starts, as Upgrade XTM One describes
Changes that need youListed per version in Breaking changes, with a guide for each

To go back to the version you had, restore the backup you take in step 1: the older images alone are not enough. XTM One refuses to start on a database that a newer version migrated: its log says The database is ahead of this image, and names the revision it does not know. Do not re-stamp the database to get past it: restore the backup, or deploy an XTM One image that contains that revision.

Upgrade the stack

  1. Take a snapshot of Elasticsearch, as in Back up the stack: Elasticsearch cannot be restored from a copy of its volume. Then stop the stack and back up the other volumes. The volume names start with COMPOSE_PROJECT_NAME from .env (xtm by default).

    docker compose stop
    P=$(grep -E '^COMPOSE_PROJECT_NAME=' .env | cut -d= -f2)
    mkdir -p backup
    for v in pgsqlshareddata pgsqldata pgsqlxtmonedata s3data redisdata amqpdata rsakeys; do
      docker volume inspect "${P}_$v" >/dev/null 2>&1 || continue
      docker run --rm -v "${P}_$v":/data:ro -v "$PWD/backup":/backup alpine tar czf "/backup/$v.tgz" -C /data .
    done
    

    This copy suits a single machine. For a production deployment, see Back up and restore.

    Check that it worked
    ls -lh backup
    

    It lists one .tgz file for each volume of your deployment but esdata, none of them empty.

  2. Get the new deployment files.

    git pull
    

    The new files split the stack: docker-compose.yml includes one file per shared service, in infra/, and one per module, in modules/. The services, their settings and the volume names stay the same, so your data is kept. If git pull refuses because you changed docker-compose.yml, move your changes to docker-compose.override.yml first: see Stay on a version or an LTS line. If you pinned the versions, set the new ones now, as that section describes. If docker volume ls lists a volume whose name ends in pgsqlxtmonedata, your deployment still has two PostgreSQL containers: follow Move to the shared PostgreSQL instance instead of steps 2 and 3.

    The whole stack always starts, and XTM Composer always manages both OpenCTI and OpenAEV. A COMPOSE_PROFILES line, XTM_COMPOSER_OPENCTI_ENABLE or XTM_COMPOSER_OPENAEV_ENABLE left in .env does nothing: remove them.

    sed -i.bak -E '/^(COMPOSE_PROFILES|XTM_COMPOSER_OPENCTI_ENABLE|XTM_COMPOSER_OPENAEV_ENABLE)=/d' .env
    

    A service of docker-compose.override.yml with a profiles: line starts only while one of its profiles is turned on. Without COMPOSE_PROFILES, a service you added with a line such as profiles: ["opencti-connectors"] no longer starts: remove that line from it.

    Check that it worked
    docker compose config --quiet && echo "configuration OK"
    

    It prints configuration OK.

  3. Download the new images, then start the stack.

    docker compose pull
    docker compose up -d
    

    Download first: Docker Compose would otherwise start the older image kept under the same latest tag. The platforms migrate their data as they start: allow several minutes.

  4. Wait until the platforms are healthy.

    docker compose ps --format '{{.Service}} {{.Health}}' | grep -E '^(opencti|openaev|xtm-one|opencrq) '
    
    Check that it worked

    Each platform says healthy. From the host, each one answers its health check:

    set -a; . ./.env; set +a
    curl -fsS "http://localhost:$OPENCTI_PORT/health?health_access_key=$OPENCTI_HEALTHCHECK_ACCESS_KEY" >/dev/null && echo "OpenCTI OK"
    curl -fsS "http://localhost:8081/api/health?health_access_key=$OPENAEV_HEALTHCHECK_KEY" >/dev/null && echo "OpenAEV OK"
    curl -fsS "http://localhost:$XTM_ONE_PORT/api/health/ready" >/dev/null && echo "XTM One OK"
    

    The container of XTM One stays healthy even when its start fails, so its line checks readiness instead, which succeeds only once the migrations and the start are complete. Until then, curl -sS "http://localhost:$XTM_ONE_PORT/api/health/ready" answers "status":"starting", with a startup_error that gives the reason when the start failed, such as The database is ahead of this image after a rollback without the backup.

  5. Apply the actions the breaking changes of your new version ask for after the upgrade.

If a platform does not become healthy, read its logs, for example docker compose logs opencti, and see Troubleshoot the XTM stack.

Tune the OpenCTI migrations

OpenCTI logs each data migration with the [MIGRATION] prefix, and runs each one once. Two of them read your configuration.

Re-index of the targets relationships

On a platform that has not run it yet, a migration re-indexes the targets relationships of every region, country and sector. Its logs start with Re-indexing targets for region / countries / sectors. On a large platform, its bulk requests to Elasticsearch can time out and stop the start. Three keys set them; they are read only while this migration runs.

KeyDefaultWhat it does
migrations:reindex_targets_rel:max_bulk_operations1000Lines of each bulk request, two for each location. Lower it if the migration fails on timeouts
migrations:reindex_targets_rel:bulk_timeout30mTimeout of each bulk request, as an Elasticsearch duration
migrations:reindex_targets_rel:max_concurrency2Bulk requests sent in parallel. Lower it to 1 on a loaded cluster

For example, in docker-compose.override.yml, before you start the new version again:

services:
  opencti:
    environment:
      - MIGRATIONS__REINDEX_TARGETS_REL__MAX_BULK_OPERATIONS=200
      - MIGRATIONS__REINDEX_TARGETS_REL__BULK_TIMEOUT=60m
      - MIGRATIONS__REINDEX_TARGETS_REL__MAX_CONCURRENCY=1

Remove these lines once the platform is healthy. The other migration keys are in the Technical section of the configuration reference.

AI switch

When you upgrade from a version released before September 2025, a migration sets the Generative AI (AI Insight, NLQ) switch of Settings, then Filigran Experience from ai:enabled (AI__ENABLED): on when the key is unset or true, off when it is false. After that, you change the switch in the interface, and ai:enabled must still be true for OpenCTI to reach its model. The model itself is set as Connect OpenCTI to your own language model describes.

Move to the shared PostgreSQL instance

Earlier versions of xtm-docker ran two PostgreSQL containers: pgsql for OpenAEV and pgsql-xtm-one for XTM One. OpenAEV and XTM One now share one pgvector instance, on a new pgsqlshareddata volume. The old volumes are left untouched, so the new version starts with empty databases unless you move the data.

  1. Before you get the new files, dump both databases.

    docker compose start pgsql pgsql-xtm-one
    docker compose stop openaev xtm-one xtm-one-worker
    docker compose exec -T pgsql sh -c 'pg_dump -U "$POSTGRES_USER" -Fc openaev' > openaev.dump
    docker compose exec -T pgsql-xtm-one sh -c 'pg_dump -U "$POSTGRES_USER" -Fc xtm_one' > xtm_one.dump
    docker compose down
    
    Check that it worked

    ls -lh openaev.dump xtm_one.dump lists two files, none of them empty.

  2. Get the new files, prepare the shared instance and restore both databases. The xtm-one-db-init service creates the XTM One role, its database and the pgvector extension.

    git pull
    docker compose run --rm xtm-one-db-init
    docker compose exec -T pgsql sh -c 'pg_restore -U "$POSTGRES_USER" -d openaev' < openaev.dump
    docker compose exec -T pgsql sh -c 'pg_restore -U "$POSTGRES_USER" -d xtm_one' < xtm_one.dump
    
  3. Download the new images and start the stack, then continue at step 4 of Upgrade the stack.

    docker compose pull
    docker compose up -d
    
  4. Once OpenAEV and XTM One show your data, remove the old volumes. Their names start with your COMPOSE_PROJECT_NAME.

    docker volume rm xtm_pgsqldata xtm_pgsqlxtmonedata
    
Started the new version before the dump?

Your data is still in the old volumes. The xtm_pgsqlshareddata volume holds the databases the platforms created on that start, with everything written to them since: removing it deletes those writes. If you need them, dump both databases from pgsql first with the pg_dump commands above. Then run docker compose down, remove the xtm_pgsqlshareddata volume, check out the previous version of xtm-docker, and start this procedure again.

Stay on a version or an LTS line

xtm-docker starts every image with the latest tag, so each upgrade moves to the latest release. To stay on a version, for example an LTS line of OpenCTI, set the image tags in docker-compose.override.yml with the commands of Pin the image versions. With OPENCTI_VERSION=7.260811.0-lts.1 in them, every OpenCTI image (platform, worker and default connectors) uses 7.260811.0-lts.1. Give OPENAEV_VERSION and XTM_ONE_VERSION the releases you run, or latest.

Check that it worked
docker compose config --images | grep '^opencti/'

Every OpenCTI image ends in :7.260811.0-lts.1.

An LTS release needs an LTS license key: see Versioning and LTS. The lines the documentation describes today:

OpenCTI lineRelease documentedSupported until
Latest7.261030.1Replaced by each new release
7.260811-lts7.260811.0-lts.1September 2027
7.260309-lts7.260309.0-lts.8April 2027

To upgrade later, run the same commands with the release you upgrade to, such as OPENCTI_VERSION=7.260811.0-lts.2, then download the images and start the stack as in Upgrade the stack.

A changed docker-compose.yml, or a changed file of infra/ or modules/, makes git pull refuse to merge. List your changes with git diff, and write each one in docker-compose.override.yml, as Change the stack without editing docker-compose.yml describes: pin image tags with the commands of Pin the image versions. Then put the files of xtm-docker back and pull:

git checkout -- .
git pull

Docker Swarm

Set the new image tags in your stack file, then force each service to restart on its new image:

docker service update --force <service_name>

What's next

NextOverview
Deploy
Install, configure, secure, scale and upgrade the platform.

Published

Overview
Run the XTM platform locally
OverviewDeploy with an AI agent