afterbuild/ops
ERR-935/Bubble · Migration
ERR-935
How do I migrate off Bubble to Next.js + Postgres without losing users?

How do I migrate off Bubble to Next.js + Postgres without losing users?

Last updated 18 April 2026 · 13 min read · By Hyder Shah
Direct answer

The Bubble-to-Next.js migration runs in four phases over 4–8 weeks: scope (inventory data types, workflows, plugins, and integrations), export (pull all data via CSV + Data API, screenshot every screen, document every workflow), rebuild (Next.js 16 App Router + Postgres + Clerk or Auth.js + Stripe, structured as a git repo you own), and cutover(run Bubble and Next.js in parallel for 1–2 weeks, swap DNS in a maintenance window under 10 minutes, keep Bubble as rollback for 30 days). Users re-authenticate once; URLs, data, and Stripe subscriptions all survive. Typical cost: $15k–$40k fixed-price.

Quick fix for How do I migrate off Bubble

Start here

Phase 1 — Scope and diagnostic (Week 1)

Inventory every data type, every workflow, every installed plugin, and every API Connector integration. Document the critical user journeys (signup, checkout, the top 3 product actions). Decide what ships in v1 of the rebuild and what can wait. A common mistake is rebuilding 100% of what’s in Bubble — often 15–30% of Bubble features are vestigial and don’t need to carry forward.

Deliverable: a migration scope document, a revised URL map, a Stripe compatibility plan, and a rollback plan.

Deeper fixes when the quick fix fails

  1. 02

    Phase 2 — Data export and schema design (Week 1–2)

    Export every data type from Bubble as CSV. For anything too large for CSV, use the Bubble Data API to pull paginated JSON. Design the Postgres schema — this is the only step where you get to clean up data type inconsistencies the Bubble app accumulated. Write a seed script that loads the CSV/JSON into Postgres idempotently, so you can re-run it as the Bubble app continues to accumulate data during the rebuild.

  2. 03

    Phase 3 — Rebuild in Next.js + Postgres (Week 2–6)

    Next.js 16 App Router scaffold. Postgres (managed on Supabase, Neon, or RDS) with Drizzle ORM for type-safe queries. Clerk or Auth.js for identity. Stripe via the official Node SDK. Tailwind + shadcn/ui for UI components. Deploy to Vercel for the frontend; workers on Fly or Railway if you need them. Rebuild screen by screen, workflow by workflow, starting with signup and checkout and ending with the less-critical admin surfaces.

    At the end of Phase 3, the new app is functionally complete and fed by a scheduled data sync from Bubble (runs every 15 minutes; keeps the two apps data-compatible).

  3. 04

    Phase 4 — Parallel run and cutover (Week 6–8)

    Run both apps in parallel for 1–2 weeks against real traffic (Next.js is available at a staging subdomain; Bubble handles production). Internal team tests every workflow end-to-end. When ready: schedule a maintenance window (typically 2am user-local-time on a Tuesday), drain Bubble by switching it to read-only, run the final data sync, swap DNS CNAME to point the production domain at Next.js, send users a one-time password-reset email, and monitor for 2 hours before declaring success.

    Keep Bubble live (but read-only) for 30 days as a rollback path. Revoke after 30 days if no issues.

  4. 05

    Phase 5 — Post-cutover monitoring and handoff

    For 2 weeks after cutover, monitor the Next.js app for performance regressions, Stripe webhook delivery failures, SEO crawl errors, and any customer support tickets mentioning anomalies. Hand off the repo to the client’s engineer (or retain us for ongoing support). Revoke the Bubble app after the 30-day rollback window closes.

What we don’t promise

A migration is not a chance to ship major new features. Scope creep is the #1 way migrations go over budget. If the new app has features Bubble didn’t, ship them as a separate release after cutover. The migration’s job is parity plus a better foundation — not parity plus a redesign.

See our App Migration service for the full engagement structure, or book the free 48-hour diagnostic to scope your specific migration.

Why AI-built apps hit How do I migrate off Bubble

Founders migrate off Bubble for a predictable set of reasons: enterprise customers need SOC2, code review, or self-hosting; capacity costs outpace what a full Next.js + Postgres stack would cost; a full-time engineer was hired and refused to work in Bubble; or an investor asked about code ownership before a funding round. The platform can be genuinely good up until one of those triggers fires — and once it does, migration is usually cheaper than the alternatives.

