Skip to content

Disk storage inventory for the PostgreSQL upgrade

PostgreSQL hosts can move application-owned SQLite side stores from Server Settings. Operator upgrade and rollback guide.

The migration unit is a logical store, not a directory or filename extension. For example, a workflow node can put its checkpoints into the same database.sqlite that an old application used. A PostgreSQL application can also have a local operator binding, a Git repository of flow versions, and an agent runtime with its own databases. Removing the volume after migrating ETL would lose data. Issue and agreed scope

The replacement test starts with three installations: fresh PostgreSQL, existing PostgreSQL with local side stores, and SQLite migrated to PostgreSQL. It signs in and exercises a saved flow, removes the original application directories, and starts a replacement web process and worker with the same durable configuration. The replacement signs in, runs a prediction with a synthetic model, uses a saved credential for a real read-only PostgreSQL tool call, and reads its attachment. All three cases passed locally and on a disposable Render service with a separate managed database. The hosted fixture used independent web and worker processes in one service. Replacement fixture

Recovery starts after verified cutover. If the sole source disappears between the SQLite application copy and side-store migration, restore the original files and key from backup. Keep every PostgreSQL schema in the backup. Active writers, insufficient privileges or space, an incompatible target and verification mismatches require operator action.

Finding Mitigation and verification
Legacy ETL file missing after replacement Owned legacy files are copied and retain their incremental identities. A missing source names the file to re-upload. New ETL panel uploads use PostgreSQL. ETL recovery test
Local application uploads or attachments The web server and workers bind to the same PostgreSQL file store after cutover. With S3, legacy local files must match the bytes at the target keys. An absent or different object blocks cutover. Record the external bucket in the backup plan. File migration
Missing settings flag or partial PostgreSQL restore Startup checks the durable settings and migration markers. A missing control row or required table stops startup. Restore the full database, correct key and host boot settings. Startup checks
Older flow versions or disconnected Git synchronization PostgreSQL retains authoring history, named refs, sync receipts and connection settings. An empty checkout is reconstructed and can restore a historical revision. History recovery test
Analyst workspace or runtime session lost A new SQL query provisions the Analyst workspace. Rerun the flow that populated it. A replacement can recover committed runtime session history. In-progress turns can require a retry.
  • Migration window. The SQLite application copy and the side-store cutover are separate operations. The primary copy requires an empty destination and the supported source schema. Preserve the original key, application files, custom settings and all SQLite stores together before any deploy that replaces the original instance. Resume and rollback use source files and checksums. Keep an off-host restore copy through the rollback window. The cutover pauses for active writers, other members, insufficient disk space or privileges, conflicting source copies and failed verification. Existing PostgreSQL installations can still have local side stores. A fresh application whose schema migrations completed before storage activation can also enter the existing-install path on retry. Operator procedure
  • Host identity and startup. A replacement needs the PostgreSQL connection and TLS material, storage selection and original installation key on every applicable process. A rotated installation also needs its active credential generation. A separate settings database, external object store or Redis queue needs its own durable service and host configuration. Changing the database connection fingerprint can require host proof to recover instance-operator administration. The host still needs writable scratch space for Git, runtime profiles, staging and logs. Key verification · Operator binding
  • External workers. The harness worker and BullMQ worker bind the application stores before accepting work. An empty-disk fixture signs in, runs a credential-backed prediction, opens the saved SQL credential from an independent worker process, calls the SQL tool, and reads a stored attachment.
  • Workflow and runtime inputs. Live and draft graphs and stored ETL versions report external file inputs. Supply immutable files with the deployment and verify their manifest on each instance. Move mutable stores to an appropriate service or retain their volume. Plugins with unknown dependencies stop cutover for operator review. Operator-authored tool code may compute additional paths and needs a representative run. Operator options
  • Analyst. The first new query provisions an isolated PostgreSQL workspace. Rerun the analysis to rebuild SQLite working tables. Retain existing PostgreSQL credentials, their encryption key and role permissions.
  • Versioning and exports. PostgreSQL restores main, secondary named refs, GitHub connection and environment settings, and sync receipts. An authenticated download route serves chat export attachments on object storage. Retain external logs separately if required. Version recovery
  • Deployment evidence. Run the replacement fixture on fresh PostgreSQL, an existing split installation, and an offline SQLite copy. Each must recover the same login, workflow and credential-backed service with empty application and worker directories. The checked-in production Blueprint uses a persistent disk. The hosted gate uses a separate disposable project.

