Backups [database & storage] without supabase-cli #22200
-
Database backups are well documented, but since the project evolve over time,
CONSTRAINT: the solution must work in hosted and self-hosted environment DatabaseBackuppg_dump -h xxxxx.pooler.supabase.com -p 5432 -d postgres -U postgres.xxxxx --schema-only > backup.sql Restorepsql -h xxxxx.pooler.supabase.com -p 5432 -d postgres -U postgres.xxxxx < backup.sql |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Would love to know the answer too |
Beta Was this translation helpful? Give feedback.
-
Same here. I would like to know what are the steps to do backup and restore. |
Beta Was this translation helpful? Give feedback.
-
Same here. Reading 3rd thread, no answer for this. |
Beta Was this translation helpful? Give feedback.
-
@kiwicopple Could we have your opinion on the topic? |
Beta Was this translation helpful? Give feedback.
-
@theranajayant @tristdrum @djshubs @neiled This is my procedure to backup supabase instance with classic tools.
The re-import process is the opposite, using I'm sharing with you the script I'm using to backup schemas. You can select which schema you want to include in your backup but also specify if you want You can set up environment variables ( ./pg_backup.sh --DB_HOST=<region>.pooler.supabase.com --DB_PORT=6543 --DB_NAME=postgres --DB_USER=postgres.<id> --DIR=./backup If you have any tips, please share |
Beta Was this translation helpful? Give feedback.
@theranajayant @tristdrum @djshubs @neiled
This is my procedure to backup supabase instance with classic tools.
I'm using only auth + postgres + storage in supabase, no other features will be covered.
psql
/pg_dump
. The most import schema (IMO) are: auth,public,storagerclone sync
(you have torclone config
before)The re-import process is the opposite, using
psql
/pg_restore
, it works well with data but, you could be blocked for schema as supabase protectsuperuser
role. You can also re-upload all buckets you saved using rclo…