Hire Lovable Xperts
Migration

What Breaks When You Export a Lovable App (And What Ports Cleanly)

Exporting a Lovable app is not a clean handoff. Your React frontend and application code port cleanly to GitHub and any host. What does not travel: Supabase auth password hashes, Row Level Security policies, storage buckets, edge functions, secrets, and scheduled cron jobs. These live in Lovable-managed infrastructure, not your repo. This is the What-Breaks-on-Export map — what survives, what silently disappears, and how to carry each piece across.

By Founder Name · Last verified: 2026-06-25

What actually ports cleanly when I export a Lovable app?

Your frontend ports cleanly. The React/Vite source, components, routes, styling, package.json, and most client-side logic land in your GitHub repo exactly as written, and run on any host that builds a static or Node app. If your app were pure frontend with no backend, export would be nearly painless. The breakage is concentrated entirely in the backend layer Lovable provisions for you.

Lovable's GitHub export is real source code, not a black box — you own it and can read every file. The build config, TypeScript, Tailwind, and your component tree all transfer. What you are really exporting is the half of the app that lives in your repo. The other half lives in a Supabase project and Lovable's edge runtime, and that is where the What-Breaks-on-Export map matters.

The clean mental model: code ports, infrastructure does not. Anything that is a file in your project survives. Anything that is a row in a managed database, a policy attached to a table, a secret in an environment store, or a function deployed to an edge runtime needs to be recreated or re-pointed by hand.

Before you export anything, snapshot the working state: note your live Supabase project ref, export your schema, and screenshot your current env vars. The export itself does not delete anything from Lovable — but you want a known-good reference to verify the migrated app against.

Related: Export Lovable code to GitHub · Run your Lovable app locally

What is the complete map of what breaks when I export?

Here is the full What-Breaks-on-Export map. Frontend and code port cleanly. The backend layer — auth password hashes, RLS policies, storage objects, edge functions, secrets, and cron — does not travel with a GitHub export. Each row below is a distinct failure mode with its own fix. Treat this table as your migration checklist, not a summary.

The pattern is consistent: green rows are files, red rows are managed infrastructure. The single most dangerous assumption in a Lovable migration is that a successful GitHub export means a successful migration. It does not — it means you successfully moved the easy half.

What-Breaks-on-Export Map — Lovable Migration
AssetPorts on export?Why / What actually happensHow you carry it across
React/Vite frontend + componentsYesPlain source in your repo — builds on any hostgit clone, npm install, build
App code, routes, styling, configYesFiles in the project tree transfer 1:1Nothing — it just works
Database schema (tables, columns)PartiallyStructure can be dumped, but it is not in your repo by defaultpg_dump or Supabase migration export
Auth users + password hashesNoHashes live in Supabase auth.users in the managed projectMigrate the Supabase project, do not rebuild auth
Row Level Security (RLS) policiesNoPolicies attach to tables in Postgres, not your codeRe-create every policy on the target DB
Storage buckets + uploaded filesNoObjects live in Supabase Storage, not the repoCopy objects bucket-to-bucket via API/CLI
Edge functionsNoDeployed to Supabase/Lovable edge runtime separatelyRe-deploy each function to your own project
Secrets / API keys / env varsNoStored in Lovable + Supabase secret storesRe-enter every secret on the new host
Scheduled cron jobs (pg_cron)NoDefined in the database scheduler, invisible in codeRe-create each schedule on the target DB
Webhooks + third-party callbacksNoPoint at old URLs; break on domain changeUpdate every callback URL after cutover

Why do my users get logged out — what happens to auth and password hashes?

Auth does not live in your code, so export cannot carry it. Your users, their password hashes, sessions, and identities all sit in the auth.users table inside the Supabase project Lovable provisioned. If you point your exported frontend at a fresh, empty Supabase project, every account vanishes and every login fails — even though the login screen renders perfectly.

The critical rule: never rebuild auth from scratch during a migration. Password hashes are one-way — you cannot read them out and re-insert them into a new project through the normal API, and you must never reset everyone's password. The correct path is to migrate the existing Supabase project itself (claim it, or transfer the database) so the auth schema and hashes move intact.

If you truly must move to a different Supabase organization, the supported route is a database-level migration of the auth schema, not a re-signup flow. Anything that asks all your users to reset their password is a red flag that the migration was done the wrong way — and it is the most common reason a self-attempted export turns into a support fire.

What NOT to do: do not create a new Supabase project, copy your table structure, and assume users carry over. The auth.users table and its password hashes do not come along. Migrate the existing project, or do a proper auth-schema database migration — never a forced password reset for your whole user base.

Related: Move to your own Supabase the right way

Do my Row Level Security (RLS) policies come along when I export?

No. RLS policies attach to Postgres tables, not to any file in your repo, so a GitHub export leaves them behind entirely. The danger is silent: your exported app will connect and run, but if the new database has no RLS, every row is exposed through the public API — or, if RLS is on but policies are missing, every query returns empty and your app looks broken for the opposite reason.

