Upgrade and back up

This page upgrades a self-hosted installation, and backs it up and restores it. Treat 5 things as one set: the database, the object store, the image that matches them, the same ROLLOUT_SECRETS_KEY and the same ROLLOUT_INSTALLATION_ID. Back them up together and restore them together. Volumes need their own backup (see Backup & restore).

Rolling back only the image after a schema change is unsafe. To go back, restore the pre-upgrade snapshot with the previous image.

Commands below assume the Compose install from Self-host Rollout, run from the install directory.

Upgrade procedure

  1. Read the release. Read the release notes and the target release's priv/repo/migrations/. Find destructive or lock-heavy migrations before you touch production.

  2. Read the notes, then update compose.yaml. The sections after this procedure cover what a release can change. Do these before anything else:

    Then update your checkout to the target release, so compose.yaml matches the image. Running containers don't change until a later step recreates them.

  3. Select the image. Set ROLLOUT_IMAGE in .env.selfhost to the exact new image, keep every existing key, then pull it:

    docker compose --env-file .env.selfhost pull migrate rollout compute
    

    If you build from source, run the build command from the install page instead.

    With Native off and Apps turned on, pull the new release's compiler image too. Its tag is the release's commit, so the image from your last upgrade doesn't match this one, and Rollout can't fetch one that needs a registry sign-in. Until it's on the Docker host, App builds fail.

    image=$(docker compose --env-file .env.selfhost run --rm --no-deps -T migrate \
      bin/rollout eval "RolloutRelease.app_build_image()" | tail -n 1)
    docker pull "$image"
    
  4. Check the image before you stop anything. This validates the required environment and the integration catalog from the new image:

    docker compose --env-file .env.selfhost run --rm --no-deps --interactive=false migrate \
      bin/rollout eval "RolloutRelease.verify_integrations!()"
    

    When replacing the legacy model catalogue, run the inference drain check while the previous release is still available.

  5. Check pgvector on a retained database. See Keep pgvector current.

  6. Drain and snapshot. Stop the app, then take the backup:

    docker compose --env-file .env.selfhost stop rollout
    

    Compose allows 90 seconds for shutdown. On Kubernetes, keep terminationGracePeriodSeconds in step with ROLLOUT_TERMINATION_GRACE_MS.

  7. Apply the Compose changes while the app is stopped. If compose.yaml just moved you off MinIO, follow Move the object store to Silo. Then recreate the Docker proxy. The steps below use --no-deps, so they leave both services as they are.

  8. Migrate from the new image while the old app is stopped:

    docker compose --env-file .env.selfhost run --rm --no-deps --interactive=false migrate
    

    If the model catalogue drain guard refuses the upgrade, follow the recovery steps. For other errors, resolve the failure before starting an app image.

  9. Start compute, then the app, from the selected image:

    docker compose --env-file .env.selfhost up -d --no-build --no-deps --wait compute
    docker compose --env-file .env.selfhost up -d --no-build --no-deps --wait rollout
    
  10. Verify. Check both running images with ps. Open /health/ready locally and over the real HTTPS endpoint. Confirm your mail and compute settings, run a smoke workflow, and confirm an authentication email reaches its inbox.

  11. Finish the notes that need a running app: Close registration and Turn on the Operator console.

On Kubernetes, run the same migration command as a Job from the new image before you roll the app.

Check the legacy model catalogue

For the upgrade that replaces the legacy model catalogue, use Pause in each affected workflow editor to stop new trigger runs on the previous release. Suspend direct AI and vision OCR submissions for the maintenance window. Let open workflows finish or cancel them, including suspended runs. Allow outstanding model requests and their usage deliveries to settle. Keep new work paused through the upgrade and any retries.

While the previous release is running, use the new image to print the same check that the migration enforces. The command below runs it in a read-only PostgreSQL session on the bundled database.

set -o pipefail
docker compose --env-file .env.selfhost run --rm --no-deps -T -e ROLLOUT_ROLE=compute migrate \
  bin/rollout eval 'IO.write(Rollout.LLM.LegacyCutover.guard_sql())' | \
  docker compose --env-file .env.selfhost exec -T postgres \
    sh -c 'PGOPTIONS="-c default_transaction_read_only=on" psql -X -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -d "$POSTGRES_DB"'

For external PostgreSQL, send the same SQL to psql -X -v ON_ERROR_STOP=1 on your read-only connection. On refusal, finish the work named in the error on the running release and repeat the check before stopping it.

If the migration itself refuses after shutdown, inspect its log. If only a drain check ran and the prior schema and data are intact, restart the existing previous-image application container by its ID. This starts that container alone and preserves the state of completed migration jobs.