After the storage upgrade, the runtime commits session transactions to PostgreSQL. A replacement can recover acknowledged runtime messages. Pending deliveries and delegated results may still need a retry. Configurations saved through the runtime can be restored. A direct write from a host shell still relies on that host’s filesystem.

Root Resolution and deployment implications
Application SQL The SQLite application driver resolves DATABASE_PATH/database.sqlite, with the user’s .cuttlely directory as fallback. The PostgreSQL driver uses its configured database and schema. See packages/server/src/DataSource.ts.
Cuttlely data CUTTLELY_DATA_DIR, normally the checkout’s .cuttlely for the harness package. Other packages have different fallbacks. Compose sets this to /var/cuttlely and sets DATABASE_PATH and SECRETKEY_PATH to /var/cuttlely/data. Enumerate both when overridden.
Server settings settingsDir() in packages/server/src/settings/store.ts resolves the settings directory. The saved-settings PostgreSQL connection has its own URL and allowlist. Selecting PostgreSQL for the application and selecting PostgreSQL for server settings are separate operations.
ETL CUTTLELY_ETL_DIR or the etl directory under the Cuttlely data root. Local vector collections live under its vectors directory.
Agent profiles CUTTLELY_HERMES_HOME or the hermes directory under the Cuttlely data root. The Python runtime resolves its own HERMES_HOME and profile context. Walk the runtime root and every profile, including draft, Try, parked and recovery directories.
Secrets and versions SECRETKEY_PATH or the user’s .cuttlely directory for generated auth secrets. CUTTLELY_VERSIONS_DIR or the versions directory under CUTTLELY_DATA_DIR, falling back to the user’s .cuttlely/versions. Preserve the hidden .git directory.
Other mounts Include BLOB_STORAGE_PATH, LOG_PATH, absolute node inputs, user-supplied file outputs, external workers’ mounts, and operator-configured plugin, browser and backup roots. Resolve container paths in the respective container.
File or family Owner and contents Upgrade accounting
database.sqlite Application TypeORM entities, including flows, credentials, identity and execution data. packages/server/src/DataSource.ts and database/migrations/sqlite. Already selects the application driver. Preserve any old file and identify additional tables owned by workflow nodes before assigning it to a migration. Harness credential reads use the registered app source on the server. Offline credential reads can still open the file.
etl/etl.sqlite packages/etl/db.mjs and store.mjs. Pipelines, versions, runs, run events, sources, records, schedules, vector_ids, shadow_vectors, rejects, batches, run_nodes, lineage and run_names. Copy IDs, fingerprints, vectors’ external IDs, timestamps, sequence ordering, retry and schedule state. Verify keys and content as well as counts. Repeat an incremental run over unchanged input and verify zero new embeddings. The internal PostgreSQL backend is in store-postgres.mjs.
etl/vectors/<collection>.sqlite packages/etl/stores.mjs. One local vector collection per file. The ETL Local vector node reads these collections too. Move existing vector values, IDs and metadata intact. Test search parity without requiring pgvector. A successful ETL metadata copy alone does not verify collection data.
harness-queue.sqlite packages/harness/lock.mjs and schedule.mjs. Shared admission and turn leases, queued work, schedules and run history. Coordinate all workers during migration. Preserve schedule and history IDs, classify lease ownership and expiry, and test deferred schedules and competing workers.
profiles/<profile>/sessions.sqlite and harness-draft-sessions/<scope>/sessions.sqlite packages/harness/session.mjs. Published and unpublished Cuttlely conversations. Legacy/alternate paths are resolved by the same module. Preserve workspace, canvas, conversation ownership and per-profile identity. Exercise publish, Try, restart and cleanup independently.
dashflows.sqlite and dashflows.sqlite.migrated packages/harness/dashflows.mjs and dashflows-postgres.mjs. Dashboard definitions, draft and published snapshots, refresh leases/status, public report slots and query cache. Existing opt-in pilot copies durable state, keeps the old file, and deliberately omits the query cache. Reconcile its existing migration markers and both-file recovery cases with the single upgrade screen.
side-store-backups/storage-backup-*/store.sqlite and store.sqlite.migrated The upgrade snapshots each selected side store and separately retains each published profile’s verified original. Temporary working copies apply legacy migrations. Keep private with the volume backup. The application retains backups and adjacent read-only *.migrated sources until the operator removes them.

