SupabaseS
Supabase5mo ago
HARISH

How to export/import SQL schema (tables, RLS policies, functions) between two Supabase

I’m working on a project using Lovable.dev (basically a Supabase wrapper), and I’ve already set up my dev project with tables, row-level security (RLS) policies, and Postgres functions.

However, Lovable doesn’t seem to provide a good built-in migration or schema syncing feature. I want to:

Dump the entire SQL schema (including table definitions, RLS policies, and functions) from my dev project.

Apply it to a new or existing project.

Ensure it updates existing tables without dropping data (like adding/removing columns or updating policies).

Has anyone done this between Supabase/Lovable projects?
What’s the cleanest way to handle this? CLI? Manual SQL? pg_dump? Any caveats?

Thanks in advance!
Was this page helpful?