This is the highest-stakes line on the What-Breaks-on-Export map. A missing RLS policy is not a crash — it is a data-leak waiting to be discovered, where one user can read another user's records because the table has no policy enforcing tenant isolation. Migrations that copy the schema but skip the policies are the classic way a Lovable app ships a security hole into production.

To carry RLS across, dump the policy definitions from the source database and re-apply them on the target before you let real traffic touch it. Verify by signing in as two different test users and confirming each sees only their own data. Do not treat 'the app loads' as proof — load is not isolation.

  1. On the source Supabase project, open the SQL editor and select pg_get_expr and pg_policies to list every existing policy per table.
  2. Save each CREATE POLICY statement, including the USING and WITH CHECK expressions, into a migration SQL file.
  3. Confirm Row Level Security is ENABLED on every table in the target project (ALTER TABLE ... ENABLE ROW LEVEL SECURITY).
  4. Apply the saved CREATE POLICY statements to the target database.
  5. Test isolation with two separate user sessions and confirm neither can read the other's rows before going live.

Related: Lovable RLS and auth best practices · Supabase RLS permissions explained

What happens to my storage buckets, uploaded files, and edge functions?

Both disappear from an export. Uploaded files live as objects in Supabase Storage, and edge functions are deployed to a serverless runtime — neither is a file in your repo. After export, your image URLs return 404 and any feature backed by an edge function (payments, webhooks, AI calls, emails) silently does nothing, because the function it calls was never re-deployed to your new project.

Storage objects must be copied bucket-to-bucket. You re-create the bucket structure and policies on the target, then transfer the actual files using the Storage API or CLI — pointing your new app at an empty bucket leaves every avatar and upload broken even though the database rows referencing them are intact.

Edge functions must be re-deployed one by one. The function source may be visible in your repo under a supabase/functions folder, but being in the repo does not mean it is running — it has to be deployed to the new project's edge runtime, and its own secrets re-set. A function that exists as code but is not deployed is the classic cause of a feature that 'used to work' going quiet after migration.

Edge-function secrets are separate from your frontend env vars. A re-deployed function with missing secrets will throw 500s that never reach the browser console — they only show in the function logs. Check the edge logs first when a migrated backend feature fails silently.

Why do my environment variables and secrets vanish after migrating?

Because secrets are never in your code — by design. API keys, Supabase URLs, Stripe keys, and webhook signing secrets live in Lovable's and Supabase's secret stores, not in your repo (and should not be). When you deploy the exported app to a new host, every one of those values is blank until you re-enter it. This is The Vanishing Env-Var: the build succeeds, then the running app crashes on first use.

The symptom is a clean build followed by a runtime failure like 'supabaseUrl is required' or a third-party SDK throwing on an undefined key. The frontend ones (VITE_-prefixed) go on the host; the backend ones (service-role keys, Stripe secret keys, webhook secrets) go in the edge-function secret store and must never be exposed to the client.

Make a complete inventory before cutover. List every secret the app reads, where it is read (client vs. edge function), and re-enter each on the correct side of the new deployment. Missing exactly one of these is the single most common reason a migrated Lovable app appears broken on launch.

  1. List every variable your app references — grep the repo for import.meta.env and process.env to find them all.
  2. Sort each into client-side (safe, VITE_-prefixed) versus server/edge-only (service-role and signing secrets).
  3. Add the client variables to your new host's environment settings.
  4. Add the server/edge secrets to the edge-function secret store on the target project — never to the client bundle.
  5. Redeploy and exercise every feature that calls an external service to confirm no key is still blank.

Related: How env vars vanish on deploy · Move secrets into edge functions safely

What about scheduled jobs, cron, and third-party webhooks?

These are the most easily forgotten. Scheduled jobs run via pg_cron inside the database scheduler — invisible in your code, so they do not export and simply stop. Webhooks from Stripe, Resend, or other services point at your old deployment URL, so after a domain change they fire into the void. Nothing errors loudly; the work just quietly stops happening.

Cron jobs must be re-created on the target database. Query the cron schema on the source to list every scheduled job, then re-define each one against the new project. Because there is no visible failure when they are missing, the only way to catch this is to inventory them deliberately before cutover.

Webhooks must be re-pointed at the new URL and, for signed webhooks like Stripe, the signing secret rotated and updated in the edge function. A webhook still aimed at the old domain will keep returning errors on the sender's side while your new app sees nothing — payments and emails silently fail until you update every callback URL in each provider's dashboard.

How do I migrate without breaking everything — and when should I hand it off?

Run the migration as a parallel cutover, not a switch-flip. Stand up the new database, storage, functions, secrets, RLS, and cron alongside the live app, verify each line of the What-Breaks-on-Export map on the new stack, then change DNS only once everything passes. The mistake that breaks migrations is treating a green GitHub export as 'done' and deploying with the backend half still missing.

