Staticbot logoStaticbot.dev
    Lovable logo
    Supabase logo

    Migrate from Lovable Cloud to Supabase

    Migrate Lovable Cloud to your own Supabase without making a single user reset their password.

    Lovable's official export path makes every real user reset their password (their docs: "you cannot export user passwords, so you need to trigger a password reset flow") — for any app with paying customers, that's a non-starter. Staticbot migrates auth users with password hashes intact, re-links OAuth identities (Google, GitHub, Apple…) so no one has to re-authorise, and migrates Edge Functions, vault secrets, and cron jobs alongside the database, storage, and RLS policies. The source Supabase service-role key never leaves your Lovable project — the export runs in-place via a temporary edge function that reads it from Supabase's built-in env vars. ~15 minutes, end to end.

    Point Staticbot at your Lovable GitHub repo and a target Supabase project, then host the frontend on your own AWS or Cloudflare (or on Staticbot-managed AWS). Optionally keep editing in Lovable afterward — Continuous Sync flows every push to your own production backend. Or follow the 8-step CLI guide below to do it yourself.

    Comparing tools? See Staticbot vs Dreamlit. Pricing: Lovable · Supabase · Staticbot

    Go to FAQ

    Prerequisite: connect your Lovable project to GitHub

    Staticbot reads your project via GitHub, so your Lovable project must be synced to a GitHub repository before you start a migration. Connect and authorize GitHub at lovable.dev/settings/git/github, then open your project and link it to a repository.

    Lovable GitHub connection settings
    Staticbot Migrations — Now Available
    Free for limited time

    Automate the hard parts of your migration

    Instead of running CLI commands manually, Staticbot's Migration tool connects to your source Supabase project, discovers what needs to move, then executes each phase automatically — with full visibility into what's happening at every step.

    Project Discovery

    Automatically inventories your source Supabase project

    Database Migration

    Applies your SQL migrations to the target instance

    Edge Functions

    Deploys all server-side functions automatically

    Storage Buckets

    Recreates your storage bucket configuration

    Auth Configuration

    Migrates authentication settings and policies

    Automated Data MigrationNew

    Exports and imports your data between projects automatically

    AI TroubleshootingNew

    AI diagnoses failed jobs and suggests fixes you can apply in one click

    Phase Tracking

    Real-time status for every step of the migration

    Start Automated Migration
    Staticbot Prepare Migration — select your GitHub project and target Supabase project
    Step 1 — Select the GitHub project to migrate and the target Supabase project
    Staticbot auto-populates Supabase configuration values from your source project
    Staticbot auto-populates Supabase configuration values — no manual copy-paste
    Migration Details dashboard showing phase-by-phase progress with live job status
    Real-time migration dashboard — phases and jobs update live as each step completes

    AI Troubleshooting

    New

    When a migration job fails, click the AI button to get an instant diagnosis. The AI analyzes the error, reads your migration files, and suggests a concrete fix — often a corrected SQL statement you can apply with one click.

    • Analyzes error context and migration files
    • Suggests corrected SQL you can review
    • One-click apply and automatic retry

    Automated Data Migration

    New

    No more manual CSV exports and imports. Staticbot can automatically export data from your source Lovable project and import it into the target Supabase project — handling table dependencies and foreign key ordering for you.

    • Automatic export from source project
    • Dependency-aware import ordering
    • No manual CSV handling required
    "Staticbot completely automated my Lovable-to-Supabase migration, which had previously seemed like an overwhelming project. The automation performed flawlessly and saved me hours of work and a lot of stress, so I'm grateful to have this tool available for future projects."

    -- Seth

    or do it yourself

    Manual migration

    How to migrate from Lovable to Supabase manually (8 steps)

    ~2–3 hours

    Prerequisites

    • New Supabase project created
    • Supabase CLI installed and authenticated
    • Git repository set up

    1Update Local Configuration

    Update your local environment to point to your new Supabase project.

    Update .env

    Replace your existing credentials with the new ones:

    • VITE_SUPABASE_PROJECT_ID
    • VITE_SUPABASE_PUBLISHABLE_KEY
    • VITE_SUPABASE_URL

    Update supabase/config.toml

    Update the project_id field with your new project's ID.

    Link Supabase CLI

    supabase link --project-ref <project-id>

    2Deploy Database Schema

    Push your existing database migrations to the new instance.

    supabase db push

    Verify that all migrations have been applied successfully.

    3Deploy Edge Functions

    Deploy all your server-side logic.

    supabase functions deploy

    If needed, remove any functions from config.toml that are no longer required, and verify that all deployed functions are active in your dashboard.

    4Configure Supabase Secrets

    Set up encryption and API keys via the Supabase dashboard or CLI.

    Critical: ENCRYPTION_SECRET

    Must be a 64-character hex string (not base64). Use this command to generate the correct format:

    openssl rand -hex 32

    5Migrate Data (with passwords intact)

    Don't use CSV exports for this

    Exporting tables as CSV from Lovable Supabase → Table Editor strips bcrypt password hashes from auth.users.encrypted_password, which forces every one of your users to reset their password. Use pg_dump instead — it preserves the hashes verbatim and gets foreign-key ordering right.

    Dump source data with pg_dump

    In Lovable, open Supabase → Project Settings → Database and copy the connection string. Then:

    pg_dump --data-only --no-owner --no-privileges \
      --schema=auth --schema=public --schema=storage \
      "$SOURCE_DATABASE_URL" > data.sql

    This dumps auth.users (including encrypted_password), auth.identities (OAuth links), all your public-schema rows, and storage metadata — in the right dependency order. For the broader question of which auth tables to migrate and which to deliberately skip (auth.schema_migrations, auth.flow_state, etc.), see our Supabase auth migration scope guide.

    Restore to your new Supabase

    Grab the target's connection string from Supabase → Project Settings → Database and apply the dump:

    psql "$TARGET_DATABASE_URL" -v ON_ERROR_STOP=1 -f data.sql

    Storage object files (the actual bytes in buckets) aren't in the database dump — copy them separately with the Supabase CLI or rclone against the S3-compatible storage endpoint. Existing users sign in with their existing passwords.

    6Reconfigure OAuth Providers

    Google/GitHub/Apple OAuth client IDs and secrets live in Supabase's auth control plane, not in the database — pg_dump doesn't carry them. In your new project's dashboard go to Authentication → Providers and re-enter each provider's client ID, secret, and redirect URL. The matching auth.identities rows are already restored from Step 5, so once providers are configured, OAuth users continue signing in without re-authorising. (More on why this gap exists and how to test for it before cutover in our auth migration scope guide.)

    7Remove Lovable AI Dependencies

    If applicable, update your code to remove references to the Lovable AI Gateway. Replace any Lovable AI calls with direct provider APIs and redeploy any affected edge functions.

    8Finalize & Deploy

    Clear Cache

    rm -rf node_modules/.vite
    npm run dev

    Hard refresh your browser and verify network requests are hitting the new Supabase instance.

    Commit & Push

    git add .env supabase/config.toml
    git commit -m "feat: Migrate to Supabase"
    git push origin main

    Lovable will automatically sync environment variables from GitHub. Verify the production environment update.

    Post-Manual Migration Checklist

    All edge functions deployed
    Encryption working (test API key)
    Database schema migrated
    Local dev connected
    Critical data imported
    Lovable production connected
    User accounts migrated
    All critical features tested

    Ready to Deploy the Frontend?

    Now that your app is on your own Supabase backend, host the frontend on AWS with zero configuration using Staticbot.

    View Lovable Deployment Guide

    Prefer the automated path?

    Let Staticbot handle the migration for you

    Staticbot handles the technical heavy lifting automatically. Connect your Supabase projects, confirm each phase in a dashboard, and you're done — no CLI required.

    ~15

    minutes

    vs

    2–3 hrs

    manual

    What gets automated

    DB schemasupabase db pushAuto
    Edge functionssupabase functions deployAuto
    Storage bucketsManual dashboard setupAuto
    Auth configSecrets + policiesAuto
    Data migrationManual CSV export/importAuto
    TroubleshootingAI-powered diagnosticsAuto

    Lovable Migration FAQ

    Related