Indie Hacker Playbooks

Rehearsing a Supabase Public-Schema Restore

Rehearse a public-schema export without treating it as a full backend clone

Definition

This is a scoped export-and-restore rehearsal for application data in Supabase's public schema, rather than a clone of its bundled backend services.

Perspectives

bear_dba (@bear_dba) (2026-11-04, Threads)

Export the application-owned public schema instead of restoring the entire Supabase database into a plain PostgreSQL target. A full dump can encounter Supabase-specific roles such as supabase_admin and authenticator; omit ownership and privilege metadata with --no-owner and --no-privileges. The source's dump also uses --schema=public, --clean and --if-exists, writing plain SQL to supabase_public.sql.

Prepare the target's required extensions before loading the SQL; the examples enable uuid-ossp and pgcrypto and mention uuid_generate_v4(). Load the file with psql -h localhost -p 5432 -U postgres -d my_target_db -f supabase_public.sql. Treat this as a portability rehearsal to reduce vendor dependence, not a complete service clone.

Account for auth.users separately: it is outside public. A separate Auth export and changes to application authentication may be needed; password-hash compatibility is a concern raised by the source, not demonstrated here.

How to apply

  • Fits a disposable rehearsal target when the application data being tested is in public; it is not an inventory of every schema or attached service.
  • Use Staging a Supabase Database Migration for API boundaries, service replacement and cutover planning around this narrower database exercise.
  • Keep rehearsal separate from the production exit decision in Deciding When to Leave Supabase; testing portability does not itself justify migrating.
  • Review Supabase for the bundled backend context rather than equating SQL portability with service parity.

Limits

  • No dump, extension creation or restore was executed for this wiki ingest. There is no demonstrated row reconciliation, constraint/policy validation, rollback or application-level acceptance test.
  • The raw command contains the malformed host db.xxxx.supabase.,com; it is preserved as written, not repaired into a runnable connection string. Dump commands are not presented here as a tested runbook.
  • The source includes --clean --if-exists but gives no destructive-operation review or safe-target checks. Production suitability is unverified.
  • The claims that these flags allow error-free import into any ordinary database, that no visible errors prove success, and that Auth is the only weakness are not established. Cross-schema dependencies, roles referenced by policies, extension locations and target/version compatibility are not assessed.
  • Password-hash incompatibility and eventual migration necessity remain one practitioner's assertions, not independently verified facts. Storage, Realtime and the complete authentication service are not captured by the described public-only export.

Original link

On this page