docker container start "$(docker compose --env-file .env.selfhost ps --all --quiet rollout)"

Settle the work, repeat the check and take a fresh backup. If an earlier data or schema migration committed, or you cannot establish what committed, restore the matching pre-upgrade backup and previous image before resuming work.

Turn off Native

Compose installs initialized before ROLLOUT_ALLOW_NATIVE_RUNTIME existed, and installs outside Compose that don't set it, still allow Native. A Native step runs with the Rollout server's environment, so it can read ROLLOUT_SECRETS_KEY and DATABASE_URL. The upgrade leaves this as it was, because turning it off fails workflows that still use it.

  1. Move workflows off Native. In each workflow that uses it, choose Docker or Kubernetes under Isolation in the workflow's settings, and publish. A published release keeps the runtime it was published with.

  2. Check Apps. Apps start compiling in a container, from a compiler image on the Docker host. See App builds.

    On a release image, pull the compiler. If you pull ROLLOUT_IMAGE from a mirror, set ROLLOUT_APP_BUILD_IMAGE_REPOSITORY in .env.selfhost first: the release otherwise uses the repository built into it, because your environment file predates that setting.

    image=$(docker compose --env-file .env.selfhost run --rm --no-deps -T migrate \
      bin/rollout eval "RolloutRelease.app_build_image()" | tail -n 1)
    docker pull "$image"
    

    If you build from source, add ROLLOUT_APP_BUILD_IMAGE=rollout-app-build:selfhost to .env.selfhost, then build the compiler image:

    docker compose --env-file .env.selfhost -f compose.yaml -f docker/compose.source.yaml build app-build
    
  3. Turn it off. Add ROLLOUT_ALLOW_NATIVE_RUNTIME=false to .env.selfhost, then recreate the app:

    docker compose --env-file .env.selfhost up -d --no-build --no-deps --wait rollout
    

A step still on Native now fails with capability_denied, and nothing converts it for you. Run JavaScript moves into containers at this restart, whatever Isolation says.

Move the object store to Silo

Compose now runs Silo, the maintained fork of MinIO, in the minio service. MinIO stopped publishing images and quay.io/minio/minio refuses anonymous pulls, so an older install keeps running only while its image stays in the local Docker cache. Don't prune images on that host until you've done this.

Silo opens the existing volume in place, with nothing to export or convert, and it reads the same MINIO_ROOT_USER and MINIO_ROOT_PASSWORD. Leave .env.selfhost as it is. Keep the minio service and minio-data volume names too: under another name, Compose attaches a new, empty volume.

  1. Update compose.yaml to the target release, and pull the new image:

    docker compose --env-file .env.selfhost pull minio minio-init
    
  2. Back up the volume. With the app stopped, take the object store backup. Never add -v to docker compose down during an upgrade, because it deletes the volumes.

  3. Start Silo on the same volume. minio-init leaves an existing bucket alone:

    docker compose --env-file .env.selfhost up -d --no-build --no-deps --wait minio
    docker compose --env-file .env.selfhost up --no-build --no-deps minio-init
    
  4. Confirm your objects are there before you start the app. An empty listing means the wrong volume is attached:

    docker compose --env-file .env.selfhost exec minio sh -c \
      'mcli alias set local http://127.0.0.1:9000 "$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD" && mcli du local/'
    

The backup is your way back. You can't pull the old image again, so if it's still on the host, keep a copy with docker image save before you start.

Recreate the Docker proxy

The docker-api proxy in compose.yaml now allows the disk usage read that measures Local volumes. An older proxy refuses it, so those volumes show "Usage not measured", and logs rollout shows Docker refused the volume usage inventory. Provisioned quotas aren't affected. After you update compose.yaml, recreate it:

docker compose --env-file .env.selfhost up -d --no-build --no-deps docker-api

Publish the App sandbox port

compose.yaml now publishes the App sandbox on 127.0.0.1:4010, so a compose.override.yaml that only adds that port is no longer needed. Compose ignores the duplicate, so you can delete it at your own pace.

Compose holds that host port even with Apps off, because it doesn't depend on SANDBOX_HOST. If something else on the host listens on 127.0.0.1:4010, move it before you update compose.yaml, or rollout won't start.

Keep the egress allowlist on Kubernetes

ROLLOUT_FQDN_NETWORK_POLICY_AVAILABLE now defaults to false, so a cluster without the FQDN network policy API can't save an allowlist it can't enforce. If your cluster serves that API and a workspace has the allowlist on, set the variable to true before you upgrade. Otherwise provisioning for that workspace fails with fqdn_network_policy_unavailable until you set it. Compose installs aren't affected, because the allowlist needs Kubernetes.

