All posts

Move your Lovable or Bolt app to your own GitHub and hosting

Your app lives inside Lovable or Bolt. You want to own the code, hand it to a developer, or host it on Netlify, Vercel or Cloudflare Pages, and you fear breaking it. Here is how I would approach it. Each vendor fact comes from the vendor's own docs. Docs change, so open the linked page before you rely on a detail.

Short answer: getting the code onto GitHub is the easy part. The hard part is the database, user accounts, stored files, secret keys, login redirects and payment webhooks. Move those on purpose, test the new copy, and only then change the domain.

1. Get the code out

Lovable. Lovable's GitHub integration creates a new repository for your project, private by default. You cannot link an existing one. Sync runs both ways: changes in Lovable go to GitHub, and changes pushed to the active branch come back into Lovable. It syncs one branch at a time, by default the repository's default branch (usually main).

The same page explains what happens if you change things later:

  • Renaming the repository, account or organization keeps sync running.
  • Transferring the repository only keeps sync if your Lovable workspace also has a GitHub connection for the new owner. Otherwise Lovable disconnects the project.
  • Deleting the repository stops the sync. Restoring it on GitHub resumes sync; reconnecting the project instead creates a new repository.

So you can keep editing in Lovable after connecting GitHub. If a developer should own the repository, check the transfer rules first.

Bolt. Bolt's Git integration page says sync also runs both ways. Bolt saves your work to GitHub automatically and checks GitHub every 30 seconds for changes made outside Bolt. You can build in Bolt, work in GitHub, and come back to Bolt. The Bolt project stays on the main branch, so you cannot switch it to another branch.

For a one-off copy, Vercel's guide on deploying a Bolt app says you open the project, click the project title in the top left, then Export, then Download. That gives a .zip with the source code. I did not find this on Bolt's own help pages, so check your version.

2. Code on GitHub is not the whole app

The repository holds the front end and perhaps some server functions, not your data. Ask: where are the database, the user accounts, the uploaded files and the secret keys?

Lovable Cloud. The Lovable Cloud docs say it is a built-in backend with a database, storage, authentication, realtime and functions, using Supabase's open-source foundation. They also say Lovable "does not move a project from the built-in backend to your own Supabase project in one step". The move is manual: you export and restore the database into your own Supabase project, move the storage files and code, and set up authentication, secrets and other services again. The docs do not say whether user accounts can be exported, so ask Lovable support.

The page also warns that removing the built-in backend permanently deletes the database, its backups, user accounts and storage files. Remove nothing until the new setup is verified.

Bolt. Bolt's Supabase page says Bolt has a built-in database and that you can claim an existing Bolt database in Supabase. Claiming needs a Supabase organization owner, and using Supabase with Bolt needs a Pro or Teams plan. It also says there is no supported flow for moving a Supabase database into a Bolt database. Check data ownership with Bolt.

If your app already uses your own Supabase project, the data stays where it is. Then the move is mostly code, settings and domain. Either way, take a backup first. See what Supabase, Neon and Firebase back up.

3. Environment variables and keys

Vite's env guide says variables with the VITE_ prefix are exposed in client-side code after bundling. Anyone can read them in the browser, so never put secret keys in them. The same guide says to add *.local to .gitignore so local env files stay out of version control.

Sort your keys into two lists:

  • Public by design. A Supabase URL and public (anon) key, a Stripe publishable key. Fine in VITE_ variables.
  • Secret. Stripe secret keys, webhook signing secrets, email API keys, a Supabase service role key. Server code and the host's environment settings only.

Search the repository for keys pasted into code. If a real secret was ever committed, create a new key and retire the old one. Git keeps history, so deleting the line is not enough. To check the live site and the history step by step, see is your API key exposed?

On the new host, add the variables in the project settings. Vercel's environment variables page says a change applies only to new deployments, so redeploy after you edit. It also lets you paste in a whole .env file, which helps when you move a project.

4. Build settings on the new host

