PER-14389: Migrate from Permit Cloud — on-prem import guide#647
Open
EliMoshkovich wants to merge 5 commits into
Open
PER-14389: Migrate from Permit Cloud — on-prem import guide#647EliMoshkovich wants to merge 5 commits into
EliMoshkovich wants to merge 5 commits into
Conversation
Customer-facing guide for importing a Permit-delivered migration data package into an on-prem deployment: package request/verification, DB backup, write-freeze, ordered table import (with the same-session FK-disable form for api_key/pdp_config), post-import cleanup and superuser grant, org-filtered verification against the manifest, Keycloak email-linking for member access, and troubleshooting. Import side only — the export is performed by Permit and delivered as a secure download link; no internal tooling is referenced. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ Deploy Preview for permitio-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new customer-facing, enterprise-only on-prem guide that walks users through importing a Permit-provided SaaS → on-prem migration package (requesting the package, integrity verification, safe/ordered DB import, post-import cleanup, verification, and app cutover guidance).
Changes:
- Introduces a new on-prem migration guide page covering package request/process and detailed import steps.
- Documents operational safety steps (write-freeze, pre-import DB backup, fail-fast import loops) and post-import cleanup/verification.
- Adds team-member re-access guidance (Keycloak email linking + verified-email requirement) and an SDK endpoint cutover snippet.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Critical: the SDK cutover snippet omitted the api_url override, so a migrated app's management calls would silently keep writing to the old Permit Cloud workspace; it also pointed pdp= at the platform domain instead of an on-prem PDP deployment. Now shows both endpoints with a do-not-skip caution and links PDP Deployment. Over-disclosure removed: - 41-table schema list replaced with a manifest-driven loop (manifest.import.tables_in_order / fk_disabled_tables — contract added to the export in the backend PR), so public docs carry no schema dump and can't drift per installer version - avp_policy_store_id cleanup SQL (cloud-provider internals) moved to the package README; docs keep only the customer-relevant review bullets - unilateral commitments softened: audit retention period, download-link expiry, "without code changes"/"automatically regain access" guarantees Friendliness: "At a glance" orientation (phases, downtime window, done criteria, Permit assistance), pg_restore rollback snippet, jq/tar/sha256 prerequisites, replica-count note before scale-down, FK-bypass scoping caution, platform-wide superuser caution, dependency-order gloss, and the standard Support footer. Build: 0 bad links, 0 bad anchors. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
FK-graph verification against the schema found the documented ordered import cannot work for all customers: v2_project <-> v2_policy_repo reference each other (a genuine FK cycle, hit by any GitOps org), plus two more order violations masked in the original validation by empty tables. The import now runs as one FK-deferred transaction (--single-transaction + ON_ERROR_STOP): all-or-nothing, safe because the package is a single consistent snapshot, and simpler for customers - any failure rolls back cleanly and the step is just rerun. Troubleshooting updated accordingly (partial-import scenario no longer exists; added a guard entry for packages predating manifest.import). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Replace --single-transaction with explicit BEGIN/COMMIT: on psql <= 14 a client-side \COPY failure under --single-transaction COMMITs the already-loaded tables (rollback-on-client-error landed in psql 15), breaking the all-or-nothing promise; explicit BEGIN/COMMIT is atomic on every version (verified empirically on psql 14 and 16). - Admonition: "turned off" not "deferred" (no DEFERRABLE semantics), and forward-reference the step-6 member cleanup as the one known exception to snapshot consistency. - Step 8: log out/in only works after the step-9 restart. - Step 9: per-deployment scale commands (one --replicas flag can't express three different counts). - Troubleshooting: "prints no COPY lines" (psql still prints SET/BEGIN). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zeevmoney
previously requested changes
Jul 13, 2026
zeevmoney
left a comment
Contributor
There was a problem hiding this comment.
This is an automated review. See comments.
- api_url must not carry an /api suffix: on-prem routes only /v2/ through the frontend nginx to the backend (verified against the platform chart ingress and permit-backend APP_PREFIX); with /api every SDK management call lands on the SPA fallback and returns HTML (Zeev's finding) - scale-down command uses the explicit deployment/<name> resource form with flags first (portable across kubectl versions; Copilot's finding) - management.mdx backend health check: /api/v2/health -> /v2/healthy (the actual backend route; same /api routing hole as above) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zeevmoney
reviewed
Jul 13, 2026
zeevmoney
left a comment
Contributor
There was a problem hiding this comment.
Automated Review - the PR looks clean, found nothing.
zeevmoney
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Linear Issue
PER-14389
Changes
docs/how-to/deploy/on-prem/migrate-from-cloud.mdx(picked up automatically by the autogenerated on-prem sidebar)v2_api_key/v2_pdp_config, dangling-member cleanup, cloud-specific config cleanup (SSO/webhooks/PDP review), admin superuser grant, org-filtered row-count verification againstmanifest.json, Keycloak email-linking for member access (verified-email requirement), SDK cutover snippet, troubleshootingmanagement.mdx: backend health check/api/v2/health→/v2/healthy(same/apirouting hole as the review finding below; the backend route is/healthyunder the/v2prefix)Review round (2026-07-13)
api_urlfixed (Zeev): dropped the/apisuffix from the SDK cutover snippet. On-prem, the ingress routes everything to the frontend and its nginx proxies onlylocation /v2/to the backend — with/apievery management call fell into the SPA fallback and returned HTML. Verified against the platform chart ingress, the frontend nginx config, andAPP_PREFIX = "/v2"in permit-backend.kubectl scaleportability (Copilot): scale-down now uses the explicitdeployment/<name>resource form with flags first.permit-backend-v2,celery-general,permit-dl-enricher-v2), postgres pod label /-U permit -d permitconvention (matches sibling on-prem docs),initdb --usernamemakes the app user the bootstrap superuser (sosession_replication_roleworks),v2_member.is_superuserandv2_user_invite.member_idcolumns exist, manifestjqpaths match the real manifest schema, delivery-package layout matches the internal plan (permit-migration-<org>-<ts>/withpolicy-repo/+README.md), all anchors/relative links valid.Test plan
npm run buildpasses: 0 bad links, 0 bad anchors (review-round edits touch fenced code blocks only)kubectl cppath mismatch that would have broken every import command, unfiltered verification counts, missing backup step, and policy-repo coverage)🤖 Generated with Claude Code