This repository has been archived on 2026-07-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
core-hub/scripts/migration

Inter-Hub → Core Hub migration export

inter_hub_export.sql is a read-only query against the legacy Inter-Hub Postgres database (interhub on net-kingdom-pg) that emits a core-hub.migration.v1 bundle covering hubs, hubCapabilityManifests, apiConsumers, apiKeys (prefix + hash only, no plaintext), widgets, and interactionEvents. Field names are aliased from Inter-Hub's snake_case columns to the bundle's camelCase contract.

Run

kubectl exec -i -n databases net-kingdom-pg-1 -- \
  psql -U postgres -d interhub -tA < scripts/migration/inter_hub_export.sql \
  > interhub-bundle.json

# validate (no DB needed)
PYTHONPATH=src uv run python scripts/core_hub_cli.py migration validate interhub-bundle.json

# import into a target (CORE_HUB_DATABASE_URL); run in-cluster for staging
python scripts/core_hub_cli.py migration import --dry-run interhub-bundle.json
python scripts/core_hub_cli.py migration import interhub-bundle.json

The importer is idempotent (upsert by id): re-running updates in place, never duplicates. api_keys carry only keyPrefix + keyHash, so no secret material transits the bundle.