afterbuild/ops
Resource · Platform Escape

Migrating from Lovable to Next.js: the escape plan.

A step-by-step plan for non-technical founders, with timeline, cost, and the four decisions that matter most.

By Hyder ShahFounder · Afterbuild LabsLast updated 2026-11-28

TL;DR (55 words)

A Lovable → Next.js Platform Escape takes 4–6 weeks, costs $9,999 fixed fee, and results in owned code on Vercel + Supabase with under 15 minutes of cutover downtime. Four decisions matter: auth provider, Stripe idempotency, DNS cutover window, and whether to keep working in Lovable during the migration.

By Hyder Shah · Published 2026-04-15 · Updated 2026-11-28

Why non-technical founders migrate

Three patterns show up in 2026 migration conversations:

  1. Investor diligence.Lead investors at Series A ask “can we see this running off Lovable?” There is no good answer except “yes, here's the repo.” See the Replit Agent case study for the same dynamic on another platform.
  2. Price changes.Credit billing that drifts, surcharges, or a platform pricing announcement that changes the app's unit economics. The Bluefinch — Base44 agency escape to Next.js is a worked example at agency scale.
  3. Hiring. The first engineer you hire wants a repo, a test suite, and standard tooling. Migration is the prerequisite for hiring senior Next.js developers who stay.

Should you migrate at all?

Migration is not automatically the right move, and doing it early costs less than doing it late only if you were going to do it. Read the row that describes you rather than the column you like.

SignalStay on LovableMigrate to Next.js
Codebase sizeSmall enough that you can still describe the whole app in one promptLarge enough that changes have started regressing each other
Credit spendPredictable, and below what a developer’s time would costConcentrated in debug loops on one stubborn feature
TeamFounder only, no engineering hire plannedYou are hiring engineers who expect a repo, a test suite, and a PR flow
StagePrototype, validating whether anyone wants itPost-revenue, or in diligence for a round
UsersNo paying users yetPaying users whose sessions and data must survive the move

Three signals on the right is a migration. One is not. The expensive mistake is migrating for the reason in the last row alone — paying users make the cutover harder, not more urgent.

The escape plan, end-to-end

The 4-week plan. Agency multi-app retainers scale the same structure across more weeks.

Week 0 — audit and architecture

Week 1 — data and auth

Week 2 — integrations and deploy

Week 3 — cutover

Week 4 — handoff

Can an AI prompt convert a Lovable app to Next.js on its own?

A conversion prompt converts the components but not the four things that make the app work — which is why prompt-only conversions pass a build and fail at auth. The UI layer is the part a model is genuinely good at: Lovable generates React and Tailwind, Next.js consumes React and Tailwind, and the translation is mostly mechanical. Everything that made the running app a working product lives outside the components, in state the prompt cannot see. The step order that keeps the app working, with what a prompt can and can’t do at each step and the Lovable, Next.js and Supabase docs behind it, is on the convert a Lovable app to Next.js yourself checklist.

Which four subsystems does a conversion prompt reliably miss?

  1. Data and migrations.The schema exists in the database, not in the repo. A converted project inherits tables with no migration history, arbitrary IDs created through a dashboard, and no seed script — so the first environment you stand up after the conversion has no defensible way to reach the same shape.
  2. The URL map.Routing moves from the builder’s own conventions to Next.js file-system routes. The prompt will produce routes that work; it will not produce routes that match the ones Google has already indexed and users have already bookmarked, and nothing in the build will tell you they changed.
  3. Session handling. If the project stays on Supabase, Supabase keeps issuing and signing the tokens, so accounts survive. What the prompt misses is where the converted app reads them: Server Components and Route Handlers need a cookie-based client, which Supabase documents as @supabase/ssr, and a proxy.ts that refreshes expired tokens, or users are signed out when their token expires. Move to another auth provider instead and every session ends at cutover unless the migration plans a re-verification path in advance.
  4. Webhook and OAuth redirect targets.Stripe webhook endpoints, OAuth authorised redirect URIs, and any scheduled jobs all point at the old host. These live in third-party dashboards, not in your codebase, so no amount of code conversion touches them — and each one fails only in production, on real money or real logins.

Notice what those four have in common: none of them is in the source the prompt reads. A conversion prompt is a code translator working from code, and all four failures live in database state, in search indexes, in session cookies, and in other companies’ dashboards.

What does the output look like when it has silently dropped RLS?

Exactly like success, which is the problem. Row-level security policies are database objects, not application code, so a converted repo that never mentions them still compiles, still runs, and still returns data. The tell is that it returns moredata than it should: a list endpoint that used to show a user their own rows now shows everyone’s, and because the UI renders a list either way, the screen looks populated rather than broken. Check it by querying as two different users and comparing row counts — not by reading the diff, where nothing about it appears.

What breaks first after a prompt-only conversion ships?

Auth, then billing, then the build — in that order, and the order is the useful part. The build is the thing the conversion was optimised to satisfy, so it passes first and stays passing. Auth breaks at the first login attempt, within minutes, because session validation is immediate and universal. Billing breaks later and more quietly: webhooks fire on Stripe’s schedule, not yours, so a subscription that fails to activate surfaces hours or days after cutover, by which time the deploy no longer looks like the suspect. Teams that plan for “the build will tell us” discover the inverse.

