Local Development

Restoring a downloaded backup locally

Restore a backup of a remote database on a local instance to inspect and extract data


If your paused project has exceeded its restoring time limit, you can download a backup from the dashboard and restore it to your local development environment. This might be useful for inspecting and extracting data from your paused project.

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.

1
2
3
supabase 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.

1
psql '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.

1
2
supabase stopsupabase start

A Postgres database started with Supabase CLI is not production ready and should not be used outside of local development.