Skip to content

Dns migration#726

Open
godot wants to merge 1 commit into
masterfrom
dns-migration
Open

Dns migration#726
godot wants to merge 1 commit into
masterfrom
dns-migration

Conversation

@godot

@godot godot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

New commands for customers migrating instances from the shared stack to private-stack portals:

  • dns export: snapshot all domains/DNS records to a versioned JSON backup
    (pos-cli/dns-export/v1), bulk via --instances-file
  • dns migrate : export -> transform -> apply portal-to-portal via
    /api/domains, then print per-domain cutover instructions (registrar NS for
    domain-full, SSL validation records + CNAME/A targets for domain-external);
    source portal is read-only, a backup is always written before any POST;
    bulk cohorts via --mapping-file / --instances-file --match-by-domain
  • dns import --file: apply a saved export (same transform/safety rules,
    offline --dry-run)
  • dns compare: parity verification (OK/ADVISORY/CRITICAL), expected cross-stack noise normalized (MX case,
    TXT quoting/chunking, nameservers, data_center); exit 1 on real drift

@godot
godot force-pushed the dns-migration branch 2 times, most recently from 882bf1d to 580cf08 Compare July 24, 2026 09:39
New commands for customers migrating instances from the shared AWS stack
(partners.platformos.com) to private-stack portals:

- dns export: snapshot all domains/DNS records of an instance to a versioned
  JSON backup (pos-cli/dns-export/v1)
- dns migrate <source> <target>: export -> transform -> apply portal-to-portal
  via /api/domains, then print per-domain cutover instructions (registrar
  nameservers for domain-full, SSL validation records + CNAME/A targets for
  domain-external)
- dns import --file: apply a saved export (offline --dry-run supported)
- dns status: show each domain's provisioning status and pending cutover steps
- dns compare: parity verification (OK/ADVISORY/CRITICAL) with expected
  cross-stack noise normalized (MX case, TXT quoting/chunking, nameservers,
  data_center); --drop-value mirrors migration-time drops; exit 1 on real drift

Safety model:
- partners.platformos.com is protected as read-only — only ever a migration
  source, so a swapped `migrate <target> <source>` fails immediately
  (--unsafe-allow-protected-target to override)
- plan-then-confirm: the plan is displayed and must be confirmed before
  anything is applied (--yes for scripts/CI; --json refuses a blind
  interactive confirmation)
- a source-export backup is always written before any apply; destructive
  target updates require --confirm-destructive; worker failures surface as
  APPLY-FAILED via last_operation_status instead of silent success
- exit codes documented: 0 ok / 1 apply errors / 2 transform errors /
  3 blocked-only
- dns commands never read the ambient PARTNER_PORTAL_HOST env var; scheme-less
  portal URLs get an actionable error

Only customer records move — the target portal re-derives platform DNS
(fallback, ACME, www-redirect record) itself. Validated end-to-end on
loremup.com (partners.platformos.com -> ps-pos01), including delete ->
re-create against Cloudflare's restored-zone behavior (requires the
partner-portal TASK-50/51 fixes, deployed 2026-07-23).

Bulk cohort mode (--instances-file/--mapping-file) is parked on the
dns-migration-bulk branch for a later release.

94 unit tests (vitest + nock) + an env-gated integration test. Work tracked
in backlog/ TASK-1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant