Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript
2.4 KB
Raw Blame

Upgrade to v0.60.52.0: PGLite to Postgres moves are graduations

gbrain migrate --to postgres (alias --to supabase) on a PGLite brain is a verified engine graduation. It carries the brain's full history (write requests, withdrawals, versions, takes, tokens and OAuth clients, with their IDs), so brains with write history and managed brains can move to Postgres.

The bare command stops at exit 3 for every PGLite to Postgres move, with or without history. It prints the plan as a confirmation_required document and changes nothing. A script or skill that ran gbrain migrate --to supabase --url <url> and expected the copy to happen must add the confirmation step.

Never run the move without the user's agreement.

  1. Finish the upgrade. gbrain upgrade runs it. To be sure, on the brain host:

    gbrain apply-migrations --yes --no-autopilot-install
    

    A schema migration adds the persistence_graduation table; no rows are rewritten.

  2. Move the URL out of the command line. Ask the user to put the target URL in GBRAIN_TARGET_URL (read -rs GBRAIN_TARGET_URL && export GBRAIN_TARGET_URL) and use --url-env GBRAIN_TARGET_URL everywhere.

  3. Plan and ask.

    gbrain migrate --to postgres --url-env GBRAIN_TARGET_URL --json
    

    Exit 3. Relay user_message and the what-moves / what-stays lists, then stop until the user agrees. --plan shows the same plan read-only (exit 0).

  4. Run. After the user agrees, run fix.command from the document:

    gbrain migrate --to postgres --url-env GBRAIN_TARGET_URL --yes --expect <plan_hash>
    

    preview_changed means the plan changed since the user saw it: plan and ask again.

  5. Afterwards. Check a stopped or background run with gbrain migrate --status --json; continue with gbrain migrate --resume. The PGLite data dir is kept as <path>.graduated-<run_id>; deleting it is the user's call. Existing tokens, OAuth clients and local writers stay valid.

gbrain config set migrate.graduation false sends the move through the legacy copier, which refuses brains with write history. Postgres to PGLite moves use the legacy copier. On Windows a brain with history stays on PGLite (graduation_unsupported_platform).

Full walkthrough, exit codes and recovery by error code: Move a PGLite brain to Postgres.