If the app has real users, real data, or payment flows, the auth-hash and RLS lines are unforgiving — a wrong move there means locked-out users or leaked data, and both are far more expensive to fix than to prevent. That is the point where a managed migration pays for itself: we move the existing Supabase project intact, re-create policies, re-deploy functions, re-enter secrets, and verify isolation with test sessions before any DNS change.

We do this as a fixed-scope engagement with a rollback plan, and you keep full ownership of your code, data, and accounts throughout. If you have already exported and something is now broken, that is also fixable — bring the repo and the original project and we re-attach the missing backend half.

A clean Lovable migration is a checklist, not a single command. If any row of the What-Breaks-on-Export map applies to your app — auth, RLS, storage, edge functions, secrets, or cron — book a migration call and we map and move every piece before cutover.

Related: Managed Lovable migration service · Plan your full move off Lovable

Frequently asked questions

Does exporting my Lovable app to GitHub move everything?
No. The export moves your frontend, React components, routes, styling, and build config as real source code. It does not move the backend Lovable provisions for you — auth password hashes, RLS policies, storage files, edge functions, secrets, and cron jobs all live in managed infrastructure outside your repo. A successful export means you moved the easy half; the backend half still has to be carried across deliberately.
Will my users lose their accounts when I export and migrate?
They will if you point your exported app at a fresh Supabase project. User accounts and password hashes live in the auth.users table of the original managed project, not in your code. The correct path is to migrate the existing Supabase project so auth moves intact — never rebuild auth from scratch or force a password reset on your whole user base. That is the most common way a self-migration goes wrong.
Do RLS policies transfer when I export my Lovable app?
No. Row Level Security policies attach to your Postgres tables, not to any file in your repo, so an export leaves them behind. If the new database has no RLS, your data is exposed; if RLS is on but policies are missing, queries return empty and the app looks broken. You must dump every policy from the source database and re-apply it on the target before going live, then verify with two test users.
Why do my images and uploaded files return 404 after migrating?
Because uploaded files are objects in Supabase Storage, not files in your repo. Exporting the code does not copy the storage objects, so your database still has rows pointing at images that no longer exist on the new project. You need to re-create the bucket structure and policies on the target, then copy the actual objects bucket-to-bucket using the Storage API or CLI before the references resolve again.
My migrated app builds fine but features silently fail — why?
Almost always missing edge functions or missing secrets. Edge functions may be visible as code in a supabase/functions folder, but being in the repo does not mean they are deployed — each must be re-deployed to the new project with its own secrets re-set. A function that exists but is not deployed (or is missing a secret) throws errors that only appear in the edge logs, not the browser console, so the feature just goes quiet.
What is The Vanishing Env-Var problem?
It is when your exported app builds successfully and then crashes on first use because its environment variables and secrets were never re-entered on the new host. Secrets like the Supabase URL, service-role key, and Stripe keys live in Lovable's and Supabase's secret stores, not your code. The fix is to inventory every variable before cutover and re-add each on the correct side — client host or edge-function secret store.
Do scheduled jobs and cron tasks survive an export?
No. Scheduled jobs run through pg_cron in the database scheduler, which is invisible in your application code, so they do not export and simply stop running. There is no loud error — the work just stops happening. You have to query the cron schema on the source database, list every job, and re-create each one on the target project. This is one of the most commonly forgotten lines in a migration.
Will my Stripe payments and webhooks break when I migrate?
They can. Webhooks point at your old deployment URL, so after a domain change they fire into nothing while the sender keeps seeing errors and your new app sees no events. For signed webhooks you also need to update the signing secret in the edge function. You must update every callback URL in each provider's dashboard and re-test payment and email flows before treating the migration as complete.
Is it safe to export my Lovable app myself, or should I get help?
Exporting is safe and the export itself deletes nothing from Lovable. The risk is in re-assembling the backend half — auth hashes, RLS, storage, functions, secrets, and cron — without locking out users or leaking data. If your app has real users, real data, or payments, a managed migration moves every piece, verifies isolation with test sessions, and keeps a rollback plan, all while you retain full ownership.
I already exported and now things are broken — can it be fixed?
Yes. A broken migration is recoverable as long as you still have the original Supabase project and the exported repo. We re-attach the missing backend half — re-create RLS policies, re-deploy edge functions, re-point webhooks, restore storage, and re-enter secrets — and verify each line of the What-Breaks-on-Export map before going live. Bring both the repo and the original project and book a migration call.
How long does a proper Lovable migration take?
It depends on how many backend pieces are in play. A frontend-only app is nearly instant; an app with auth, RLS, storage, several edge functions, cron, and live payment webhooks is a multi-step cutover that we run in parallel and verify before any DNS change. We scope it up front as a fixed engagement so you know the timeline and cost before we start, and you keep ownership throughout.

Talk to a senior engineer — not a salesperson.

Book a free 30-minute audit call. We'll diagnose what's wrong and tell you exactly what it costs to fix.

Book a free audit call