Confirm the API first:

kubectl api-resources --api-group=networking.gke.io

The output must list fqdnnetworkpolicies. Setting the variable on a cluster that doesn't serve it fails closed: the workspace's pods keep DNS and lose HTTPS egress until you turn the allowlist off.

Close registration

Registration on a new install closes when the first person confirms their address. An install past that point keeps alpha as it was, which on Compose means open: anyone who reaches the host can register, create a workspace and run workflows in it. To close it, turn on the Operator console, open Flags and disable alpha. Google sign-in stops with it, and people who registered through Google sign in with an emailed link.

Turn on the Operator console

A new install turns on the operator_admin flag at its first migration. An install that already had a human user keeps the flag as it was, and the only switch for it is inside the console, so turning it on the first time needs a command. Set OPERATOR_EMAILS first: the flag only makes the console visible, and an empty allowlist still denies everyone.

docker compose --env-file .env.selfhost exec rollout bin/rollout rpc 'FunWithFlags.enable(:operator_admin)'

Keep pgvector current

Rollout needs pgvector 0.8.0 or later for filtered vector search. A migration checks the version and runs ALTER EXTENSION vector UPDATE on an older database. If the update can't reach 0.8.0, or the migration role doesn't own the extension, the migration stops and the upgrade doesn't go ahead.

Updating a PostgreSQL container or host package doesn't update the extension already installed in a database. That holds for retained Compose volumes too. To check the version yourself on the bundled database, open psql with this command. On your own PostgreSQL, connect the way you normally do.

docker compose --env-file .env.selfhost exec postgres sh -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB"'

Then check the version, and update it if the server package offers a newer one:

SELECT extversion FROM pg_extension WHERE extname = 'vector';
ALTER EXTENSION vector UPDATE;
SELECT extversion FROM pg_extension WHERE extname = 'vector';

The final value must be at least 0.8.0. If ALTER EXTENSION can't reach it, upgrade the server package first.

Migrations

Take a snapshot before every migrate. Some migrations are destructive or non-transactional, and a snapshot is the only general rollback.

  • Locks: ALTER TABLE ... ADD CONSTRAINT, trigger creation and table rebuilds take table locks and queue traffic on large tables. Plan these for a maintenance window.
  • Concurrent indexes: a migration that uses CREATE INDEX CONCURRENTLY runs outside a transaction. If it fails midway, drop the INVALID index and run it again.
  • Baseline: the first migration has no down. It can't be rolled back.

To roll back reversible migrations, pass the oldest version you want reverted. This reverts every applied migration from the newest down to and including <version>. To revert one migration, pass the newest applied version.

docker compose --env-file .env.selfhost run --rm --no-deps --interactive=false migrate \
  bin/rollout eval 'RolloutRelease.rollback(Rollout.Repo, <version>)'

Don't rely on this across destructive migrations. To downgrade, restore the pre-upgrade snapshot and run the previous image.

Backup & restore

What Where it lives How to keep it
Database PostgreSQL: workspaces, workflows, runs, records, documents, the job queue, feature flags and encrypted Connection and workspace secrets pg_dump or managed snapshots
Objects STORAGE_BUCKET: attachments under tenants/<workspace id>/attachments/, App assets and built App frontends under tenants/<workspace id>/apps/, custom models under tenants/<workspace id>/models/ and recorded stream media under tenants/<workspace id>/streams/ Your object-store tooling, or a volume copy for the bundled object store. Copy the whole bucket
Volumes Docker volumes named rollout-vol-<id>, Kubernetes PersistentVolumeClaims, or ROLLOUT_OBJECT_STORE_BUCKET Your own tooling. The commands on this page don't cover them. A Docker or Kubernetes Volume whose data is gone after a restore shows as failed
Keys .env.selfhost and .env.compute A secret manager, separate from database backups
Installation id ROLLOUT_INSTALLATION_ID in .env.selfhost With the keys. It isn't secret, but it must never change (see Installation id)
Image Your registry Record the exact tag or digest with each backup

App source text is in PostgreSQL. A database restored without the bucket leaves attachment rows and App files pointing at missing objects. Unreferenced App objects are deleted after 30 days, so a dump older than that can name App assets that no longer exist.

PostgreSQL

With the app stopped:

docker compose --env-file .env.selfhost exec -T postgres \
  sh -c 'pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" -Fc \
    --exclude-table-data=workflow_run_sealed_outputs' > rollout.dump

