Docs / Self-hosting

Upgrading

Upgrade your self-hosted Datum installation and verify its health.

Check the installed build before choosing upgrade notes:

docker compose -f deploy/docker-compose.yml exec -T app ocmgr -V

The CLI reports the version and source revision stamped into the build. Published images carry both. For a local Docker build, pass --build-arg OCMGR_VERSION=<version> --build-arg OCMGR_REVISION=<commit> to record them; without those arguments it reports a development build with an unknown revision.

Overview

An upgrade replaces the app image and restarts the container. The app applies database migrations before it serves requests. A database lock makes concurrent container starts safe. The upgrade preserves workspaces, sources and settings.

Datum does not yet publish an image. Compose installations build each release from source.

Configure

Before you upgrade

  1. Create a backup.

    docker compose -f deploy/docker-compose.yml exec -T app ocmgr backup --json

    With backups configured, Datum encrypts the backup and uploads it to your bucket.

  2. Read the release’s upgrade notes in docs/hosting.md.

    Some releases require preparation, such as replacing short webhook secrets before new validation rejects them.

  3. Keep deploy/.env.

    This file contains your keys. The upgrade does not change it.

Basics

Docker Compose

Run these commands from the repository root.

  1. Get the new release

    Download the latest source. Build the image.

    git pull
    docker build -t ocmgr:local .
  2. Restart the app

    Start the containers with the new image.

    docker compose -f deploy/docker-compose.yml up -d

    Include --profile tls or --profile events if you use those profiles, unless COMPOSE_PROFILES in deploy/.env already names them. With a separate worker, follow With more than one process instead.

  3. Add new settings

    Run the doctor --init command from Install with Docker.

    The command adds missing settings and preserves existing values.

  4. Check the upgrade

    Check the health endpoint. Run doctor. Inspect the worker status.

    curl -s localhost:3000/healthz
    docker compose -f deploy/docker-compose.yml exec -T app ocmgr doctor --json
    docker compose -f deploy/docker-compose.yml exec -T app ocmgr jobs status --json

    The health endpoint should return ok. Doctor should report no failed checks. The job status should show a live worker.

    Read the same job status through GET /v1/ops with an admin API key or get_ops_status through hosted MCP. See worker status examples for requests and warning states.

On a VPS

Run deploy/droplet/install.sh again with your original options if you used the VPS installer. If you pinned a release with --ref <tag>, pass the new tag instead: the same --ref checks out the same release again and upgrades nothing.

The installer checks each step’s current state. It downloads the new release, rebuilds the image, restarts the containers and runs doctor. See Deploy to a VPS, Render or Fly.

With more than one process

Render, Fly and Compose installations with a separate worker can briefly run different releases during deployment.

On Render and Fly, upgrade the workers first and the API afterwards. This order ensures that workers can process jobs from the new API.

On Compose, only the app container applies migrations, and the worker file makes the worker wait for a healthy app. So stop the worker, then start everything: the app migrates on the new release, and the worker starts on it once the app is healthy. Jobs queue in the meantime and run when the worker starts.

docker compose -f deploy/docker-compose.yml -f deploy/compose.worker.yml stop worker
docker compose -f deploy/docker-compose.yml -f deploy/compose.worker.yml up -d

No old worker runs alongside the new app, so nothing the new app enqueues reaches an old worker.

When the upgrade is slow

Migrations on large tables can take several minutes. The app does not answer /healthz until migrations finish. The container allows ten minutes before its health check fails.

Inspect the app log if startup takes longer than expected.

docker compose -f deploy/docker-compose.yml logs app

Messages such as lock timeout; retry 2/5 indicate that a migration awaits a database lock.

End the blocking query if the retries fail. Restart the app to retry the migration.

FAQ

Do I need to stop the app before upgrading?

No. up -d replaces the running container. The app remains unavailable while the new container applies migrations and starts.

Can I skip releases?

Read the upgrade notes for every release you skip. Complete any required preparation before upgrading. The app runs each release’s migrations in order at startup.

Can I pin a version?

Check out the required tag before building. Alternatively, pass --ref <tag> to the VPS installer.