| analyst.db and analyst-<workspace-tag>.db | packages/harness/runtime/analyst-store.mjs. Legacy and per-area Analyst data. PostgreSQL-backed Analyst uses its configured store. | Detect the legacy area as well as tagged files. Account for role secrets and any separate Analyst PostgreSQL connection. Do not count these as application database files. | | User-selected SQLite agent memory and record manager | packages/components/nodes/memory/AgentMemory and nodes/recordmanager/SQLiteRecordManager. SQLite savers/checkpoints and indexing records can coexist with database.sqlite. | Inventory the actual node definition and tables. Preserve explicit workflow-owned destinations. SQL Database Chain also accepts SQLite inputs, which require separate ownership checks. | | Demo, user script and connector databases | packages/server/src/services/demo, samples/demo and custom node/plugin code. Demo examples include bakery.sqlite, fulfillment.sqlite and support.sqlite. User code can choose a path and extension. | Distinguish a shipped seed from a writable installed copy. Preserve custom data and external inputs. Require an explicit mapping before offering migration or removal. |

SQLite also writes companion files named _-wal, _-shm and *-journal, depending on journal mode and activity. Treat these and recovery or renamed copies as members of the same store. A live WAL can contain committed rows absent from the main file. Take a consistent SQLite backup or quiesce every writer before copying. Keep old and verified destination inventories for rollback.

The set of stores depends on the runtime version, enabled features, profile and plugins. The runtime uses writable scratch space on each host. PostgreSQL recovers its session database after cutover. Other local stores listed here need a separate backup if their contents must survive host replacement.

File or family Writer or feature Data to retain
state.db, including each profile copy hermes/hermes_state.py, hermes_state_dbfile.py, gateway/lifecycle_ledger.py, gateway/delivery_ledger.py PostgreSQL holds verified runtime session images after the side-store upgrade. The runtime commits changed blocks before acknowledging a session write. Undelivered replies and task results still depend on their delivery stores.
shared-state.db hermes/gateway/hosted_rooms.py Shared hosted-room state. The legacy importer also reads state.db.
response_store.db and runs_idempotency.db hermes/gateway/platforms/api_server.py and api_server_run_idempotency.py API responses/history and idempotent run requests.
cron/executions.db, cron/deliveries.db, cron/notepad.db hermes/cron/executions.py, delivery_queue.py and notepad.py Execution history/incidents, pending deliveries and cron notes. Pair with cron/jobs.json.
kanban.db, kanban/boards/<board>/kanban.db, configured HERMES_KANBAN_DB hermes/hermes_cli/kanban_db.py Default and named board state. Include board.json and board-specific files.
projects.db, verification_evidence.db hermes/hermes_cli/projects_db.py and hermes/agent/verification_evidence.py Project registry and verification audit trail.
gateway/discord_message_recovery.db Runtime backup inventory in hermes/hermes_cli/backup.py Optional or legacy Discord reconnect ledger. Presence in a backup list warrants preservation even if the current connector has no active writer.
memory_store.db, retaindb_queue.db hermes/plugins/memory/holographic/store.py and retaindb/init.py Optional local memory and durable queue for external memory writes. The holographic plugin accepts a custom database path.
telemetry/shared_metrics/metrics.sqlite3 hermes/hermes_cli/observability/shared_metrics.py and relay_shared_metrics.py Optional metrics data with a corresponding outbox.
Recovery and export databases hermes/hermes_cli/session_recovery.py, session_lost_and_found.py, backup_sqlite.py, kanban_transfer.py lost_and_found.db, temporary probe.db, user-named recovered databases, staged board imports and snapshot copies. Retain recovery output separately from live stores.
Browser profiles and external tools Runtime browser connector, optional plugins and subprocesses A browser profile can include extensionless SQLite stores such as Cookies and History. The runtime backup explicitly excludes browser_profiles. Record external roots and apply their own backup policy.
Item Source after replacement When it returns
Node manifest (nodes-manifest.json) Installed node and credential packages The server scans the packages at startup when the manifest is absent.
Runtime cache/tool_discovery_cache.json and cache/schema_columns.json in the runtime home or a profile Installed tool modules and the runtime’s compiled-in schema definition Tool discovery and schema initialization regenerate the respective files on demand. The schema cache contains expected columns. The live database holds the records.
Buffer Memory and Buffer Window Memory Saved chat messages in the application database, keyed by flow and session The next read loads the full history or the configured window. Preserve the underlying rows and referenced attachments.
Dashflows query cache Configured data source and query The next refresh fetches a fresh result. Preserve published snapshots, dashboard definitions and refresh state during migration.

