Portability · 05 of 06 · Migration

Moving 88 live resources without recreating a repo

The GitHub path has to move onto the new contract before GitLab can use it, and the old provider has already destroyed real files twice. So the move is adoption by name, one app first, and every step is measured against the repositories themselves.

Moving 88 live resources without recreating a repo Five steps in a row. Step 1, freeze the old: every provider-upjet-github managed resource goes to Observe-only with an Orphan deletion policy. Step 2, adopt by name, highlighted: a new scm.hangar.io resource with the same external-name observes the existing repository or file. Step 3, canary one app, highlighted: one application moves to a copied Composition. Step 4, cut over: flip the apiVersion in every composition, tag and pin. Step 5, retire the old: delete the orphaned resources and remove the provider. Two exit checks are measured throughout: zero commits to any repository across steps 1 to 3, checked by diffing every repo, and GitHub API calls at or below today, sampled from the rate-limit endpoint every 30 seconds. STEP 1Freeze the oldObserve · OrphanSTEP 2Adopt by namesame external-nameSTEP 3Canary one appcopied CompositionSTEP 4Cut overflip apiVersion, pinSTEP 5Retire the oldremove the providerWHAT MUST STAY TRUE, MEASUREDZero commits to any repositorydiff every repo across steps 1 to 3API calls at or below todaysample /rate_limit every 30 secondsAdopt, never recreate. A cluster can be rebuilt; a repository's history cannot.LEGENDWhere it can go wrongMechanicalExit check

Lessons already paid for

  • A Delete policy on a file destroyed cicd.yaml in five repos.
  • A changed identity field re-identified every live file.
  • An external-name fight burned 16,000 calls an hour.

So, by construction

The new RepositoryFile treats only a 404 as gone, never writes on adopt, never deletes, and keeps whatever external-name it observed.

Order

Flip the apiVersion only after every caller is ready, test on a copied Composition first (Argo CD self-heal reverts hand edits), and canary on a Skyport app before the fleet.

Hangar · Portability