Migrate from Emergent: extract the agent build into a standard full-stack deploy
An Emergent project is a coding-agent history plus a React frontend, FastAPI backend, MongoDB (preview track ≠ production track), optional Expo Mobile Agent output, and Deploy glued to managed hosting credits. Migration means completing GitHub Save/Push, translating Emergent-injected env into lockfile-based CI, exporting each MongoDB separately, and landing on a conventional container or PaaS. You keep product behavior; you stop needing the Emergent Deploy GUI, preview host assumptions (`*.preview.emergentagent.com`), or a live workspace session to boot.
CodeCross LLC names migrate-from-emergent a two-runtime extract: GitHub Save/Push, pin Python and Node, encode FastAPI as a Procfile or Dockerfile CMD, and restore MongoDB from the Deploy dump—not the idle preview store. The pair must start on a runner that never opened the agent. Success is React plus API plus database without a Redeploy click or hosting credits.
Why a raw Emergent GitHub clone fails on a standard host
A green Emergent Deploy is not a portable build
CI images lack env the Deploy hid. Preview DB URLs leak into production configs. FastAPI start paths assume Emergent’s process shape. Secrets arrive empty.
Workspace-only junk lands in the remote
Preview caches and agent chat that never hit disk need an include-or-drop pass. The extract is source, lockfiles, FastAPI routes, React assets, and a written env-name map.
Install only succeeds inside Emergent’s managed shell
Replace “available because Emergent Deploy” steps with install, test, build, and a Procfile or Dockerfile CMD for FastAPI plus a static/Node build for React.
Preview DB URLs leak into production configs
Preview ≠ production on Emergent. Restore MongoDB from the correct dump. Never point production Auth at preview MongoDB.
Auth still hardcodes .emergent.host or preview hostnames
Update callbacks and CORS before DNS moves. Encode Expo/EAS as separate jobs if Mobile Agent ships.
The extract sequence that actually boots
Pull, pin, remap MongoDB, then prove start without Emergent open
Product behavior stays. Emergent’s Deploy GUI and preview assumptions leave. The destination is a conventional start command for both runtimes.
01
Take GitHub-synced source, lockfiles, FastAPI routes, and React assets
Leave preview caches out. Capture MongoDB dumps from the correct DB. Include Expo config if Mobile Agent is in the stack.
02
Pin Python/Node and encode Emergent’s start path as CI jobs
Version files or the base image. Fail if install only works inside Emergent’s managed shell.
03
Remap env names; restore MongoDB; split preview from prod URLs
Never commit Emergent workspace secrets. Verify the destination cluster on a clean runner.
04
Prove install → test → build → start with Emergent closed
The destination boots from that checkout alone. Emergent Deploy is no longer required for production.
How to
Extract an Emergent tree into standard React/FastAPI CI
GitHub-plus-normalization. Success is install → test → build → start with no open Emergent workspace and no Emergent Deploy for production.
Step 01
Decide what belongs in the extract versus what stays behind
Take GitHub-synced source, lockfiles, FastAPI routes, React assets, Expo config if used, and a written map of Emergent env names. Leave preview caches out. Capture MongoDB dumps from the correct DB (preview ≠ production).
Step 02
Turn Emergent Deploy into portable CI
List Python/Node versions and start commands Emergent assumed. Pin runtimes. Replace Deploy-only steps with install, test, build, and a Procfile or Dockerfile CMD for FastAPI plus a React build. Encode Expo/EAS as separate jobs if mobile ships.
Step 03
Mint destination secrets and remount Auth
Export names into an env template. Never commit Emergent workspace secrets. Update Auth callbacks and CORS that still hardcode `.emergent.host` or preview hostnames before DNS moves.
Step 04
Restore MongoDB on a clean runner
Point the app at a destination cluster. Verify the dump came from production MongoDB, not the sleeping preview DB.
Step 05
Prove the destination boots from checkout alone
install → test → build → start with the Emergent workspace closed. Rotate old Emergent secret values after cutover. Emergent Deploy is then optional.
Read next
Proof, the essay, and sibling intents
These pages are already on the site. Use them to pressure-test the bet before a call.
What does a complete GitHub Save/Push leave behind inside the Emergent workspace?
Take source, lockfiles, FastAPI routes, React assets, Expo/EAS config if used, and a written map of Emergent env names. Leave preview caches, workspace-only junk, and secret values out of the remote. Agent chat that never hit disk needs an explicit include-or-drop pass for architecture context. MongoDB contents are not in Git—plan dumps from the correct DB (preview ≠ production). Incomplete Save/Push is the most common “clone fails elsewhere” root cause.
How do you map Emergent’s FastAPI + React process model onto Dockerfile or PaaS start commands?
List the Node/Python versions and start commands Emergent’s managed shell assumed. Pin those runtimes in the CI image. Replace “available because Deploy” with install, test, `uvicorn`/ASGI (or equivalent) for FastAPI, and a static or Node build for React. Encode Expo/EAS as separate jobs if mobile ships. Fail the pipeline if install only succeeds inside Emergent’s managed environment—that is the portability test.
Why must preview and production MongoDB be two migration tracks?
On Emergent they are separate databases. Restoring a preview dump into production (or pointing prod Auth at a preview URI) corrupts readiness and leaks lab data. Export each track, restore preview→staging and production→production, verify migrations on a clean runner, then rotate old Emergent connection strings so leaked workspace copies die. Auth callbacks and CORS that still hardcode `.emergent.host` or preview hostnames must be rewritten before DNS moves.
What breaks first when CI clones the repo without Emergent’s injected runtime?
Empty secrets, preview DB URLs leaked into “prod” configs, FastAPI start paths that assume Emergent’s process layout, and Auth/webhooks still expecting Emergent hostnames. Normalize install, process model, DB URLs, and env first; then push. A green Emergent Deploy on credits is not evidence of a portable build—only a clean runner that boots without the agent workspace is.
Boot from checkout—not from the Emergent Deploy GUI.
Bring the GitHub tree and the start commands Emergent assumed. We will say whether this is a portable React/FastAPI stack — or a Deploy that only runs inside Emergent’s shell.
“What impressed us most about CodeCross was their ability to deeply understand our vision and translate it into a complete digital solution. Unlike many agencies that just focus on technical delivery, CodeCross approached our project like true partners.”