Migrate public v2.0.0 to v3.0.1
A controlled upgrade that preserves persistent data, custody and a verified recovery path.
1. Identify the installation and release
This guide concerns the public v2.0.0 schema 195 and release schema 217. Inspect the actual ledger and image identities first. Do not apply a private migration with the same number. If your starting schema/dirty state differs, reconcile that exact state before continuing.
Use the accepted backend and matching console, pinned to immutable identities. Use the published versioned images ghcr.io/clavex-eu/clavex:3.0.1 and ghcr.io/clavex-eu/clavex-frontend:3.0.1, or their verified immutable digests. Do not use latest, download a guessed tag, or replace a private installation with this public distribution.
2. Preserve custody and configuration
Inventory DB owner/migration/runtime/operator roles, grants, extensions, schema ownership, configuration references and all application writers. Protect installation KEK, signing/encryption keys, subject-digest custody where used, existing licence trust/state, federation registrations and conformance configuration. Row counts do not prove encrypted data usable.
Do not rotate keys to make an upgrade start. Do not regenerate any key needed to decrypt existing data. The server verification key is not a licence issuance key; private licence generation/signing material is outside the public distribution.
3. Quiesce and take the authoritative backup
Stop all backend replicas, workers and scheduled writers. Prevent old replicas from restarting or reconnecting. Take the final consistent PostgreSQL backup after write quiescence, with the required role/grant recovery package and configuration references. Verify checksum, restore format, access restrictions and an isolated restore. Keep the backup outside Git and retain it after upgrade.
Redis is not disposable as a whole: distinguish browser transactions from revocation, replay protection, queued audit/events and other state. Never use indiscriminate FLUSHALL/FLUSHDB, and never make revoked credentials valid again by deleting their denial state.
4. Apply the authentic public migrations
The public release embeds migrations 196 through 217, after public 195. They cover workload trust and delegation authority, common federation identity/custody and national/enterprise adapters, OpenID Federation, SIEM continuity/compatibility and the final experimental wallet grant column. Apply them using the matching released migrator and the authorized migration role, not the application runtime login.
# migration.env is operator-provisioned and protected (0600), not committed.
# It contains CLAVEX_DATABASE_DSN and required configuration, using migration custody.
docker run --rm --network "$CLAVEX_NETWORK" \
--env-file migration.env --entrypoint /migrate "$BACKEND_IMAGE" version
docker run --rm --network "$CLAVEX_NETWORK" \
--env-file migration.env --entrypoint /migrate "$BACKEND_IMAGE" up
Record each applied migration and verify 217, dirty=false. On a failure stop, preserve diagnostics and keep writers stopped. Do not force a ledger version, clear dirty state blindly, reset the database or improvise destructive repair. Do not use automatic down migrations as a recovery plan.
REL-04 retains representative 195→215 and integrity evidence; the packaged additive 215→216 step was also rehearsed. Those fixtures do not prove every customer database or a nonempty wallet-grant upgrade.
Migration 217: experimental PQC transition
Drain all old replicas before migration; mixed-version serving is unsupported. Preserve a consistent pre-upgrade database snapshot, configuration and installation KEKs. Migration 217 invalidates legacy experimental ML-DSA keys without converting them; classical and valid native keys are preserved. PQC remains disabled by default, with replacement generation following the enabled distribution lifecycle. Never force a migration rollback after native transition: rollback requires the pre-upgrade snapshot and matching old software, configuration and KEKs. Published upgrade constraints.
5. Correct the console/API deployment
The same console image now works on independent hostnames. Default API requests are relative to its own origin. Route /api/v1 on the console host to the backend and static pages/assets to the console. Keep all issuer/protocol routes and callbacks on their configured backend host; do not send them to an SPA fallback.
For a separate API origin:
# Public configuration; never put credentials here.
docker run --name clavex-console --env CLAVEX_API_ORIGIN=https://id.example.test \
--publish 127.0.0.1:8081:8080 "$FRONTEND_IMAGE"
For Helm use frontend.apiOrigin; an empty value selects same-origin API routing. Configure an exact backend console CORS allowlist, appropriate secure cookies and explicit CSP connect-src permission when using different origins. Do not use wildcard credentialed CORS or weaken authentication to solve routing. HTTPS consoles reject an HTTP API origin. No image rebuild is required.
6. Migrate automation and commercial configuration
Replace management password helpers with explicit authorized credentials. A normal OAuth application access token is not automatically an administrative JWT. API keys do not bypass privileged-operation policies. Review SDK/state changes with automation; use import and a non-destructive second plan for Terraform-managed existing resources.
A Business/Enterprise entitlement is required for new BYOK imports/replacements and paid integration expansion. Existing key use, verification/decryption/JWKS and security administration survive entitlement loss. New WS-Fed authentication/issuance stops after the effective entitlement/grace window, while metadata/logout survive. Previously authorized SIEM delivery/retries continue; new destinations, expansion or reactivation require entitlement. Exact edition rules.
Sentinel Logs Ingestion conversion is an explicit compatibility item: provision the approved credential reference, endpoint, DCR immutable ID and stream, preserving destination restrictions and queued event continuity. Do not silently reinterpret an old workspace/shared-key configuration as a new authorized destination.
7. Start and accept the installation
Start the exact released backend with the existing custody references; start the matching console. Verify readiness plus authenticated administration, retained organizations/users/roles/apps, licence state, decryptability and actual key use. Test fresh application login, PKCE, refresh/logout, existing federation metadata/certificates, audit and monitoring before restoring normal access.
Provider IDs, local subjects, registered EntityIDs/ACS/certificates and existing bindings must remain stable. Legacy identity compatibility is controlled per adapter; never bulk-link by email or create duplicate users to pass a smoke test. Experimental profiles remain disabled unless explicitly enabled by an authorized administrator.
8. Recover safely if needed
For material corruption, unusable encrypted data or an unrecoverable authentication/authorization defect, keep writes controlled and use the verified backup/recovery procedure. Do not run an old binary against an incompatible new schema or restore over new writes without accounting for them. A2D authority requires its separate signed recovery/activation process, not only an image rollback. Recovery operations.
Clavex 3.0.1 is publicly available. Release scope · Evidence and limitations · Editions and licensing