afterbuild/ops
ERR-116/stack trace
ERR-116
Migrate off Replit — move your Replit Agent app to real infrastructure

Migrate off Replit — move your Replit Agent app to real infrastructure

Last updated 15 April 2026 · 10 min read · By Hyder Shah
Direct answer

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

Start here

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

  1. 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 on process.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. Hit localhost:8080. If that works, the target host will work.

  2. 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, or alembic upgrade head).

    If you have real user data in Replit DB or a workspace Postgres, dump it: pg_dump --no-owner --clean and import into the new DB. For Replit key/value data, write a one-off ETL script.

  3. 04

    Day 4 — Migrate Object Storage to S3 or R2

    Provision a Cloudflare R2 or S3 bucket. Swap @replit/object-storage for @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.

  4. 05

    Day 5 — Deploy to target with CI/CD + monitoring

    Push your Docker image via GitHub Actions. Sample targets:

    • Fly: fly deploy via Action on main
    • Railway: native GitHub integration
    • Cloud Run: gcloud run deploy in Action

    Wire Sentry for errors, Better Stack or Uptime Robot for availability. The Replit Agent never added these — they are non-negotiable in production.

  5. 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.

  6. 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 .replit don’t exist elsewhere — recreate as Cloud Scheduler, GitHub Actions cron, or a fly machines scheduled machine.
  • Always-on Repls → Reserved VM / Fly Machine; don’t use Cloud Run for websocket servers.
  • Hardcoded https://your-repl.repl.co URLs 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?
Typical user search — same pain applies to Replit

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 typeRecommended targetWhy
Next.js / static SPAVercel or Cloudflare PagesEdge caching + zero config
Node or Python API (stateful)Fly.io or RailwayReserved VM equivalent + Postgres add-on
Containerised anythingGoogle Cloud RunScale-to-zero, Dockerfile-first
Long-running worker / Discord botFly Machines or RailwayNo cold start, persistent process
Heavy data / enterpriseAWS ECS or EKSFull IAM, VPC, compliance story

Related errors we fix

Still stuck with Migrate off Replit — move your?

Emergency triage · $299 · 48h turnaround
We restore service and write the root-cause report.

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
start the triage →

Migrate off Replit — move your questions

How long does it take to migrate a Replit Agent app to real infrastructure?+
7 days for a typical Replit Agent app with a database, file uploads, and a single web service. Simple stateless APIs finish in 3-4 days; full-stack apps with websockets and payment integrations take 10-14. The work is linear: inventory, dockerise, move data, move files, deploy, dual-run, cut DNS.
Can I migrate a Replit app to Vercel?+
Vercel is an excellent target for Next.js or static frontends — not for always-on backends, websockets, or long-running workers. If your Replit Agent app is a Next.js project, move the frontend to Vercel and the API / workers to Fly, Railway, or Cloud Run. For monoliths, a single Cloud Run or Fly deployment is usually the cleanest fit.
Do I have to rewrite the code to migrate off Replit?+
No, you strip dependencies. Replace @replit/database with Redis or Postgres, @replit/object-storage with S3 or R2, auto-injected Secrets with a .env file, and Nix binaries with apt-get in a Dockerfile. The business logic stays the same. Rewrites are a separate decision you can make after you've safely escaped the platform.
How do I migrate data out of Replit Database?+
Write a one-off ETL script using @replit/database to iterate every key, then write each key-value pair into your target store (Upstash Redis for pure key/value, Postgres with a key+jsonb table for ACID guarantees). Run it once, archive the output JSON, and keep the old Replit DB read-only for 30 days as a rollback.
What does a Replit-to-production migration cost?+
Fixed-price App Migration starts at $2,000 for a simple stateless API and runs to $8,000 for a full-stack app with database, file uploads, payments, and zero-downtime DNS cutover. Hourly freelance work runs $50-$150/hour with most Replit migrations in the 20-60 hour range.
Will I lose my users when I migrate off Replit?+
Not if you dual-run for at least 24 hours before flipping DNS. Lower the TTL to 60 seconds the day before, cut over, monitor, and keep Replit live for 7 days as a hot rollback. No user should notice more than a single session cookie regeneration, and many will not notice at all.
Next step

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.

About the author

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.

Sources