Configuration, credentials and adjacent disk state

Section titled “Configuration, credentials and adjacent disk state”
File or family Writer and purpose Disposition on PostgreSQL
settings/server.json, server.last-good.json, server.rolled-back.json, database.previous.json Server settings save, safe boot, rollback and database switch. Can contain encrypted fields. Retain as one recoverable generation with the installation key. Eligible for the separate settings PostgreSQL store.
settings/history.jsonl, boot.json, apply-when-idle.json, authkit-test.json, it-worked.json Settings audit, boot recovery, pending apply, sign-in proof and onboarding marker. All five are in POSTGRES_SETTINGS_FILES. Distinguish audit retention from restart coordination.
settings/instance-operator.json, operator-claim.json, operator-installation.json Operator binding, claim and installation identity. Private entries in the settings PostgreSQL allowlist. Preserve disabled/revoked state as well as active bindings. See packages/server/src/settings/postgres.ts.
setup-instance.id, setup-issuer.json, setup-issuer.lock packages/server/src/identity/setupCode.ts. Installation and setup-code issuance tracking. Account separately from the settings allowlist. Lock ownership belongs to a running process.
encryption.key, analyst-role.enc, analyst-role-<tag>.enc, credential-rotation.json Server credential encryption, legacy or scoped Analyst secrets and the offline rotation journal. Preserve keys separately under controlled access, along with generation metadata and staged files. Changing SQL drivers does not reissue keys.
jwt-auth-token.secret, jwt-refresh-token.secret, express-session.secret, token-hash.secret, jwt-issuer, jwt-audience Authentication secrets and token identity. When PostgreSQL settings are active, bootstrap retains the six values in an encrypted database document. Supply the installation encryption key from the host.
Operator-supplied secret files and hash-password output packages/server/src/identity/initialOwner.ts reads configured password/hash files. The hash command can create a new file at a caller-selected path. Inventory paths and access constraints without collecting values. Treat external secret-manager references separately.
session-grants.json packages/server/src/utils/sessionOwnership.ts. Local ownership grants written atomically under CUTTLELY_DATA_DIR, BLOB_STORAGE_PATH or the user’s .cuttlely. Preserve and reconcile with authorization after restore. This file is distinct from login cookies and harness sessions.
harnesses/<name>.json and <name>.json.deleting Saved team definitions, workspace/canvas identity and staged deletes. The operator upgrade verifies the source bytes in PostgreSQL. Web and worker instances read and update the shared rows after cutover. Rollback needs the original files.
Profile config.yaml, .env, harness-roster.json, SOUL.md and skills/**/SKILL.md packages/harness/profile.mjs writes compiled chief/specialist/Try configuration, credentials, roster and prompts. Runtime users can also author prompts, skills and configuration. Classify by creator. Preserve user-authored overrides and protect profile .env. Check regeneration of compiled files with the same identities and bindings.
harness-parent, harness-compiler, harness-try, harness-try-keep, harness-try-flow, harness-try-owner, harness-try-session and *.owner Profile compiler, Try lifecycle and cleanup. These extensionless files affect ownership, compilation and cleanup. Preserve scope during recovery.
Runtime config.yaml, .env, auth.json, vault.key, vault.json.enc, profile and plugin manifests hermes/hermes_cli/config.py, profile commands, runtime auth and local vault. Includes optional provider/plugin-specific JSON, TOML, YAML, CLI and service configuration under their configured homes. Retain authored configuration, credentials and vault/key pairs. Enumerate optional plugins and external homes for the installation. Do not export secret values in the inventory.
cron/jobs.json, channel_directory.json, channel_aliases.json, processes.json, pairing/, platforms/pairing/, feishu_comment_pairing.json, board.json Runtime scheduler, gateway, pairing and Kanban. See the quick-state manifest in hermes/hermes_cli/backup.py. Preserve schedules, bindings and authorizations. Reconcile process records against the new host before starting work.
gateway_state.json, gateway.lifecycle.json, hermes-supervisor.json, PID, stop, heartbeat, lock, and temporary files Runtime gateway and Cuttlely supervisor, SQLite maintenance, settings atomic writes, .settings.lock, .history.lock and .it-worked.lock. Record existence and owning process. Quiesce first. Recreate process-local coordination on restart. Preserve evidence of incomplete writes or recovery.
versions/.git/config, versions-github.json, versions-environment.json, flow/layout/edges/node JSON and Git objects/refs packages/versioning/src/index.ts and github.ts store version history and remote configuration. Includes per-team/per-flow layout when present. The upgrade stores main history in PostgreSQL as verified Git bundles, preserving revision IDs. Optional GitHub settings, environment selection and non-main refs still need separate preservation.
Project .env, packages/server/.env, Compose –env-file, service and database configuration Host/installer inputs to launch scripts and packages/cli. Runtime-generated profile .env has a different owner. Preserve host configuration through its owner or secret manager. The CLI also writes a check report to an optional caller-selected JSON path.
Snapshots, migration journals, backups and staged restores Runtime backups/state-snapshots, ETL/Dashflows migration artifacts and key-rotation staging. May contain another copy of every file above. Record original and copy separately. Protect archives and retain until the operator accepts rollback expiry.
Logs, caches, uploads, assets, reports and plugin output LocalStorageProvider, NodesPool, runtime cache and plugin writers. Includes server-requests.log.jsonl, audit logs, nodes-manifest.json, tool discovery and schema caches, screenshots and user uploads. Identify reproducible caches separately from user data and audit records. An uploaded JSON or SQLite file remains user content. Account for object-store-backed installations and local spill paths separately.
Family Examples and evidence Accounting
MCP and specialist settings Generated MCP server definitions in profile config.yaml, role and gateway bindings in profile .env, shared analyst-mcp.json status and its lock. See packages/harness/profile.mjs and runtime/analyst-mcp-status.mjs. Preserve the credential source and profile identity. Rebuild transient readiness state and exercise tool discovery.
Provider and memory integrations mem0.json, honcho.json and the optional external ~/.honcho/config.json. See hermes/plugins/memory and hermes/hermes_cli/backup.py. Record the selected provider, configuration root and credential owner. An external copy can take effect when a profile-local file is absent.
Runtime customization and package management skin.yaml, SKILL.md, plugin.yaml/plugin.yml, distribution.yaml, profile.yaml, manifests and lockfiles, optional config.toml and generated service-unit configuration. Separate installed defaults, local overrides and downloaded plugins. Preserve custom instructions and pin the installed version when rebuilding. A copied plugin can itself write arbitrary files.
Runtime caches and identifiers tool_discovery_cache.json, schema_columns.json, plugin-update-checks/*.json, gateway.lifecycle.json, install_id, .clean_shutdown, state maintenance locks and cron heartbeat files. Retain inventory evidence. Treat install identity separately from cached discovery results and process-local locks.
User-selected outputs and host integrations CLI check –json path, password hash –output, flow exports, external Git configuration, browser profiles and tools that write a caller-supplied path. Record configured destinations per instance and worker. Filename extensions do not identify authority. Collect metadata only for credential-bearing paths.

Run the source and disk audits of the inventory script from the checkout. Direct the CSVs to a private directory outside the inspected roots.

Terminal window
python3 scripts/storage-inventory.py source > "$audit_dir/source-evidence.csv"
python3 scripts/storage-inventory.py families > "$audit_dir/path-families.csv"
python3 scripts/storage-inventory.py disk "$data_root" "$additional_root" > "$audit_dir/local-files.csv"

Source mode indexes path literals and file/database API references in tracked implementation and deployment files with source locations. Families mode groups literal candidates by scope and lists the referencing source files. The evidence CSV preserves individual line numbers and writer operations for review. Test and fixture paths use a separate label where their naming identifies them. A reference can be a reader, example, restore path or writer. Dynamic destinations require inspection of the caller. Disk mode records every regular file, symlink and special entry under the explicit roots using metadata only. It includes hidden and extensionless files and does not traverse symlink targets. Inventory separately mounted targets explicitly. Collect a baseline and repeat after exercising each feature and restarting the processes. Paths alone cannot prove which process wrote a file, content parity or successful migration.

For overall upgrade testing use synthetic data in a separate disposable Render project. Provision the lowest-cost database and application resources suitable for the scenario, add a worker or disk only when needed and record their IDs at creation. Use independent secrets, volumes and databases. Delete the test project and all test resources after the run and verify their removal by those IDs. Exercise clean SQLite and PostgreSQL installs, an existing split-store upgrade, an interrupted copy and resume, rollback after a new write, an external worker, overdue schedules and a restart with the old files read-only. Reconcile each file against the store tables, local-retention policy or a named external owner; keep unrecognized files for investigation. Compare actual rows and content digests under a consistent snapshot. Verify unchanged embeddings, authorization and a real conversation after cutover. A clean data directory alone cannot validate an existing-install upgrade.