The migration is not a line-by-line port of Bubble workflows to Next.js code. Bubble workflows are glue — they wire together database operations, plugin calls, and UI transitions in a platform-specific way that doesn’t have a direct JavaScript equivalent. What migrates cleanly is the data and the intent. You use the Bubble app as the specification and rebuild the implementation natively.

Done well, users don’t notice except that the app gets faster and cheaper. Done poorly, you lose URLs to SEO, log users out, break Stripe subscription state, or ship a rebuild missing 15% of the functionality that only the Bubble app had documented.

We ran Bubble and Next.js in parallel for two weeks. Cut over at 2am Tuesday. Took 7 minutes. Nobody noticed except our capacity bill dropped to $180.
Afterbuild Labs migration client, January 2026

Diagnose How do I migrate off Bubble by failure mode

Before the migration starts, scope the app honestly. The table below is the inventory we run on every engagement.

Migration artifactHow to extractWhere it lands
Data type schemasBubble editor → Data → TypesPostgres + Drizzle schema
Data rowsCSV export per type + Data APIPostgres via seed/migrate script
User accounts + passwordsData API for accounts; password reset for authClerk or Auth.js + one-time reset email
WorkflowsScreenshot + document intentNext.js server actions or API routes
UI pagesScreenshot every screen + note layoutNext.js + shadcn/ui components
URLs + SEOExport URL map from BubbleNext.js redirects.ts + same-path routes
Stripe subscriptionsAlready in Stripe — no migrationPoint new app at same Stripe account
Third-party API keysRotate and configure in new envNext.js .env + secrets manager

Related errors we fix

Still stuck with How do I migrate off Bubble?

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

If you’re ready to scope a migration:

  • Enterprise customers need SOC2, self-hosting, or code review
  • Capacity costs are $500–2,000/month and still climbing
  • You're hiring a full-time engineer who can't onboard in Bubble
  • An investor or acquirer asked about code ownership
start the triage →

How do I migrate off Bubble questions

How long does a Bubble migration take?+
4–8 weeks for a typical B2B SaaS with 10–30 data types, OAuth, Stripe, and 20–50 workflows. Simpler apps (under 15 data types, single-tenant, no complex workflows) ship in 3–4 weeks. Complex apps (multi-tenant, enterprise features, heavy custom plugins) can take 10–12 weeks.
Will my users lose access during the migration?+
No. Users keep working on Bubble until cutover. At cutover, we send a one-time password-reset email (required because auth provider is changing) — users reset, and they're in. Stripe subscriptions are unaffected since the same Stripe account serves both apps. URLs are preserved via Next.js redirects if needed.
What happens to Stripe subscriptions during migration?+
Nothing — they stay in Stripe, which is authoritative. Your new Next.js app points at the same Stripe account. Subscription state, customer IDs, invoice history, and payment methods all carry over. The new app's webhook handler picks up where the old one left off.
Can I keep my URLs and SEO during migration?+
Yes. We export the URL map from Bubble, configure the Next.js app to serve the same paths, and add 301 redirects for any URL that changes. Google sees the new app as the same site. SEO rankings are preserved if the content carries over.
What's the total cost of a Bubble migration?+
$15k–$40k fixed-price for most B2B SaaS apps. Simpler apps start at $12k; enterprise migrations with multi-tenant, SSO, and custom integrations can reach $60k–$80k. The 48-hour diagnostic gives you a firm quote before any commitment.
What if we discover something can't migrate?+
Rare, but it happens. Examples: a custom plugin doing something exotic, a workflow depending on Bubble-specific behavior that doesn't translate. We identify these in Phase 1 and either rebuild them differently, scope them out of v1, or flag them as known-divergent. No surprises at cutover.
Can I migrate just the frontend and keep Bubble as the backend?+
Yes — this is the hybrid path. Build a Next.js frontend that calls Bubble's Data API as the backend. You get UX ownership, SEO, and mobile performance while keeping workflows and admin in Bubble. Costs $8k–$20k and ships in 3–5 weeks. Good for apps with complex admin but simple customer-facing UX.
What's the cost delta after migration?+
Most migrations drop hosting costs by 50–80%. A Bubble app paying $500–2,000/month in capacity typically costs $100–500/month on Vercel + Supabase + Stripe at the same traffic. Engineering costs to maintain the new stack are comparable (it's a standard Next.js + Postgres project any senior dev can own).
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.

How do I migrate off Bubble experts

If this problem keeps coming back, you probably need ongoing expertise in the underlying stack.

Sources