Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data missing on supabase db dump #2605

Open
pschaub opened this issue Aug 12, 2024 · 2 comments
Open

data missing on supabase db dump #2605

pschaub opened this issue Aug 12, 2024 · 2 comments

Comments

@pschaub
Copy link

pschaub commented Aug 12, 2024

Describe the bug
If I run the command supabase db dump -f dump.sql, only the schema will be dumped. How can I do a full dump including the data?

$ supabase db dump -f dump.sql
Dumping schemas from remote database...
Dumped schema to dump.sql.

To Reproduce

  1. Link your project with supabase link
  2. Run supabase db dump -f dump.sql

Expected behavior
The dump includes the data

System information

  • Version of OS: Ubuntu 22.04.4 LTS in WSL2 (Windows 11)
  • Version of CLI: 1.187.10
  • Version of Docker: 24.0.7, build afdd53b
@pschaub
Copy link
Author

pschaub commented Aug 12, 2024

I've seen that there is the parameter --data-only. The command results into a warning that suggests a full dump. How can I run a full dump?

$ supabase db dump -f dump.sql --data-only
Dumping data from remote database...
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: detail: key
pg_dump: hint: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: hint: Consider using a full dump instead of a --data-only dump to avoid this problem.
Dumped schema to dump.sql.

@sweatybridge
Copy link
Contributor

It's more likely that you don't need to run a full dump. You can try starting your db locally from dump files. If no errors are thrown, then everything is fine.

Here are the commands to do that

supabase db dump | supabase migration new remote_schema
supabase db dump --data-only -f seed.sql
supabase db start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants