<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ricardo N.</title>
    <description>The latest articles on DEV Community by Ricardo N. (@ricardonldev).</description>
    <link>https://dev.to/ricardonldev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4252686%2F0762adbc-c72f-4f88-a6e0-7d964f79190e.png</url>
      <title>DEV Community: Ricardo N.</title>
      <link>https://dev.to/ricardonldev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ricardonldev"/>
    <language>en</language>
    <item>
      <title>Moving a Lovable app from Lovable Cloud to your own Supabase (with users keeping their passwords)</title>
      <dc:creator>Ricardo N.</dc:creator>
      <pubDate>Wed, 18 Nov 2026 23:04:18 +0000</pubDate>
      <link>https://dev.to/ricardonldev/moving-a-lovable-app-from-lovable-cloud-to-your-own-supabase-with-users-keeping-their-passwords-7em</link>
      <guid>https://dev.to/ricardonldev/moving-a-lovable-app-from-lovable-cloud-to-your-own-supabase-with-users-keeping-their-passwords-7em</guid>
      <description>&lt;p&gt;If your app runs on Lovable Cloud and you want your own Supabase project (direct database access, your own backups, a region you choose, or clean ownership before handing the app over), there is no one-click transfer. Lovable's &lt;a href="https://docs.lovable.dev/tips-tricks/external-deployment-hosting" rel="noopener noreferrer"&gt;external deployment guide&lt;/a&gt; lists what moves, but the tricky parts are left to you.&lt;/p&gt;

&lt;p&gt;This is the order I follow. I rehearsed it end to end on a local Supabase before doing it for anyone, and the scripts are open source (link at the end).&lt;/p&gt;

&lt;h2&gt;
  
  
  A date to know first: December 1, 2026
&lt;/h2&gt;

&lt;p&gt;Lovable retired the Test/Live split on October 23, 2026. Every project now runs on one database. Detached Test databases can still be restored on request, but &lt;strong&gt;on December 1, 2026 they are deleted for good&lt;/strong&gt; (&lt;a href="https://docs.lovable.dev/features/environments" rel="noopener noreferrer"&gt;Lovable docs&lt;/a&gt;). If anything you need lives only in Test, ask Lovable to restore it before then. If you want separate development and production databases again, that is one more reason to own your Supabase setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. List what only works inside Lovable
&lt;/h2&gt;

&lt;p&gt;Before moving anything, write down the features that depend on Lovable itself. Typical ones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lovable AI calls (you will need your own model provider key)&lt;/li&gt;
&lt;li&gt;emails sent by the platform&lt;/li&gt;
&lt;li&gt;Google sign-in configured through Lovable (you will need your own Google OAuth client)&lt;/li&gt;
&lt;li&gt;scheduled jobs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of these needs a replacement on your side. Finding out after the switch is the expensive way.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Create the schema in the new project
&lt;/h2&gt;

&lt;p&gt;Apply your migrations in order (&lt;code&gt;supabase/migrations&lt;/code&gt;, or your ORM's migration folder). Two things to watch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;some migrations insert sample or seed rows. If you import your real data afterwards, you get duplicates or key conflicts. Check for &lt;code&gt;INSERT&lt;/code&gt; statements in migrations.&lt;/li&gt;
&lt;li&gt;extensions used by your schema must be enabled in the new project first.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Import the data with triggers switched off
&lt;/h2&gt;

&lt;p&gt;Most Lovable apps have a trigger on &lt;code&gt;auth.users&lt;/code&gt; that creates a profile row for each new user. If it fires during the import, every user gets a second profile, or the import fails on a unique key.&lt;/p&gt;

&lt;p&gt;Import in replica mode so triggers do not run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;psql &lt;span class="s2"&gt;"$NEW_DB_URL"&lt;/span&gt; -v &lt;span class="nv"&gt;ON_ERROR_STOP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 \
  -c &lt;span class="s2"&gt;"SET session_replication_role = replica"&lt;/span&gt; \
  -f data.sql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my rehearsal, the same import without replica mode fails. That is the control that shows the step matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Users keep their passwords
&lt;/h2&gt;

&lt;p&gt;Supabase stores bcrypt hashes in &lt;code&gt;auth.users&lt;/code&gt; (and the provider links in &lt;code&gt;auth.identities&lt;/code&gt;). Move both tables with your data and users sign in on the new project with their old passwords. No reset emails.&lt;/p&gt;

&lt;p&gt;One honest caveat: the new project has a different JWT secret, so everyone who is currently signed in has to sign in again once. Passwords stay the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Fix the sequences
&lt;/h2&gt;

&lt;p&gt;After a bulk import, serial ids still start at 1 and the next insert fails with a duplicate key. Set each sequence to the current maximum:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="nf"&gt;setval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;pg_get_serial_sequence&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'public.orders'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'id'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="nb"&gt;coalesce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Repeat for every table with a serial or identity column.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Storage files, same paths
&lt;/h2&gt;

&lt;p&gt;Download the files from each bucket and upload them to buckets with the same names, keeping the exact object paths. Your rows usually store paths, not full URLs, so keeping paths means nothing in the data has to change. Recreate the storage policies too, then test that a user can read their own file and not someone else's.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Compare before and after
&lt;/h2&gt;

&lt;p&gt;Do not trust "it ran without errors". Count things on both sides and compare:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;rows per table&lt;/li&gt;
&lt;li&gt;RLS enabled per table, and the number of policies&lt;/li&gt;
&lt;li&gt;functions and triggers&lt;/li&gt;
&lt;li&gt;users and identities&lt;/li&gt;
&lt;li&gt;files per bucket&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If any number differs, stop and find out why before switching.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Switch the app
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;freeze writes in the old app while you export, or data written after the export is lost&lt;/li&gt;
&lt;li&gt;point the app at the new project (in Lovable apps this is usually &lt;code&gt;VITE_SUPABASE_URL&lt;/code&gt; and the publishable/anon key)&lt;/li&gt;
&lt;li&gt;redeploy edge functions and set their secrets in the new project&lt;/li&gt;
&lt;li&gt;sign in with a real user and use the main features&lt;/li&gt;
&lt;li&gt;keep Lovable Cloud for a few days as a fallback before removing it. Removal cannot be undone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember that on your own Supabase, backups, monitoring and backend security are your job now.&lt;/p&gt;

&lt;h2&gt;
  
  
  The scripts
&lt;/h2&gt;

&lt;p&gt;Everything above is in a small, tested toolkit: a plan generator that reads your repo, a data extractor for Lovable's export, a storage uploader and the before/after counts: &lt;a href="https://github.com/ricardonldev/lovable-cloud-to-supabase" rel="noopener noreferrer"&gt;github.com/ricardonldev/lovable-cloud-to-supabase&lt;/a&gt;. The rehearsal runs on a local Supabase with made-up users and checks old passwords, RLS isolation, storage policies, sequences and special characters.&lt;/p&gt;

&lt;p&gt;If you would rather have it done for you, I offer it as a fixed-price service on &lt;a href="https://www.fiverr.com/ricardonldev/migrate-your-lovable-app-from-lovable-cloud-to-your-own-supabase" rel="noopener noreferrer"&gt;Fiverr&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Not affiliated with Lovable or Supabase. Written with AI assistance (Claude); the steps and scripts are tested by me.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>supabase</category>
      <category>postgres</category>
      <category>webdev</category>
      <category>lowcode</category>
    </item>
  </channel>
</rss>
