How Bubble database, privacy rules and workflows map to React and SQL
Bubble's .bubble export is a JSON spec of your app's schema, privacy rules, UI tree and workflows rather than runnable source code. Migrating cleanly to code maps data types to SQL tables with foreign keys, option sets to typed lookups, privacy rules to server-side query filters, repeating groups to React lists, and backend workflows to API routes and cron triggers.
How Bubble constructs map to owned source code
When founders search for how to migrate a Bubble app to React or Next.js, the hardest part is rarely HTML and CSS. It is translating Bubble's tightly coupled data model, privacy rules, repeating groups and backend workflows into standard code without breaking access control or losing records. Below is the exact 1-to-1 architectural mapping used when moving Bubble apps off the platform.
Primitive-by-primitive translation table
| Bubble concept | Target code equivalent | Migration gotcha to verify |
|---|---|---|
| Data types and fields | SQL tables, typed columns, and foreign-key relations (for example in Cloudflare D1 or Postgres) | List-of-things fields become join tables or JSON arrays with clean indexes |
| Option sets | TypeScript enums and static lookup tables | Never store secrets in option sets; keep display labels separated cleanly |
| Privacy rules | Server-side authorization middleware and row/field query filters with unit tests | Never send hidden fields to the browser and filter in React; enforce on the API route |
| Pages and reusable elements | React and TypeScript components with shared props and client routing | Clean up nested conditional groups and hidden SEO wrappers before converting |
| Repeating groups and custom states | Paginated API fetches mapped over React state, URL search params and tables | Avoid N+1 queries per row; fetch joined relations or aggregates in one server query |
| Backend workflows and API workflows | HTTP endpoints on Cloudflare Workers, background queues and Cron Triggers | Inbound webhook URLs change domain and path, so Stripe or Twilio must be updated |
| Uploaded files | Object storage buckets such as Cloudflare R2 with content-addressed URLs | Rewrite file URLs stored inside database records so images stay accessible after cutover |
| Users and authentication | Email magic-link / OTP sessions or OAuth tokens | Bubble never exports usable password hashes, so users sign in once via email link |
What converts automatically vs what needs manual finishing
In an automated migration via App Mover, standard pages, relational SQL tables, R2 media, auth roles, privacy rules and backend workflows compile directly from your exported .bubble file (plus your optional Bubble Data API key if migrating live rows). Four categories still need human finishing and are disclosed before payment:
- Custom JavaScript (Toolbox) and Custom HTML blocks: embedded snippets often depend on undocumented globals or page DOM assumptions.
- Unmapped third-party plugins: uploaders, crop tools and standard UI widgets map to standard React components, while specialized proprietary plugins need replacement or removal.
- Native mobile views: responsive web layouts migrate to desktop and mobile viewports, whereas native mobile wrappers stay separate.
- Third-party API credentials: secrets inside the export file are stripped on upload and entered securely after checkout.
To bridge that last 10 to 20 percent quickly, both the free preview and paid build generate 1-tap copyable AI prompts built directly from your app's unmigrated Custom HTML blocks, plugins and missing page elements for Claude Code, Cursor or Antigravity.
Choosing a target stack: Cloudflare vs Next.js + Supabase
- React + TypeScript on Cloudflare Workers, D1 and R2: single edge deployment under one account, 0 ms container cold starts, generous free plan and $5 USD/month Workers Paid base with zero R2 egress fees.
- Next.js + Postgres / Supabase / Vercel: familiar if your engineering team already standardizes on Postgres Row Level Security, though split hosting between Vercel and a managed database can add cost and connection-pooling complexity.
Whichever stack you choose, audit your app's real complexity first with our free read-only Bubble migration audit, test up to 5 pages free on App Mover, or book done-for-you Bubble migration from $499 USD.
Frequently asked questions
Can a Bubble database and privacy rules move cleanly to SQL?
Yes. Data types map to normalized SQL tables, option sets become typed constants or lookup rows, and Bubble privacy rules convert into server-side API query checks enforced before any record leaves the backend.
Why do user passwords not transfer when migrating off Bubble?
Bubble does not expose user password hashes in CSV exports, Data API responses or .bubble app files. The standard migration path uses email magic links or one-time password resets on first login.
Should I migrate Bubble to Cloudflare Workers/D1 or Next.js/Supabase?
Choose Next.js and Postgres if you already have React/Postgres engineers and need Postgres-specific extensions. Choose React, TypeScript, Cloudflare Workers, D1 and R2 if you want fast automated conversion via App Mover, predictable low monthly hosting (often $5 USD/month on Workers Paid), and everything inside one Cloudflare account.
How do you handle Bubble plugins and Custom HTML blocks during a migration?
Standard utilities such as image croppers and file uploaders swap cleanly to built-in code. Toolbox custom JavaScript, Custom HTML elements and unmapped plugins are flagged upfront with 1-tap copyable AI coding-agent prompts generated from your app's specific items so you can recreate or remove them cleanly.
How long does it take to rewrite vs use an automated Bubble migration tool?
A manual agency rebuild typically takes 4 to 12 weeks and costs $10,000 USD or more. An automated DIY migration with App Mover previews up to 5 pages in minutes and builds up to 80 pages in hours to a few days from $159 USD, leaving only edge cases for your touch-up checklist.