Migrate off Replit — move your Replit Agent app to real infrastructure
Migrate off Replit — move your Replit Agent app to real infrastructure
A full Replit migration is a 7-step, 7-day job: pick a target host, freeze the app in Docker, move the database off Replit DB or workspace Postgres, move uploads off Replit Object Storage, wire up CI/CD, dual-run old and new in parallel, cut DNS. Done right, you have zero downtime and a code base that any engineer on Earth can run — not just Replit’s Agent.
Quick fix for Migrate off Replit — move your
Day 1 — Pick a target host and inventory dependencies
Pick the target from the table above. Clone the Repl locally and inventory every third-party dependency: package.json, requirements.txt, replit.nix, Secrets, Replit Database keys, Replit Object Storage buckets, cron jobs, always-on processes.
Write the inventory in a MIGRATION.md at the root. This becomes your checklist and your rollback plan.
Deeper fixes when the quick fix fails
- 02
Day 2 — Write a Dockerfile and test locally
A Dockerfile is your independence declaration. Install every Nix package via
apt-get. Read Secrets from env vars. Listen onprocess.env.PORT.FROM node:20-slim WORKDIR /app COPY package*.json ./ RUN npm ci --omit=dev COPY . . ENV NODE_ENV=production EXPOSE 8080 CMD ["node", "server.js"]
Run
docker run -p 8080:8080 --env-file .env. Hitlocalhost:8080. If that works, the target host will work. - 03
Day 3 — Provision the production database and dual-write
Spin up managed Postgres on Neon, Supabase, or your target host’s native Postgres. Run schema migrations (
drizzle-kit push,prisma migrate deploy, oralembic upgrade head).If you have real user data in Replit DB or a workspace Postgres, dump it:
pg_dump --no-owner --cleanand import into the new DB. For Replit key/value data, write a one-off ETL script. - 04
Day 4 — Migrate Object Storage to S3 or R2
Provision a Cloudflare R2 or S3 bucket. Swap
@replit/object-storagefor@aws-sdk/client-s3(R2 is S3-compatible). Move existing files with rclone:rclone sync replit:bucket r2:bucket --progress.Keep the Replit bucket read-only for 30 days post-cutover as a rollback.
- 05
Day 5 — Deploy to target with CI/CD + monitoring
Push your Docker image via GitHub Actions. Sample targets:
- Fly:
fly deployvia Action on main - Railway: native GitHub integration
- Cloud Run:
gcloud run deployin Action
Wire Sentry for errors, Better Stack or Uptime Robot for availability. The Replit Agent never added these — they are non-negotiable in production.
- Fly:
- 06
Day 6 — Dual-run both environments under a staging domain
Point a staging subdomain (
staging.yourapp.com) at the new host. Point the production domain at Replit. Pay a small internal team or a QA friend to run the critical journeys on both. Log every discrepancy.Fix discrepancies in the new host. Do not cut over until signup, login, payment, and core feature flows pass on staging.
- 07
Day 7 — Cut DNS and keep Replit as a hot rollback
Lower your DNS TTL to 60 seconds the day before. Update the A / CNAME record to the new host. Keep the Replit deployment alive and warm for 7 days.
If anything catastrophic surfaces in the first hour, revert the DNS — your previous TTL means users recover within a minute.
Common migration gotchas
- Cron jobs defined in
.replitdon’t exist elsewhere — recreate as Cloud Scheduler, GitHub Actions cron, or afly machinesscheduled machine. - Always-on Repls → Reserved VM / Fly Machine; don’t use Cloud Run for websocket servers.
- Hardcoded
https://your-repl.repl.coURLs in the frontend — find and replace before cutover.
Why AI-built apps hit Migrate off Replit — move your
Migrations fail when people treat them as a single step. The Agent exports the code to GitHub and it doesn’t start. They try harder to force Replit-specific APIs to run on Vercel or Fly, hit another wall, and decide migration is impossible. It isn’t — it is five separate migrations (code, data, files, domain, monitoring) that need to run in the right order.
The second failure is cutting over without a parallel window. If you flip DNS before the new host has served real traffic, every bug surfaces on real users. A one-day dual-run period catches 95% of issues against a staging domain.
“migration of code/data out of Bubble?”
Diagnose Migrate off Replit — move your by failure mode
Before you write code, answer three questions: What is the target host? Where does the database live? Where do uploads go? Your answers drive every step below.
| Workload type | Recommended target | Why |
|---|---|---|
| Next.js / static SPA | Vercel or Cloudflare Pages | Edge caching + zero config |
| Node or Python API (stateful) | Fly.io or Railway | Reserved VM equivalent + Postgres add-on |
| Containerised anything | Google Cloud Run | Scale-to-zero, Dockerfile-first |
| Long-running worker / Discord bot | Fly Machines or Railway | No cold start, persistent process |
| Heavy data / enterprise | AWS ECS or EKS | Full IAM, VPC, compliance story |
Related errors we fix
- Replit Agent code won't run outside Replit? Escape planread the fix →
- Replit Agent app broken after publish? Common failuresread the fix →
- Replit Agent deploys don't persist? Fix the environmentread the fix →
- Replit Agent app slow after 1K users? Database fixesread the fix →
- How to migrate off AI app builders (guide)read the fix →
- When to hire a developer after AI buildersread the fix →
Still stuck with Migrate off Replit — move your?
A fixed-price Replit migration removes the guesswork:
- →You need off Replit in a specific deadline window
- →You have paying users and can't afford downtime
- →Your team doesn't have DevOps experience
- →You want the migration plus a post-migration audit
Migrate off Replit — move your questions
How long does it take to migrate a Replit Agent app to real infrastructure?+
Can I migrate a Replit app to Vercel?+
Do I have to rewrite the code to migrate off Replit?+
How do I migrate data out of Replit Database?+
What does a Replit-to-production migration cost?+
Will I lose my users when I migrate off Replit?+
Ship the fix. Keep the fix.
Emergency Triage restores service in 48 hours. Break the Fix Loop rebuilds CI so this error cannot ship again.
Hyder Shah leads Afterbuild Labs, shipping production rescues for apps built in Lovable, Bolt.new, Cursor, Replit, v0, and Base44. our rescue methodology.
Migrate off Replit — move your experts
If this problem keeps coming back, you probably need ongoing expertise in the underlying stack.