Skip to content

Upgrade

Move an existing Hivemind deployment to 1.7.0 without losing its spaces, credentials or grants, and know exactly where you can still turn back.

Rehearse the 1.6 to 1.7 import, the schema 5 store upgrade and a rollback on a copy of your deployment before touching production.

Before you start

Fresh installation or upgrade

Your situation Path
No Hivemind data to keep Fresh installation. Use a new, empty bucket; never initialize over an existing 1.6 bucket.
A running 1.6 deployment Upgrade from 1.6 to 1.7, below. It is a one-time, offline import of the 1.6 token registry into the 1.7 authority store.
A 1.7 candidate installed earlier, whose authority store uses schema 1, 2, 3 or 4 Upgrade the authority store to schema 5, below.
A 1.7 candidate installed before the single Core volume (its Graph credential still in the hivemind_secrets volume) Move to the single Core volume, below.
A 1.7 candidate that had an OIDC connection After the steps above, review its OIDC links, below.
A development instance with a native v3 registry Not migrated. Reinstall it.
Separate Live Memory and Graph Memory services The migration guide.

What you need

  • For a 1.6 deployment: version 1.6.6 running, as the 1.6.6 release notes ask before a move to 1.7.
  • The 1.7.0 release checked out in the deployment directory, the 1.7.0 Core image pulled locally, and Docker Compose 2.30 or later. Every command below uses both Compose files, docker-compose.yml and docker-compose.auth17.yml, and the pulled image (step 2).
  • SQLite as the authority backend. PostgreSQL exists as a store backend, but its operator install, import and recovery workflows are not supported in 1.7.0.
  • A durable Core data volume (hivemind_core_data), even when memory objects live in S3.
  • For an S3-backed deployment: the same S3 endpoint, bucket and credentials as the 1.6 deployment, with S3_ENDPOINT_URL, S3_BUCKET_NAME and S3_REGION_NAME set explicitly in the environment shared by Core and Graph. Graph refuses to start without the first two. Keep credentials in the protected .env or the platform's secret mechanism, never on a command line or in a report.
  • The 1.6 .env, which 1.7 keeps (step 2).
  • A private host directory for the import report, owned by UID 10001 with mode 0700, mounted at /data/install in the importer container. On a Linux host: sudo install -d -o 10001 -m 0700 /srv/hivemind/private/upgrade.
  • HTTPS for the Portal (step 10): Core refuses browser sign-in without it.
  • If an external OWASP CRS WAF inspects Hivemind traffic: its scoped exclusions, applied before any 1.7 traffic is routed through it.
  • A maintenance window. The import is offline: no 1.6 Core or Graph process may run from the dry run until activation.

Back up first

Back up the 1.6 deployment with your own procedure and keep its recovery material, off-host, after every 1.6 service is stopped (step 1):

  • every object of the bucket: the import writes to that bucket, and bucket versioning is not a backup. Use a copy that keeps each object's key, bytes, content type and user metadata; a copy that passes through a local filesystem keeps only keys and bytes, and no copy carries the version history;
  • the .env file and every file it refers to;
  • the hivemind_secrets, neo4j_data and qdrant_data volumes, copied with your volume backup tool, each to its own archive named after the volume (see Back up the instance for one command per Docker volume).

Whatever your procedure, the upgrade relies on three things you must still have afterwards: the deployment's .env, the bucket the 1.6 deployment wrote to, and the hivemind_secrets volume, which holds the embedded Graph transport credential and must be kept until the upgraded deployment is verified. Enable bucket versioning if it is not already on (see Back up and restore).

Rollback boundaries

Read this before step 1. Each line is a point after which the previous way back closes.

Point What changes Way back after it
Graph credential copy Copied to the Core volume; the old volume is mounted read-only and left intact. Restart 1.6 as before.
Operational volume provisioning Creates the new, empty operational volume; nothing of 1.6 changes. Restart 1.6 as before.
Dry run Writes a private report only. It creates no database and does not archive the registry. Restart 1.6 as before.
Apply (point of no return) Reserves the 1.6 registry, archives it to _system/archive/tokens-1.6.json and commits the authority store with its activation. None to 1.6 on this bucket. The import is one-way: never restart a 1.6 producer after activation. It leaves _system/tokens.json in place, so a 1.6 Core started on the imported bucket serves the pre-import token registry with no warning. Recovery on 1.7 means restoring a verified authority snapshot into an empty store. Returning to 1.6 means restoring the whole 1.6 backup, the objects into an emptied bucket, which loses everything written since.
First 1.7 writes New memory, sessions and identity records exist only in 1.7 formats. Restoring an older backup loses everything written since.

