Skip to main content
Version: v5.6.1

opschain admin migrate-logs purge

Included from Basic tier

Starts the separate, operator-run deletion phase (migration copies, the operator deletes). The worker deletes log_lines ONLY for owners holding a verified evidence row — each owner is recounted against its evidence first, deleted in bounded batches, and stamped purged — so nothing unverified can ever be deleted, and a stopped purge resumes at its cursor.

Run it only after you have confirmed the blob store is accurate and captured by your backup cycle. Until the purge, every migrated owner is deliberately stored twice (verified segment beside source rows): that redundancy is the safety margin this verb spends.

Starting refuses while the migration is running (pause it or let it complete), while a purge is already active, and — the hard gate — while no verified, unpurged evidence exists. Owners whose rows drifted from their verified count are skipped loudly (warn:logs:migration) and left untouched.

Legal hold: an owner under an active legal hold — a legal-held evidence-ledger entry carrying a run citation for the owner's run (or node background task) — is excluded from the purge regardless of verification state. The worker skips it loudly (warn:logs:migration, action owner_held), leaves its log_lines untouched and its evidence row unstamped, and counts it in the completion verdict (owners_held), so a purge started after the hold lifts collects it. The exemption set is re-read every batch, so a hold placed mid-purge still bites. Holds are placed and lifted with opschain admin governance evidence hold|unhold.

Purge churn creates dead tuples at volume; log_lines is in the default maintenance churn set, and an on-demand admin database vacuum after a large purge reclaims the space promptly.

Flags​

FlagMeaning
--server <url>Server base URL (default: the active context / OPSCHAIN_SERVER).
--auth-token <token>Admin bearer token override (default: your opschain login session, then $OPSCHAIN_ADMIN_TOKEN, then the token stored by opschain admin login).

Prints the status document after the flip (-o json / -o yaml).

Exit codes​

CodeMeaning
0The purge was started.
1Refused (nothing verified, migration running, purge already active, store not PostgreSQL), request failed, or the token was rejected.
2Usage error — no server or no credential resolvable.

Named errors​

  • nothing is verified to purge — run the migration and let verification record evidence first — the evidence gate; exit 1.
  • the migration is running — pause it or let it complete before purging — exit 1.

Examples​

opschain admin migrate-logs purge

See also​

  • opschain docs cli/admin-migrate-logs-status — purge-complete is the purge phase reading completed.
  • opschain docs cli/admin-database-vacuum — reclaiming the space.
  • opschain docs cli/admin-governance-evidence-hold — placing the legal hold that excludes an owner from this purge.