For a Vite app the usual values are build command npm run build and publish directory dist. Netlify's build docs explain both settings, and say you can set them in the dashboard or in netlify.toml, where the file wins over the dashboard. Those docs do not list Vite defaults, so check the values against your package.json. Vercel says it detects the framework and builds automatically.

The "refresh gives 404" problem

Many AI-built apps are single-page apps. The browser router handles /pricing, but the server has no such file. Refresh on /pricing and you get a 404. Each host needs a fallback rule:

  • Netlify. The rewrites docs give a _redirects rule: /* /index.html 200.
  • Vercel. The Vite on Vercel page says deep links do not work out of the box in a single-page Vite app. You add a vercel.json with a rewrite from /(.*) to /index.html.
  • Cloudflare Pages. Its routing docs say that without a top-level 404.html, Pages treats the project as a single-page app and serves the root for unknown paths.

5. Sign-in after the move

If you use Supabase Auth, the new address must be allowed. Supabase's redirect URL guide says the Site URL is the default redirect when your code gives none, and is important for email confirmations and password resets. It also says the redirectTo URL should match its Redirect URLs list. If the Site URL still points at the old address, confirmation emails send people there.

Google, Apple and other providers keep their own callback URL lists. Add the new domain there too. See what breaks with social sign-in.

Your own functions may also only allow the old address. If the new site shows "blocked by CORS policy" in the browser console, see the CORS fix.

6. Custom domain and DNS

Test on the host's own address first. Switch the domain last. Netlify's external DNS guide says a subdomain needs a CNAME record, and an apex domain needs an ALIAS, ANAME or flattened CNAME record, or an A record as a fallback. It also warns that it may take a full day for DNS changes to spread. Use the exact values your host shows.

Also check what Google gets on the new host. Lovable's SEO docs describe how it renders pages for crawlers on apps it hosts, and say nothing about an app you host yourself. After the move, check that your public pages still arrive as real HTML: see Google can't see your Lovable or Bolt app.

Before you switch, write down your current DNS records, especially email ones, and change only the website records. The records per platform, www or no www, and the certificate wait are in putting your app on your own domain.

7. Payments and webhooks

If your app takes payments, the webhook URL changes with the domain. Stripe's webhook docs say endpoints must be public HTTPS URLs, and that each endpoint has its own signing secret. If you use the same endpoint for test and live keys, the secret is different for each. So when you register the new URL, copy its secret into the new host's environment settings.

Stripe counts a redirect as a failed delivery, so do not leave the old URL redirecting. Set the endpoint to the final URL. After the switch, open the endpoint's Event deliveries tab and check that nothing shows Failed. More in taking payments in an AI-built app.

A move checklist

  1. Back up and list. Export the database, download the files, and list every service and key the app uses.
  2. Connect GitHub and confirm the code is there.
  3. Set up the new backend if you leave Lovable Cloud or Bolt's database, and restore the data.
  4. Create the host project. Set the build command, publish directory and the SPA fallback.
  5. Add the environment variables and redeploy.
  6. Update auth. Site URL, redirect URLs, provider callback URLs.
  7. Test on the host's own address. Sign up, sign in, reset a password, upload a file, refresh on a deep link, and make a test payment.
  8. Move the Stripe webhook and check deliveries.
  9. Switch the domain. Check HTTPS, with and without www.
  10. Keep the builder version as a fallback for a while. Delete the old backend last.

What usually breaks

Things to check, not predictions:

  • A page refresh gives a 404 (missing fallback rule).
  • The app loads but shows empty data (a missing environment variable, or the data was not moved).
  • Sign-in or password reset sends users to the old address.
  • Uploaded images are missing (files not moved).
  • Payments succeed but the app does not update (old webhook URL or old signing secret).
  • Emails stop after a DNS change.

How to check each of these in a minute or two: your app works in the editor but breaks live.

Want this move done for you?

I move and fix apps built with Lovable, Bolt, Cursor or Replit: code, data, hosting, domain, sign-in and payments, tested before the switch. If you plan to bring in a developer, see what access to hand over, and if you doubt the code itself, fix or rebuild an AI-built app. Or send me the details on the hire page and I'll reply within 24 hours.