An older binary refuses a newer authority schema at startup. Rolling back a binary after 1.7 writes needs a coordinated authority and data backup taken before the upgrade; restoring an old registry or authority root alone after later writes is not a rollback and can lose or orphan state.

Steps

Upgrade from 1.6 to 1.7

  1. Record long_status for each space with long memory documents, for Verify. Then, in the 1.6 deployment directory, stop every 1.6 service and importer, with more than Docker's default 10-second timeout, which can be too short for Neo4j to shut down cleanly:

    docker compose stop --timeout 120
    

    Keep them stopped through the apply in step 7, and never restart them after it: disable any host unit or job that could start them. This is your responsibility: the command cannot detect a writer it does not know about. Take the backup described in Back up first now.

  2. Prepare the 1.7 release and its configuration:

    • Check out the 1.7.0 release in the same deployment directory. Compose names volumes after the project, which defaults to the directory name; from another directory, set COMPOSE_PROJECT_NAME to the 1.6 project name so that the steps below find the 1.6 volumes. Carry over the edits your 1.6 docker-compose.yml had, such as the WAF's TLS port and certificate volume lines.
    • Select both Compose files and the pulled Core image for the shell session. Without HIVEMIND_IMAGE, the jobs below run hivemind:latest, which is the 1.6 image or does not exist:

      export COMPOSE_FILE=docker-compose.yml:docker-compose.auth17.yml
      export HIVEMIND_IMAGE=registry.example/hivemind@sha256:<digest>
      export HIVEMIND_PULL_POLICY=never
      
    • Build the WAF and Graph images from the 1.7 checkout and pull the Neo4j and Qdrant images. The start script in step 10 never builds or pulls, so a Graph image left from 1.6 would start unchanged:

      docker compose build waf graph-memory
      docker compose pull neo4j qdrant
      
    • Keep the 1.6 .env; every variable of the 1.6 template still exists in 1.7. Compare it with the 1.7 .env.example and set S3_ENDPOINT_URL, S3_BUCKET_NAME and S3_REGION_NAME explicitly. Keep the 1.6 inference settings rather than the template's example values: the embedding model and dimensions must stay the ones the existing long memory was built with, or long memory writes and searches fail. Decide MID_AUTO_ARCHIVE and MID_AUTO_ARCHIVE_SPACES; with true and no list, every eligible space transfers its MID archive captures to long memory (see the memory operations guide).

  3. Copy the Graph transport credential to the Core volume. The job is networkless, mounts the old hivemind_secrets volume read-only, never generates a credential, is idempotent on rerun and refuses a different credential already present on the Core volume:

    docker compose run --rm hivemind-core-volume-adopt
    

    Skipping this step fails closed: the importer refuses without the local Graph secret and Core refuses to start.

  4. Provision the new operational volume (hivemind_operational). A 1.6 deployment has none, ordinary startup never creates it, and scripts/authority-compose.sh does not run the initializer, which sits behind an opt-in profile. Without it, Core refuses to start after the one-way import in step 7. Run it once, before the import:

    docker compose run --rm --no-deps hivemind-operational-init
    

    Run this only to create the volume the first time. Repeating it validates an existing healthy volume; a partial, foreign or corrupt one is refused and nothing is deleted. Never use it to replace a lost or damaged volume: reprovisioning a lost volume is a new installation, not a recovery. Restore an operational snapshot instead, as in Back up and restore. Keep the volume from now on.

  5. Run the dry run in a one-off Core container started with the same environment and both Compose files that the new Core will use, with the report directory mounted at /data/install. --no-deps keeps Compose from starting Graph or any other service. Use new absolute paths for the report and the store:

    docker compose run --rm --no-deps \
      -v /srv/hivemind/private/upgrade:/data/install hivemind \
      python -m live_mem.upgrade_cli import-v2 \
      --dry-run --confirm-stopped \
      --report /data/install/import-1.6-report.json \
      --store-path /data/core/authority.sqlite
    

    To keep a known 1.6 instance UUID, add --instance-id <uuid> to the dry run; a value passed later must match the report.

    If a live SHORT note carries a 1.6 receipt that is not settled, the command refuses and writes no report: it prints {"refused": "import_unresolved_receipts", "notes": {...}} with the affected note keys by space. Settle those receipts with the 1.6 service, stop every old service again and rerun the dry run.

  6. Review the report before going further. The report file and the command's output hold the same lists under report:

    • tokens and spaces: the numbers of 1.6 tokens and spaces imported;
    • pending_users: the addresses of the accounts the import creates, all Pending until their first sign-in;
    • merged_email_variants: addresses that differ only by case, merged into one account. Check that each group is one person;
    • imported_operators: the agents created from admin tokens that had no email, by agent ID and name, with no credential material. Each one keeps the access its token had in 1.6: Read, Read + write and Manage on every common space, including spaces created after the import. A token already revoked or expired in 1.6 is listed too, with that access already removed. Note which of these agents a client still needs; Verify says how to end or replace the others;
    • admin_grants: for each admin token with an email, the Manage grants written on every existing common space for its agent and its owner;
    • dropped_space_references: token grants on spaces that no longer exist. They are dropped and grant nothing;
    • mesh_spaces: the spaces bound to Project Mesh in 1.6, which stay bound;
    • orphan_spaces: top-level prefixes with objects but no space metadata. The importer leaves them untouched and creates no space for them. A deployment that kept long memory documents in its bucket lists one hm-<space>-<hash> prefix per such space: Graph keeps those documents there and goes on using them, so they need no action. Investigate any other prefix first;
    • review_sha256, the digest of the review.

    The report is bound to the source bytes, space inventory, deployment, tenant, auth mode and local Graph secret. Any inventory change after the dry run makes the apply refuse.

  7. With the same report, mount and target, apply the import, which is the point of no return:

    docker compose run --rm --no-deps \
      -v /srv/hivemind/private/upgrade:/data/install hivemind \
      python -m live_mem.upgrade_cli import-v2 \
      --apply --confirm-stopped \
      --report /data/install/import-1.6-report.json \
      --store-path /data/core/authority.sqlite
    

    The importer checks the report and inventory again, reserves the source, archives the registry without replacing an existing object, commits the store and records activation. It also writes Graph's binding on the Core volume and creates the private OIDC and local-authentication stores next to the authority database. Never delete or rewrite the reservation or the archive.

    The import changes nothing inside your spaces. In 1.7, the owner label a shared space had in 1.6 is shown as its Created by, as it was typed, marked From legacy Owner field. Where creator evidence and the old label are both absent, Default attribution shows the identifiable tenant operator or System. Attribution grants no access.

  8. If step 7 was interrupted, first confirm that every old service and importer is still stopped. Keep the original report and target, and rerun the same apply command with --resume added. A foreign reservation, a changed report or a partial private-store directory is refused: preserve the data directory and report for investigation, and do not replace individual files to retry. A completed run reports already-imported.

  9. Restore sign-in for imported people. The import migrates no OIDC configuration and creates no local setup codes:

    • re-declare each OIDC provider in the connections file, run its offline provisioning command, and assign each pending user who will use OIDC to their connection under pending_user_connections. The connection must allow the domain of that user's verified address;
    • for people who will use local sign-in, a deployment operator chooses Add local sign-in on their row in Identity & Groups → Users and hands over the one-time setup access privately. Without any operator able to sign in yet, keep Core stopped and issue an offline setup code for one imported deployment operator:
    docker compose run --rm --no-deps hivemind \
      python -m live_mem.auth_install_cli local setup \
      --store-path /data/core/authority.sqlite --user <operator-email>
    

    Deliver the result privately. The upgrade guide explains how to find user IDs in the Portal for the assignments.

  10. Start the stack over HTTPS. Core accepts a browser sign-in, the Portal's included, only over HTTPS attested by an explicitly trusted proxy, here the WAF:

    • In .env, set SITE_ADDRESS to the public host name, for example hivemind.example.org. In docker-compose.yml, the WAF's 80:80 and 443:443 port lines and its caddy_data and caddy_config volume lines are uncommented, with the matching top-level volumes: entries. If HTTPS terminates in your own proxy instead, configure it as in Install in production.
    • Start the stack with the store overlay and the image from step 2:

      scripts/authority-compose.sh
      
    • Read the stack's network subnet, add it to .env as AUTH_BROWSER_TRUSTED_PROXIES=["<subnet>"] (the actual subnet, never all private ranges) and run scripts/authority-compose.sh again. Without it, every browser sign-in is refused:

      docker network ls --filter name=hivemind-network
      docker network inspect -f '{{range .IPAM.Config}}{{.Subnet}}{{end}}' <network-name>
      
  11. After verification, retire the hivemind_secrets volume under your backup policy, not before.

