// יציאה

להוציא את האפליקציה מ-Lovable

לאן המדריך הזה מעביר

גם בתים אחרים עובדים (GitLab לקוד, Netlify או Cloudflare לאחסון, שרת Postgres אחר לנתונים); סדר המעבר נשאר אותו דבר.

מה שלכם ומה אפשר לקחת

  • Your app's source code, including its config files and the database migration files in supabase/migrations/. Lovable's terms say the apps and code you create with it are yours.
  • Your database: tables, rows, indexes, row-level security policies, functions and triggers, whether it runs on Lovable Cloud or on a Supabase project you connected.
  • Your users' accounts with their password hashes. They are part of the Cloud database export, so users keep their passwords after a restore into Supabase.
  • The files in your storage buckets, and the bucket definitions and access policies, which are in the migration files.
  • Your Edge Function code in supabase/functions/, which travels with the repository.

מה לא יכול לצאת

  • Secret values such as payment or email API keys. You set each one again, in Supabase for Edge Functions and in Vercel for server code.
  • App connectors and Lovable AI calls. They run through Lovable with credentials Lovable manages, which cannot be copied out, so each one needs your own provider account.
  • Sign-in provider settings such as Google sign-in. Managed OAuth only works on Lovable Cloud, so you configure every provider again in Supabase.
  • Active sessions. The new Supabase project signs tokens with its own keys, so everyone who is signed in has to sign in again.
  • Scheduled jobs are not guaranteed to come across. Compare the schedules after the restore and recreate the missing ones.
  • The lovable.app address. It stays with Lovable and keeps serving the last version you published there until you unpublish it.

איך מייצאים

  1. Open Project settings > Git and connect the project to GitHub. Git sync works on every plan: Lovable creates a new repository and keeps it in sync in both directions.
  2. On a paid plan you can also take a one-time snapshot with Download codebase in Project settings > Git, or at the bottom of the file panel in the code editor.
  3. For Lovable Cloud data, go to More > Cloud > Overview > Advanced settings, click Export data, then Export on the Database card, then Start export.
  4. Lovable emails you when the export is ready, and you download it from More > Cloud > Storage. Limits: databases up to 15 GB, a 5 GB file, one export every 24 hours.
  5. The export is a PostgreSQL custom-format .backup archive with zstd compression. It is not a SQL file you can paste into an editor.
  6. If the project uses a Supabase project you connected instead of Lovable Cloud, the database, users and files already sit in your own Supabase account. Skip the Cloud export.
  7. Download your storage files from More > Cloud > Storage. Neither Git sync nor the database export includes them.
  8. List the secrets your Edge Functions and server functions read. Secret values stored in Lovable are not in the repository or the export.

סדר המעבר

  1. קוד

    1. Check that Project settings > Git shows the project in sync with GitHub, then clone the repository and run the app locally to see which dependencies and environment variables it needs.
    2. Open package.json. Apps created from May 13, 2026 list @tanstack/react-start and run server code. Older apps are React + Vite and build to static files in dist.
    3. For a TanStack Start app, check that package.json lists nitro. Nitro detects Vercel and packages the server part for it with no extra configuration.
    4. For an older React + Vite app, add a vercel.json rewrite that sends every route to /index.html, so direct links and refreshes do not return 404.
    5. In Vercel, choose Add New > Project, import the repository and pick the branch you deploy from. Use npm run build and Node.js 22. Vercel needs no output directory setting.
  2. מסד נתונים

    1. Create a new Supabase project and save its project URL, project ID and publishable key.
    2. Apply the files in supabase/migrations/ in timestamp order, by pasting each one into the SQL Editor or with npx supabase link and npx supabase db push.
    3. Install PostgreSQL client tools built with zstd support, then run pg_restore --list on the archive to see what it contains.
    4. Restore the data you need, including the auth schema that holds your users, with pg_restore. Include the sequence values so new records get valid IDs.
    5. Test the restore on the new project first. Do not add --clean without reviewing it, because it drops the objects being restored.
    6. Check tables, row counts and relationships in the Table Editor, and create a test record before you move on.
  3. התחברות ואחסון קבצים

    1. In Supabase, open Authentication > Sign In / Providers and enable each provider your app used. Then update the redirect URLs in each OAuth app, such as Google, to the new Supabase project URL.
    2. Open Authentication > URL Configuration, set the Site URL to your production domain and add your Vercel URLs to the Redirect URLs list.
    3. Upload the storage files you downloaded into the buckets with the same names under Storage in Supabase.
    4. Add your function secrets on the Edge Function Secrets page or with supabase secrets set, then deploy the functions with npx supabase functions deploy.
    5. In Vercel, set VITE_SUPABASE_URL, VITE_SUPABASE_PUBLISHABLE_KEY and VITE_SUPABASE_PROJECT_ID (plus SUPABASE_URL and SUPABASE_PUBLISHABLE_KEY for TanStack Start) to the new values and redeploy.
    6. On the Vercel URL, sign in with a migrated account, upload and download a file, and call each Edge Function.
  4. דומיין

    1. Plan the final copy: pause writes, request a fresh Cloud export, copy any storage files that changed, and restore them into Supabase.
    2. In Vercel, open your project's Settings > Domains, click Add Domain, enter your domain and add the DNS records Vercel shows at your registrar.
    3. Add the domain to the Site URL and Redirect URLs in Supabase, and to each OAuth app's allowed URLs.
    4. When the domain serves the new app, unpublish the app on Lovable if you no longer want the lovable.app address to serve it.
    5. Remove Lovable Cloud only after you have downloaded and checked the export and your files. Removal deletes the backend for good, including exports saved in its storage.

מה נשבר בדרך כלל אחרי המעבר

  • Direct links and page refreshes return 404 on an older React + Vite app until a rewrite to /index.html is in place.
  • The live app still reads and writes the old backend because the VITE_ values are built in at build time. Change them in Vercel, then redeploy.
  • Sign-in fails with a redirect error because the new URL is missing from the Supabase Redirect URLs or from the OAuth app's allowed URLs. לתיקון
  • New records fail with duplicate key errors when the sequence values were not restored with the data.
  • AI features and app connectors stop working once the backend moves, because those calls ran through Lovable. A key you add for a replacement must stay in server code. לתיקון
  • Edge Functions return errors because their secrets were not set in the new Supabase project.

מקורות