DEV Community

PatchAndShip
PatchAndShip

Posted on

Moving off Lovable Cloud to your own Supabase project

If your app runs on Lovable Cloud and you want your database in a Supabase account you own, you can move it. Lovable doesn't do it in one step, though. Here's what changes, what you keep, and a quick way to check the move worked before you remove anything.

Why people move

It usually comes down to three things. You want your database in a Supabase account you own and control. You want to see and manage your own usage and billing. And you want room to keep building with other tools, not only inside Lovable.

What you keep

Lovable can export your database, including your users' accounts. You start the export under More → Database → Manage → Settings → Export data → Export → Start export, then download it from More → Storage.

Then you restore that export into your new Supabase project by running a few restore commands on your own computer, with your own database password.

Your users keep their passwords, so nobody has to reset anything.

What changes

The export is a copy of your data and users. It isn't a working app on its own. A few things don't come with it:

  • Files, secrets, sign-in settings and edge functions. These have to be set up again in the new project.
  • Sessions. Anyone who's signed in will need to sign in again, once.
  • Your app's connection. Your env vars (in a Lovable app, usually VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY) still point at the old backend until you change them to the new project's URL and public publishable (or legacy anon) key, then rebuild.
  • Auth URLs. In your new project's Supabase Auth settings, update the Site URL and the redirect URLs to match your live app.
  • Google sign-in, if you use it. In Google Cloud, add your new Supabase callback URL under Authorized redirect URIs, and your live domain under Authorized JavaScript origins. Then turn on the Google provider in the new project and paste in your Google client ID and secret.

So the full job is: export, restore, check, reconnect sign-in, and point your app at the new project.

Don't remove Lovable Cloud yet

Leave your Lovable Cloud backend alone until you've checked everything on the new project. Using Remove database in Lovable (More → Database → Manage → Settings) permanently deletes the database, its backups, your app's user accounts and your storage files, and it can't be undone. Keep your export file too.

A 3-step self-check

Before you call the move done, run through these on your live app:

  1. Data and rules. Open the new project in Supabase and look at your tables. Are the rows there? Are your row level security policies there on the same tables as before? Then sign in as a normal user and make sure you see your own data, and not anyone else's.
  2. Sign-in. Sign in with an existing user's email and password. If you use Google, sign in with Google too and make sure it sends you back to your live app, not to a localhost or preview URL. If it bounces, look at the Site URL, the redirect URLs and the Google settings above.
  3. The app is really on the new project. Open your live app with the browser dev tools on the Network tab and check that requests go to the new project's Supabase URL. Upload and open a file if your app uses storage, and trigger anything that runs an edge function.

If all three pass, your app is running on a Supabase project you own. Only then think about removing the old backend.

If you'd rather not do it yourself

If you'd like it handled, we offer this move: you run the restore on your own computer with our step-by-step guide, and we never see your database password. We set the rest up with you and point your app at the new project. Auth users come over on every size, storage files on Medium and Large, and up to 10 edge functions on Large. You pick a size and send a request through the page. Details are here: Lovable Cloud to Supabase.

Questions about your own move? Ask in the comments.

Want the next guide by email? Sign up for our newsletter, Preview to Prod: patchandship.com/newsletter.

Top comments (0)