Transferring from platform to self-hosted Supabase
For a detailed, step-by-step guide on restoring your database from the Supabase platform to a self-hosted Supabase instance, see Restore a Platform Project to Self-Hosted.
Quick reference#
Back up your cloud database:
supabase db dump --db-url "[CONNECTION_STRING]" -f roles.sql --role-onlysupabase db dump --db-url "[CONNECTION_STRING]" -f schema.sqlsupabase db dump --db-url "[CONNECTION_STRING]" -f data.sql --use-copy --data-onlyRestore to your self-hosted instance:
psql \ --single-transaction \ --variable ON_ERROR_STOP=1 \ --file roles.sql \ --file schema.sql \ --command 'SET session_replication_role = replica' \ --file data.sql \ --dbname "postgres://postgres.your-tenant-id:[POSTGRES_PASSWORD]@[your-domain]:5432/postgres"