How do you tell a converted repo from a hand-ported one six months later?

Look at the history rather than the code. A converted repo has a shallow migration folder or none at all, commits clustered into one or two enormous “port” changesets, no redirect map, and environment variables that appear fully formed with no commit that introduced them. A hand-ported repo has migrations dated across the port window, a redirect table someone had to write by hand, and commits that show subsystems moving one at a time. The code can look identical; the history cannot be faked after the fact, which is why diligence reads it.

What actually breaks in the port

The component-level changes are small and repetitive, and they are the part most guides stop at. They matter less than the four subsystems above, but they are what fills the first two days.

If the goal is to keep the ranking as well as the app, the redirect map is the artefact that decides it: every old URL either resolves to the same path or 301s to its replacement, and anything that does neither is a page you have chosen to lose. When you would rather not own this end-to-end, the fixed-fee Lovable to Next.js migration runs the port, the data move, and the cutover as one engagement.

The four decisions that matter most

DecisionDefault we recommendWhen to deviate
Auth providerSupabase AuthClerk if you need multi-tenant orgs out of the box
Cutover windowSaturday, 04:00 local timeWeekday if your users are B2B with weekday usage
Dual-write duration7 days14 days for regulated industries (fintech, healthtech)
Keep editing Lovable during migrationNo — freeze at week 0Only critical bug fixes, mirrored manually

What founders most commonly get wrong

What the migration does not include

How to start

Book the free rescue diagnostic. We'll look at the Lovable project on the call, confirm scope, and provide a written cutover plan and fixed-fee quote inside 24 hours. If you already know Platform Escape is the right scope, skip to the App Migration service page and start the engagement from there.

Related reading

FAQ
Why migrate off Lovable?
Three common reasons: investor diligence requires portable code, a price change makes the platform uneconomic, or you're hiring engineers who want a conventional stack. All three tend to hit around the Series A stage. Moving off Lovable while the app is still small is meaningfully cheaper than moving off it later.
How long does a Lovable → Next.js migration take?
Four to six weeks for a standard app with Supabase, Stripe, and auth. Multi-app agency migrations run 8–12 weeks as a retainer. The timeline is driven by integration count and user migration complexity, not by the size of the codebase.
What does it cost?
$9,999 fixed fee for a single-app Platform Escape, including the audit, code migration, data migration, integration rewiring, Vercel deploy, and two weeks of post-cutover support. Agency retainers scoped separately.
Will my users notice?
Ideally no — downtime targets are under 15 minutes during cutover. Authentication typically requires a passwordless re-verification email on cutover day; users re-verify and keep their data. No password resets, no forced account recreations.
Can I keep my Lovable UI?
Usually yes. Lovable generates Next.js + Tailwind; the UI layer ports cleanly to a standard Next.js project. We keep every pixel unless the founder wants cleanup, and that cleanup is scoped separately.
What do I need to prepare before starting?
Access to your Lovable project, your Supabase project, your Stripe account, your DNS registrar, and your OAuth providers (Google, GitHub, etc.). We'll request each on day zero. You don't need to prepare the code — we handle the export and cleanup.
Is this the same as the Platform Escape service?
Yes. Platform Escape is our name for any off-platform migration (Lovable, Replit Agent, Base44, Bolt). The scope and pricing are the same; the specifics of the source platform determine where the work is concentrated.
What happens after the migration?
You own the code, in your git repo, deployed to your Vercel account, with data in your Supabase project. You can keep working in Cursor, hand off to an engineer hire, or move to Ongoing Maintenance with us. We include two weeks of post-cutover support in every migration.
Can I export my Lovable code to GitHub?
Yes, and the export is one-way. You get a standard repo you can build and host anywhere, but you cannot push changes back into Lovable's chat editor afterwards. Plan the export as a commitment rather than a backup: tag the first commit so every later diff is measured from a known starting point, and decide before you export whether Lovable edits are frozen from that moment. Teams that keep editing in both places spend the migration reconciling two divergent codebases instead of porting one.
Will I lose my users if I migrate off Lovable?
Not if the database comes with you. User accounts, rows, and OAuth links live in Supabase, not in Lovable, so pointing the new Next.js app at the same Supabase project carries all of them across untouched. What does not carry across automatically is the session: live sessions are signed with a secret from the old environment, so plan a passwordless re-verification on cutover day. Users re-verify once and keep everything; nobody resets a password or recreates an account.
Will Google rankings survive the migration?
They survive URL parity, not good intentions. Every path that exists today either resolves to the same path on the new app or 301s to its replacement — anything that does neither is a page you have chosen to drop. Crawl the site before the port and again on staging, diff the two URL lists, and treat every URL present in the first list and absent from the second as a blocker rather than a cleanup task. Content equivalence and self-referencing canonicals matter too, but the redirect map is what decides the outcome.
Next step

Ready to escape the platform?

Free 30-minute diagnostic. Written cutover plan and fixed-fee quote inside 24 hours.

Book free diagnostic →