Upgrade the authority store to schema 5

Use this only for an authority store created by an earlier 1.7 candidate. A store created by the 1.6 importer or a fresh 1.7.0 installation is already at the current schema.

  1. Stop Core and its workers. Keep a complete pre-upgrade recovery point (see Back up and restore).
  2. Switch to the new image or checkout.
  3. Run the migration for each missing version in order, starting at the next one (a schema 4 store runs only the last command). Each run verifies the authority, saves a snapshot at the previous version in the output directory, and commits the migration with its audit event:

    python -m live_mem.core.maintenance_cli migrate --to-version 2 \
      --confirm-core-stopped --output-directory /path/to/private-snapshots \
      --store-path /path/to/authority.sqlite
    python -m live_mem.core.maintenance_cli migrate --to-version 3 \
      --confirm-core-stopped --output-directory /path/to/private-snapshots \
      --store-path /path/to/authority.sqlite
    python -m live_mem.core.maintenance_cli migrate --to-version 4 \
      --confirm-core-stopped --output-directory /path/to/private-snapshots \
      --store-path /path/to/authority.sqlite
    python -m live_mem.core.maintenance_cli migrate --to-version 5 \
      --confirm-core-stopped --output-directory /path/to/private-snapshots \
      --store-path /path/to/authority.sqlite
    
  4. If this deployment has never had an operational volume (a candidate older than the operational store), provision it once before starting Core, as in step 4 of the 1.6 upgrade, with the same rule: never to replace a lost or damaged volume.

  5. Keep the snapshot taken before migration. Going back to the old image means restoring that snapshot and discards everything written after the upgrade.

