This runbook describes the recommended operational flow for backing up, validating, and restoring virtual volumes.
Every reliable backup should be:
- SQLite-consistent
- verifiable before restore
- compatible with the current runtime
- restorable with safe rollback if an overwrite fails
A standard backup produces two files:
<name>.sqlite<name>.sqlite.manifest.json
The sidecar manifest contains:
formatVersionvolumeIdvolumeNamerevisionschemaVersioncreatedWithVersionbytesWrittenchecksumSha256createdAt
Restore remains compatible with legacy backups that only contain the .sqlite file, but in that case manifest validation is skipped.
Command:
virtual-volumes backup <volumeId> <destinationPath>Example:
virtual-volumes backup vol_finance_01 ./backups/finance.sqliteTo overwrite an existing artifact:
virtual-volumes backup vol_finance_01 ./backups/finance.sqlite --forceThe command fails if the destination path matches the live managed database for the volume.
Recommended command before any restore:
virtual-volumes inspect-backup <backupPath>Example:
virtual-volumes inspect-backup ./backups/finance.sqliteThe preflight validates:
- SQLite backup readability
- SHA-256 checksum of the
.sqlitefile - consistency between the sidecar manifest and the actual artifact
createdWithVersioncompatibility with the current runtimeschemaVersioncompatibility with the current runtime
If any of these checks fail, restore should not be executed.
For a safe and repeatable recovery-path test without touching the live data directory, also use:
virtual-volumes restore-drill <backupPath>The drill:
- runs
inspect-backup - restores the backup into an isolated temporary data directory
- runs
doctoron the restored volume - removes the sandbox afterward unless
--keep-sandboxis requested
Use the standard restore when the target volume no longer exists in the data directory:
virtual-volumes restore <backupPath>Example:
virtual-volumes restore ./backups/finance.sqliteUse --force only when you want to replace an existing volume with the state from the backup:
virtual-volumes restore <backupPath> --forceThe runtime performs:
- a consistent snapshot of the existing target volume
- a swap to the restored database
- automatic rollback if the swap or final validation fails
manifest mismatchThe sidecar no longer matches the.sqlitefile, and restore is blocked.newer CLI major versionThe backup was created by a newer runtime major line and is rejected.newer schema versionThe backup requires a schema version not supported by the current runtime and is rejected.volume already existsStandard restore never overwrites an existing volume without--force.
For a routine backup:
- Run
virtual-volumes backup. - Immediately run
virtual-volumes inspect-backup. - Run
virtual-volumes restore-drillwhenever you want to validate the recovery path without touching live data. - If you need an operational audit trail, add
--output <path>to save the command's JSON artifact. - Keep
.sqliteand.manifest.jsontogether.
For routine maintenance of a volume's SQLite database:
- Run
virtual-volumes doctor <volumeId>to verify that the volume is healthy. The report also includes SQLite metrics, top compaction candidates ordered by reclaimable bytes, fleet-widerepair-safeposture, blob reference-count mismatches, and aCOMPACTION_RECOMMENDEDwarning when the volume has enough free pages to justify maintenance. - Run
virtual-volumes compact <volumeId>to force WAL checkpointing,VACUUM, andPRAGMA optimize. - If you want to track the maintenance action, add
--output <path>and keep the compaction artifact. - Run
virtual-volumes doctor <volumeId>again if you want to validate the volume after compaction. If blob reference-count mismatches are detected,virtual-volumes doctor --fixrealigns them without touching file contents.
For batch maintenance of all managed volumes:
- Run
virtual-volumes compact-recommended --dry-runto see which volumes would be compacted. The dry run also shows detailedplanned,blocked,filtered, anddeferredvolumes, with an explicit operational reason for each one. The report also quantifies reclaimable free bytes per bucket so you can estimate the expected batch impact immediately. - If you want to reduce blast radius, add
--limit <n>to process only the top N volumes ordered by reclaimable free bytes. - If you want to cap the batch by size, add
--max-reclaimable-bytes <bytes>to stay within the cumulative reclaimable-byte budget. - If you want to narrow the batch even further, add
--min-free-bytes <bytes>and/or--min-free-ratio <ratio>to include only volumes above explicit minimum thresholds. - By default, the batch blocks volumes that also have issues other than
COMPACTION_RECOMMENDED; use--include-unsafeonly when you explicitly want to force compaction on volumes that are still diagnostically unhealthy. - Run
virtual-volumes compact-recommendedto compact only the volumes currently marked withCOMPACTION_RECOMMENDED. If you want to use the batch in automation, add--strict-planso it fails whenblocked,filtered,deferred, orfailedvolumes remain. - If you want structured auditing, add
--output <path>to the batch command as well. - Run
virtual-volumes doctoragain if you want to confirm that the recommended fragmentation has been absorbed.
For fleet-wide batch remediation of safe drifts:
- Run
virtual-volumes repair-safe --dry-runto see which volumes have only auto-repairable drifts. - If you want stricter payload validation, add
--verify-blobs. - If you want to limit the operational batch, add
--limit <n>. blockedvolumes also have non-safe findings and are not auto-repaired by the batch.- Run
virtual-volumes repair-safeto apply only the planned safe repairs. - If you use the batch in automation, add
--strict-planso it fails whenblocked,deferred, orfailedvolumes remain. - Run
virtual-volumes doctor --verify-blobsagain if you want deep validation after remediation.
For an emergency restore:
- Run
virtual-volumes inspect-backup. - Run
virtual-volumes doctoron the current system if the volume still exists. - Run
virtual-volumes restoreorvirtual-volumes restore --force. - If you need to track the operation, use
--output <path>on the executed commands. - Run
virtual-volumes doctor <volumeId>after restore. - Open the volume and validate at least one known file or key directory.
For escalation or handoff to technical support:
- Run
virtual-volumes support-bundle <destinationPath> [volumeId]. - If you want the embedded report to use deep payload scrubbing, add
--verify-blobs. - If you are working on a suspicious backup or restore, add
--backup-path <backupPath>. - If the bundle needs to be easier to share, use
--no-logsto exclude app and audit snapshots. - Run
virtual-volumes inspect-support-bundle <destinationPath>to verify bundle integrity and checksums. - If the bundle must leave the organization or you want a high-confidence handoff, use
virtual-volumes inspect-support-bundle <destinationPath> --require-sharing external-shareable --require-integrity-depth deep. - If the handoff remains internal, you can still enforce
--require-sharing internal-only --require-integrity-depth metadatato block bundles without valid guidance or with insufficient verification depth. - Share the generated folder, which includes
manifest.json,checksums.json,doctor-report.json,handoff-report.md, optionalbackup-inspection.json, an optional copy of the backup manifest, and, unless excluded, tail snapshots of the current logs. - If you use
VOLUME_REDACT_SENSITIVE_DETAILS=true, the internal JSON reports in the bundle are also redacted before sharing. - Check the bundle
contentProfileor theinspect-support-bundleoutput to determine whether the artifact isexternal-shareableorinternal-only. - Follow
recommendedRetentionDaysand the bundledisposalNotesto avoid leaving diagnostic artifacts around longer than necessary. - Use
handoff-report.mdandaction-plan.jsonas the operational starting point: they now include integrity depth, compaction/repair-safe fleet posture, and suggested next actions. - If
inspect-support-bundlereports that the retention window has been exceeded, regenerate the bundle before the handoff instead of sharing a stale artifact.
To raise operational readiness, schedule a regular drill:
- create a backup of a real volume
- validate the backup with
inspect-backup - run
restore-drill - if the drill must remain inspectable, repeat it with
restore-drill --keep-sandbox - validate contents, revision, and key files
For every backup and restore, keep at least:
- operation timestamp
- executed command
- CLI version that generated the report
volumeIdrevisionschemaVersioncreatedWithVersionchecksumSha256inspect-backupresult- post-restore
doctorresult