workflow_run_sealed_outputs holds encrypted values that live only while a run can use them, so the dump leaves its rows out and a restored installation starts with the table empty. A physical backup or point-in-time recovery still holds that ciphertext until the backup expires.

Bundled object store

Stop the minio service while you copy its volume. Compose names the volume rollout_minio-data by default, and docker volume ls confirms it.

docker compose --env-file .env.selfhost stop minio
docker run --rm -v rollout_minio-data:/data:ro -v "$PWD":/backup alpine:3.24 \
  tar czf /backup/rollout-minio.tgz -C /data .
docker compose --env-file .env.selfhost start minio

Encryption key

Connection secrets and workspace secrets are envelope-encrypted, and their data keys are wrapped by the key in ROLLOUT_SECRETS_KEY. Reads fail closed.

  • Losing the key makes every stored Connection secret and workspace secret permanently unrecoverable. A database backup alone isn't a full backup.
  • Store the key separately from database backups.
  • Restoring means the Postgres snapshot plus the same key value.
  • Changing the key doesn't rewrap existing data. See Secret encryption key.

An installation on Google Cloud KMS keeps the same rule: keep that provider's key for as long as you keep the backups.

Installation id

ROLLOUT_INSTALLATION_ID names the installation to its Docker desktops, their reservations, the daemon's marker volume rollout-control-plane, and, on Kubernetes, its step pods. A new id disowns all of them (a step pod it disowns waits for its run to end instead of the 10-minute cleanup): Rollout refuses a daemon whose marker names another id, and the desktop watchdog leaves the old ones alone. If .env.selfhost is lost, recover the id; never generate a new one while any of these still names the old one. Take it from the first that has it:

  1. Your copy of .env.selfhost or the secret manager.
  2. The marker: docker volume inspect -f '{{index .Labels "rollout.installation"}}' rollout-control-plane.
  3. The database, where both reservations and Docker desktop sessions carry it (a database from before reservations existed has only the sessions): SELECT installation_id FROM runtime_desktop_reservations UNION SELECT provider_ref->>'installation_id' FROM runtime_session_allocations WHERE provider = 'docker';.
  4. A desktop container's label: docker ps -a --filter label=rollout.workload=desktop --format '{{.Label "rollout.installation"}}'.

Generate a new id only when all four are empty. Never start a restored or cloned database against the daemon of an installation that is still running: both would carry the same id, so nothing tells them apart, and both would act on the same desktops.

Restore

These steps haven't been rehearsed as a full restore. Try them on a spare host before you depend on them.

  1. On a host with empty volumes, put .env.selfhost and .env.compute back, and set ROLLOUT_IMAGE to the image that took the backup.

  2. Start the data services only, then restore the database. Starting the whole stack first runs migrations against the empty database.

    docker compose --env-file .env.selfhost up -d --no-build --wait postgres minio
    docker compose --env-file .env.selfhost exec -T postgres \
      sh -c 'pg_restore -U "$POSTGRES_USER" -d "$POSTGRES_DB"' < rollout.dump
    
  3. Restore the bucket into its volume:

    docker compose --env-file .env.selfhost stop minio
    docker run --rm -v rollout_minio-data:/data -v "$PWD":/backup alpine:3.24 \
      tar xzf /backup/rollout-minio.tgz -C /data
    docker compose --env-file .env.selfhost start minio
    
  4. Start everything:

    docker compose --env-file .env.selfhost up -d --no-build
    
  5. Verify /health/ready, sign in, and test a Connection to prove the key still decrypts its secret.

What can go wrong

Symptom Cause Fix
Migration fails midway A destructive or non-transactional step stopped Don't start any app image. Clean up an INVALID index and rerun, or restore the snapshot and previous image
The first migration fails on halfvec pgvector is older than 0.7 Upgrade the server package and rerun
A migration stops with pgvector ... is too old The server package is older than 0.8 Upgrade the server package and rerun
Connections stop working after a restore ROLLOUT_SECRETS_KEY differs from the one that wrote the data Restore the original key. A new key can't read the old data
Attachments or App files are missing after a restore The database and bucket came from different times Restore a matching pair
Errors after you roll back only the image The schema no longer matches the image Restore the snapshot that matches the image
A Query workspace step, a Query saved view step or a Saved view fails with Unknown field or Invalid sort after an upgrade It filters on a Shared field in an archived field group or, in a Query workspace step with Strict Validation on, sorts on one. Earlier releases left those fields working, so a group archived before the upgrade drops out with no admin action Restore the group in Shared fields, or remove the field from the step or view
Pulling quay.io/minio/minio fails with unauthorized An older compose.yaml names an image MinIO no longer serves Follow Move the object store to Silo