Files
Duriin-API/docs/postgres-migration.md
T

1.1 KiB

PostgreSQL migration

The Compose stack includes PostgreSQL with a hard 512 MB container limit and conservative in-server memory settings. Set POSTGRES_PASSWORD in the server .env, then start it with docker compose up -d postgres.

Run the resumable logical copy with:

docker compose --profile migration run --rm postgres-migrate

It copies archive data to the archive schema and autonomy/intelligence data to the intelligence schema. Each table is count-verified and progress is persisted in each schema's _migration_progress table, so restarting resumes at the last committed batch. SQLite vec0 internal tables are derived indexes; their canonical embedding data is migrated from article_embedding_store.

The application is intentionally not switched by this migration alone: it has SQLite-specific synchronous query and transaction code in the autonomy workers and admin routes. Pointing those processes at PostgreSQL before that code is ported would make the live system unreliable. Keep SQLite mounted until a separate verified runtime cutover is complete.