Move an earlier 1.7 deployment to the single Core volume

A 1.7 deployment installed before the single Core volume keeps its Graph credential in hivemind_secrets and Graph's binding in a host graph.env.

  1. Stop Core, the worker and Graph, and update the Compose files.
  2. If the authority store is on schema 1, 2, 3 or 4, run the schema 5 upgrade first.
  3. Run the adoption job. With an existing store, it also republishes graph/graph.env on the Core volume after checking that the store admits the credential as its internal Graph credential. An interrupted job can be rerun:

    export COMPOSE_FILE=docker-compose.yml:docker-compose.auth17.yml
    docker compose run --rm hivemind-core-volume-adopt
    
  4. If this deployment has never had an operational volume, provision it once as in step 4 of the 1.6 upgrade, never to replace a lost or damaged one.

  5. Start the stack and verify it. Only then retire the host graph.env and the hivemind_secrets volume under your backup policy.

Earlier 1.7 candidates accepted the first OIDC sign-in of a pending installed or imported account through any active connection; 1.7.0 accepts it only through the connection assigned to the account under pending_user_connections. A link created before the upgrade stays active, so review those links once if the deployment ran a 1.7 candidate with an OIDC connection.

  1. List them read-only, with the connections file the deployment uses (the default is AUTH_OIDC_CONNECTIONS_FILE):

    python -m live_mem.core.maintenance_cli oidc-bindings-review \
      --store-path /data/core/authority.sqlite \
      --connections-file /data/core/connections.toml
    

    oidc_bindings_to_review lists, oldest first, each active link of an installed or imported account that is not on its assigned connection, with the user, connection, provider subject and linked_at. It prints no secret and changes nothing. 2. Examine the entries whose linked_at predates the upgrade. Confirm with each person that they signed in through that provider. 3. For a link nobody can confirm, suspend or delete the account; see offboard a person. Nothing is revoked automatically.

