Reputation: 151
I have been trying to fix this problem, I could not search any documentation for this specific problem. I have everyhing setup, the project is linked, the docker is running, I just can not figure out the way to pull data from my production database in supabase portal into my database in local environment
Any form of help is appreciated
Upvotes: 7
Views: 10007
Reputation: 2074
supabase db pull
supabase db dump --data-only > supabase/dump-data.sql
then run this sql on local database started with supabase start
.
Usually it's localhost:54322
, postgres
db, postgres
user, postgres
password.
supabase db remote commit
prints warning:
Command "commit" is deprecated, use "db pull" instead.
...would sync records insertions but wouldn't sync records deletions.
To fix it clear target local tables before applying data dump.
For example you can achieve it with DBeaver x-platform database client.
Select tables to clear, right click, Tools -> Truncate, then on dialog window "Truncate table parameters" -> "Settings" -> check "\[v\] Cascade" -> \[Proceed\] button
Upvotes: 7
Reputation: 1152
You can use supabase db remote commit
to capture any changes required for your local database to match the schema of your remote Supabase project.: https://supabase.com/docs/guides/cli/local-development#link-your-project
Upvotes: 0