How to migrate off Replit to Cloudflare Workers

Move the app to a staging Worker first, test it against a separate copy of your data, and switch the domain after a complete user journey succeeds. For Big Apple Digital, that journey was a visitor sending an inquiry, the database keeping it, and our team receiving the email.

Replit to Cloudflare cutover checklist

  1. Build outside Replit. Clone the repository and record the build command, runtime dependencies, secrets, background jobs, and callbacks.
  2. Inventory your data. Export databases and uploaded files. Rehearse the import on a copy and check record IDs as well as row counts.
  3. Test staging end to end. Deploy with separate bindings and secrets. Run a real workflow through the browser, verify the stored record, and check any email or webhook it should trigger.
  4. Plan the final sync. Decide how to handle writes during the switch and who will reconcile them. Document when to roll back and how to carry back new records.
  5. Switch the domain and verify. Keep the old deployment available. Check HTTPS, bookmarked URLs, and the core workflow on the new host. Keep mail records intact.

Use the D1 vs Postgres guide if you are deciding where to keep your data. The Cloudflare Workers pricing calculator can help estimate costs before you switch.

1. Make a copy you can run outside Replit

Use Replit’s Git pane to commit the version you intend to move and push it to a private repository you control. Clone it into an empty directory and build it there. If it only works inside the original workspace, find out which build command, environment variable, uploaded file, or background process the fresh copy is missing. Keep secret values outside Git. Replit’s Git guide.

Make a separate inventory for data. A Git checkout can rebuild a form while leaving every submission behind. Record the database and file stores that hold customer records, where to get an authorized export, and which record IDs existing URLs depend on.

2. Match the runtime to the app

Our first Cloudflare version kept the React frontend. Workers Static Assets served the Vite build, a Worker handled API requests, and D1 held the records. We switched the marketing page to server-rendered HTML later. Keeping the frontend familiar gave us a simpler comparison during the move.

For a Vite app, build its production bundle and point the Wrangler assets directory at the output, usually dist. A site with server rendering needs a compatible framework adapter or a Worker request handler. Check any Node-specific dependencies early, especially code that expects a permanent process or writes uploads to local disk. Workers Static Assets · Node.js compatibility.

For example, this minimal wrangler.toml assumes your API entry point is src/worker.ts and your build produces a dist folder. Change those paths to match your repository. Give this first deployment its own staging name.

name = "my-app-staging"
main = "src/worker.ts"
compatibility_date = "2026-11-28"

[assets]
directory = "./dist"

Run npm run build and npx wrangler dev from the project root. Load a nested page directly and call one API route. A frontend configured to serve its index page for unknown paths can accidentally return HTML to an API client expecting JSON.

3. Prove one complete transaction on staging

Give staging its own Worker name, database binding, secrets, and test email destination. Run the project build and type check, then deploy that environment. Use a test record with a recognizable ID. Submit it through the staging form, find the row in the staging database, and check the message in the intended inbox. A success banner alone proves only what the browser displayed.

Repeat the test with a required field missing and confirm that no row was created. If your app sends password resets or receives payment callbacks, test those with the provider’s test configuration too. A forgotten callback URL can leave the homepage working while customers cannot sign in. Configure Worker secrets.

4. Switch traffic with a way back

Record the current web DNS settings and keep the old deployment available. If the database is moving, briefly pause writes or arrange to replay changes after the initial copy. Reconcile the final records before enabling writes on the new host. If both apps use the same database, check that both versions can read its schema during the transition.

Attach the production hostname to the Worker and verify HTTPS, the preferred hostname, and several bookmarked URLs. Preserve mail records when changing web routing. Big Apple Digital’s outgoing notifications moved to a Worker binding while incoming mail stayed in Google Workspace. Cloudflare custom domains.

Put a person in charge of the rollback decision. If the form accepts an inquiry but loses the message, pause new writes and reconcile submissions made since the switch before routing traffic back. Restoring yesterday’s DNS alone cannot recover today’s leads.

Get a paid Replit migration assessment

We review your app’s runtime, database, files, and integrations. You get a written plan covering the Cloudflare services that fit, how to test the data transfer, and when to switch or roll back.

Tell us what runs on Replit today and what needs to keep working during the move. We’ll confirm scope and price before work begins.

Request a migration assessment