Hey everyone. I have recently developed a product ...
# off-topic
s
Hey everyone. I have recently developed a product using supabase free tier with all the APIs, triggers etc. Now I want to create a new paid starter project and want to migrate everything from free one. I am not sure how to go about doing this. Is there any tool available that can migrate everything from one supabase project to another. I'm a noob. Sorry if the question sounds silly.
k
You could use pg_dump to make a full copy of the existing project (just schema, or with data), and load that into the new one.
s
Hey @ktosiek thanks for replying. This also includes all the triggers, rls policies etc right ?
k
Yes.
You might have problems if you use specific user IDs in your RLS, I'm not sure if authentication data can be migrated
s
Thanks @ktosiek . Can you point me to any resource that covers this.
k
pg_dump? It's a basic PostgreSQL tool, full documentation is here: https://www.postgresql.org/docs/current/app-pgdump.html
Are you trying to copy just the schema, or data too?
Looks like there's an answer in discussions on GitHub: https://github.com/supabase/supabase/discussions/773
s
Just schema. Thanks for these. I will check them out.
k
For just schema you should be able to use
pg_dump --schema-only --schema=public ...
to avoid conflict with supabase internal schemas. Also, in the future, you could use a migration system to keep multiple projects (say staging and prod) in sync. Supabase CLI has a basic migration tool.
s
Hey @ktosiek Can you suggest any resource where I can learn how to setup a migration system between 2 supabase projects. I want to include this in my GitHub actions.