Verify

  • The MCP system_about result reports authority_source: store.
  • An operator signs in to the Portal, and Identity & Groups → Users shows the imported users and agents you expected from the report.
  • An imported 1.6 bearer still works for MCP: imported secret hashes, expiry and revocation are preserved.
  • If the deployment uses an external CRS WAF, a tenant member can issue a credential for their own agent through it.
  • Audit verification succeeds on the new store:

    docker compose run --rm --no-deps hivemind \
      python -m live_mem.core.maintenance_cli verify-audit \
      --store-path /data/core/authority.sqlite
    
  • Long memory carried over. For each space that has long memory documents, long_status (alias graph_status), called with an agent credential that can read the space, matches the result recorded in step 1: the same document_count, entity_count and relation_count in graph_stats, and the same provider, model and dimensions in both embedding_identity.configured and embedding_identity.persisted, with embedding_collection.state at ready. long_query on such a space answers from documents ingested on 1.6, without re-ingesting them.

  • The MID archive setting applies as decided: mid_automation.archive_eligibility in long_status is eligible for each space that should transfer its captures to long memory, and global_pause, not_allowlisted or space_disabled for the others.
  • The people still to sign in are the report's pending_users, and Identity & Groups → Users shows each account's status. The offline pending-users command lists only accounts Pending for at least 90 days, and deletes none, so it prints nothing in the first 90 days:

    docker compose run --rm --no-deps hivemind \
      python -m live_mem.core.maintenance_cli pending-users \
      --store-path /data/core/authority.sqlite
    

Then review the access the import created:

  • admin tokens with an email gave their user the operator role, and gave the user and the agent Manage grants on every common space that existed at import. They get no implicit access to spaces created later.
  • admin tokens without an email became system operator agents, the ones the report lists under imported_operators. Each holds the operator role itself and Read, Read + write and Manage on every common space of its tenant, including spaces created later, and on no personal space. No grant on a space carries this access, so it cannot be reduced space by space. Under Identity & Groups → Agents and credentials, suspend the agent to end it: suspension also stops work the agent already queued, which revoking its credential alone does not. To keep a client working, issue a new credential for the agent and revoke the imported one, or move the client to a standalone agent that holds only the grants it needs, then suspend the imported agent. Like every agent credential, an imported system operator runs no deployment operator tool through MCP: inference_self_test, admin_configuration, admin_audit_recent, space_create, long_connect and long_disconnect refuse it with auth17_operator_unqualified. Check inference readiness from a signed-in operator's Portal session instead. Permissions compares the two cases.
  • Owner grants are independent of the credentials they came from: revoking or expiring a credential does not revoke its owner's grants.
  • Imported tokens created without an expiry keep working until revoked.

Review and revoke explicitly; see identity and access.

Troubleshoot

Symptom Cause Fix
The apply refuses after a clean dry run. The space inventory or source changed since the dry run, or old services restarted. Stop every old service, rerun the dry run and review the new report.
The dry run or the apply refuses with import_unresolved_receipts. Live SHORT notes carry unsettled 1.6 receipts; notes lists them by space. Settle them with the 1.6 service, stop it again, rerun the dry run.
A Compose job stops with No such image: hivemind:latest, or runs the 1.6 image. HIVEMIND_IMAGE is not set in this shell. Export HIVEMIND_IMAGE and HIVEMIND_PULL_POLICY=never as in step 2.
The importer refuses for a missing Graph secret, or Core does not start. Step 3 was skipped. Run hivemind-core-volume-adopt with both Compose files.
Core does not start after the import: operational_identity. Step 4 was skipped: the operational volume was never provisioned. Provision it with hivemind-operational-init if it has never existed; if it existed and was lost, restore an operational snapshot instead.
Every Portal sign-in is refused. HTTPS is not attested: SITE_ADDRESS is not the public host name, or AUTH_BROWSER_TRUSTED_PROXIES does not hold the stack's network subnet. Complete step 10, then run scripts/authority-compose.sh again.
Long memory writes or searches fail after the upgrade. The embedding model or dimensions in .env differ from the ones the long memory was built with. Restore the 1.6 inference settings (step 2).
Graph does not start on an S3 deployment. S3_ENDPOINT_URL or S3_BUCKET_NAME is missing from the shared environment. Set both explicitly, with S3_REGION_NAME.
Core refuses the store at startup. An older image against a newer schema, or a store older than schema 5. Use the matching image, or run the schema 5 upgrade.
A pending user cannot sign in with OIDC. The user is not assigned to a connection, or the connection does not allow their email domain. Add the assignment under pending_user_connections with Core stopped, then restart Core.

More symptoms: Troubleshooting.

Next