Restoring a downloaded backup locally
Restore a backup of a remote database on a local instance to inspect and extract data
You can restore a downloaded backup to a local Supabase instance. This might be useful if your paused project has exceeded its restoring time limit. You can download the latest backup, then load it locally to inspect and extract your data.
If you want to restore your backup to a hosted Supabase project, follow the Migrating within Supabase guide instead.
Downloading your backup
First, download your project's backup file from dashboard and identify its backup image version (following the PG:
prefix):
Restoring your backup
Given Postgres version 15.6.1.115
, start Postgres locally with db_cluster.backup
being the path to your backup file.
123supabase initecho '15.6.1.115' > supabase/.temp/postgres-versionsupabase db start --from-backup db_cluster.backup
Note that the earliest Supabase Postgres version that supports a local restore is 15.1.0.55
. If your hosted project was running on earlier versions, you will likely run into errors during restore. Before submitting any support ticket, make sure you have attached the error logs from supabase_db_*
docker container.
Once your local database starts up successfully, you can connect using psql to verify that all your data is restored.
1psql 'postgresql://postgres:postgres@localhost:54322/postgres'
If you want to use other services like Auth, Storage, and Studio dashboard together with your restored database, restart the local development stack.
12supabase stopsupabase start
A Postgres database started with Supabase CLI is not production ready and should not be used outside of local development.