Export current state of DB as migrations file?

Is it possible to create a migrations.sql file from the current state of the database? If so how do I do this?
5 Replies
Olyno
Olyno2y ago
Hi :vmathi: Do you mean how to do a postgres backup?
turabox
turaboxOP2y ago
Hi! Basically what I'm trying to do is create another supabase project with the exact same DB setup I suppose I should have asked that as the first question haha
Olyno
Olyno2y ago
You can do that by using the migration and local env of Supabase. More informations here: https://supabase.com/docs/guides/cli/managing-environments
Managing Environments | Supabase Docs
Manage multiple environments using Database Migrations and GitHub Actions.
turabox
turaboxOP2y ago
That's exactly what I'm looking for, thank you!
Olyno
Olyno2y ago
You're welcome!

Did you find this page helpful?