org-migration
Skill8 starsChanged 14 days agoMITView on GitHub
Runbook for migrating the whole osborn Fly fleet from one Fly org to another — apps, volumes, per-user ~/.claude data (sessions + DBs + indexes), the voice-e2e engine, and the Supabase + Railway + sync pointers — headless, with a wipe-proof zero-downtime cutover. Use when moving to a new Fly organization, especially when the source org is frozen (machine starts are refused) or you only have API tokens (no interactive login / no WireGuard). Admin/ops only — needs both orgs' Fly tokens, the Supabase service-role key, and Railway access, so this is intentionally NOT bundled into user sandboxes.
- Reads credentials
In this repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- browser-screen-recorderSkill
- ci-typecheckSkill
- meetingsSkill
- osborn-opsSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 68
Run with bounded parallelism (~4–5).
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Osborn Fly cross-org migration (runbook)
Move the entire fleet from a SOURCE Fly org to a DEST Fly org. Proven 2026-11-23 (audos → kelechi: 13 sprites + 2 pools + engine, zero active-user data loss).
This is an operator runbook, not a shipped capability. It lives in the repo's
dev-time .claude/skills (NOT agent/.claude/skills, which seeds into every user
sandbox via the npm package → frontend/Dockerfile.sandbox). The env-driven tool
scripts/migrate.py runs the phases; the exact 2026-11-23 reference scripts also live at
~/Developer/osborn-fleet-backup/kelechi-*.
Inputs (env for scripts/migrate.py)
SRC_FLY_TOKEN— SOURCE org token (a frozen source is fine — reads /exec/ autostart work)DST_FLY_TOKEN— DEST org token (fly apps create <name>NO--org; drive via Machines REST API — the macaroon 401s on legacy GraphQLwhoami/volumes destroy)SUPABASE_URL+SUPABASE_KEY— service-role key (audit + cutover; bypasses RLS)- Railway
railwayCLI logged in + linked to the frontend service (for the cutover) - optional:
DST_SANDBOX_APP=osborn-sandbox4,DST_SUFFIX=-k,FRONTEND_DIR,RAILWAY_SERVICE
Tool — scripts/migrate.py <subcommand>
list · image <ver> · infra <src-app> · data <src-app> · roll <ver> [apps…] ·
audit · cutover-plan · cutover-commit. infra records a namemap; cutover-* resolve
through it (idempotent, re-run-safe). data pulls ~/.claude and copies the Claude login
files (phase 3). Railway staging + the deploy are manual (phase 6). migrate.py help prints
the full contract. Reuse for a new org pair = just set the two tokens.
Hard-won facts (read first)
- A frozen source still starts via fly-proxy autostart — hit
https://<app>.fly.dev/sessions/manifestand it boots (explicitfly machine start403s). The Machines RESTexecendpoint works on any running machine in both orgs. fly ssh/WireGuard do NOT work from a headless token-only session (6pn UDP). Use the Machines REST API + the agent's HTTPS endpoints only.- Source agent self-stops after 15 min idle (
OSBORN_IDLE_EXIT, un-settable on a frozen org). So any single transfer must finish inside 15 min → download to a FILE first (raw ~14 MB/s), extract after. - The agent never writes Supabase
instances(only the frontend does) → booting dest machines pre-cutover is safe. - Dest-app naming: strip a trailing
-n, append-k. Pool apps get a FRESHosborn-pool-<12hex>name (a-ksuffix breaksmachine-pool.tsPOOL_APP_NAME_RE).
Phases
- Image — build+push the sandbox image to the dest org (
fly deploy --build-only --push --remote-only --image-label <ver> --build-arg OSBORN_VERSION=<ver> --app <dest-sandbox-app> --config frontend/fly-sandbox.toml), then retag:latestto it (GET/v2/<app>/manifests/<ver>→ PUT raw bytes to/manifests/latest, Content-Type = the manifest's own OCI mediaType). - Infra replicas — per sprite+pool app:
fly apps create <dest>(no--org) + shared IPv4/IPv6 + volume(s) sized to source + machine(s) with the source config copied verbatim, swapping image→dest image, mount→new volume,FLY_API_TOKEN→dest token, strippingHOME/OSBORN_CWD/DEV_*. Iterate EVERY machine for multi-machine apps. - Data (machine-to-machine — the winning method) — the DEST execs it over Fly's
backbone: read the source token (machine config env or
exec: printenv OSBORN_SYNC_TOKEN), thencurl https://<src>.fly.dev/sessions/export -o /workspace/_exp.tgz && tar xzf … -C /workspace/.claude. Only~/.claudematters — real/workspaceis ~9.6 G but ~90% is junk that self-heals (swapfile~8 G,.npm-global~1.5 G,.cache). But/sessions/exportMISSES filesmigrate.py datacopies separately (base64-over-exec):~/.claude/.credentials.json— the Claude OAuth login; without it the dest agent can't auth to Claude and silently falls back to a non-Claude model — plus~/.claude.json/~/.claude/.config.jsonconfig (and~/.osborn/secrets.jsonis belt-and-suspenders since phase 2 copies secrets via the config env). Verify source vs dest counts. Dormant machines with no reachable token → skip, they self-heal. Run with bounded parallelism (~4–5). (NOT laptop-relay: single POST times out on 2 GB, chunked finalize loses/tmpchunks on autostop.) - Engine — rebuild
osborn-voice-e2einto the dest org (Playwright image), create the replica + its secrets (from.env+ RailwayOSBORN_ENGINE_TOKEN/GOOGLE_API_KEY). - Pointer audit — the only live org pointers are Supabase
instances.{sandbox_id,server_url,sandbox_url}+machine_pool.app_name; RailwayFLY_API_TOKEN/FLY_SANDBOX_APP/FLY_SANDBOX_IMAGE/FLY_HARNESS_APP/BROWSER_ENGINE_HOST; localvoice-native-syncCLOUD_URL. (bug_reports.sandbox_idis a machine id,shared_sessions.snapshot_urlis Supabase storage — not org pointers.) - CUTOVER (gated) — ⚠️ a token/DB-org mismatch WIPES rows (
GET /api/sandbox404 → clearsinstances.sandbox_id,frontend/src/app/api/sandbox/route.ts). Safe order: back up the rows → stage all Railway vars (railway variables --set … --skip-deploys) + flip the local syncCLOUD_URL→ trigger a REAL deploy (a changed marker var WITHOUT--skip-deploys, from the linked dir — a no-op same-value set does NOT deploy) and watchrailway logsuntil the dest app names appear → flip the DB keyed byuser_id(wipe-proof + idempotent, repairs any cleared row; setinstance_type='cloud'), re-applying on a short loop until rows STAY correct → verify rows + pool + site 200. - Delete old org (separate, gated) — only after a safety window with the dest proven; the source apps are the rollback until then (re-apply the row backup + re-stage Railway to the source token + redeploy).
Reference implementation
scripts/migrate.py is THE tool — read it before running (each subcommand shows the exact
Machines-API / Railway commands). Its read subcommands (list/audit/cutover-plan) are
validated; it mirrors the proven 2026-11-23 run whose one-off scripts are kept at
~/Developer/osborn-fleet-backup/kelechi-* as a rollback reference only (not maintained —
don't edit both). An admin UI / background runner is tracked in the productization issue.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

