By Sascha Heyer · Last updated December 4, 2026
Supabase Auth stores every user in Postgres, in the auth schema of your project’s database. That is good news for backups: the users, their identities (Google, GitHub, email) and their password hashes are ordinary rows you can dump and restore. It also means a backup that skips the auth schema silently loses every account.
Where the users are
auth.users: one row per user withid,email,phone,encrypted_password(a bcrypt hash),raw_user_meta_data,raw_app_meta_dataand timestamps.auth.identities: the linked sign-in providers per user. Without these rows, OAuth users cannot sign in after a restore.auth.sessions,auth.refresh_tokens,auth.mfa_factorsand a few more: sessions, tokens and MFA. Back them up with the rest; whether you restore them depends on the job.
Your own tables usually point at auth.users(id) through a profiles table or foreign keys, so restoring the app’s data without the users breaks those references.
Back up the auth schema with pg_dump
The default role cannot always read everything, and row level security can stop pg_dump. Create a read-only backup role once, in the SQL editor:
create role liferaft_backup with login password 'a-long-random-password' bypassrls;
grant pg_read_all_data to liferaft_backup;Then dump only the user tables, or keep them in your full backup by simply not excluding the auth schema:
export DB_URL='postgresql://liferaft_backup.<project-ref>:<password>@aws-0-<region>.pooler.supabase.com:5432/postgres'
pg_dump "$DB_URL" --data-only --no-owner --no-privileges \
--table=auth.users --table=auth.identities \
| gzip > auth-users-$(date +%F).sql.gzExport users as CSV
For a mailing list, a CRM import or a support spreadsheet, a CSV of selected columns is enough. Leave the password hash out unless you need it:
psql "$DB_URL" -c "\copy (
select id, email, phone, created_at, last_sign_in_at, raw_user_meta_data
from auth.users order by created_at
) to 'users.csv' with (format csv, header)"A CSV with emails is personal data. Under GDPR and similar laws you need a reason to make the copy and a plan to delete it; keep it encrypted and out of git.
Move users to a new project, passwords included
Supabase’s troubleshooting guide on migrating auth users between projects says you can move all tables in the auth schema, hashed passwords included, so users do not have to reset anything. In the new project the auth tables already exist, so load data only, with triggers and foreign key checks paused:
pg_dump "$OLD_DB_URL" --data-only --no-owner --no-privileges \
--table=auth.users --table=auth.identities > auth-users.sql
(echo "SET session_replication_role = replica;"; cat auth-users.sql) \
| psql "$NEW_DB_URL" -v ON_ERROR_STOP=1Then check the numbers on both sides:
select (select count(*) from auth.users) as users, (select count(*) from auth.identities) as identities;Three things the dump does not carry:
- Sessions. The new project signs tokens with a different key by default, so existing sessions end and users sign in once more. Supabase’s guide describes reusing the old JWT secret if you need to keep them.
- Auth settings. Providers, client IDs and secrets, redirect URLs, SMTP and email templates are project settings, not rows. Copy them by hand.
- Your app’s rows. Load your
publicdata after the users so foreign keys toauth.usersresolve, or load everything in one run as the migration guide does.
Keep the users in every backup
Losing user accounts is worse than losing most app data: people cannot sign in, and you cannot even email them. Liferaft’s nightly copy always includes the auth schema, and the weekly restore drill counts the rows of auth.users and auth.identities like every other table, so the report tells you the users came back. Free for one project.
Rather not run this yourself? Liferaft runs the dump every night through a read-only role, stores the copy outside Supabase, and restores it every week to count every row. Free for one Supabase project; Solo is $9 a month for five. Back up my Supabase project free
Frequently asked questions
Do users keep their passwords after a migration?
Yes, if you move the auth schema with pg_dump and psql. Supabase’s troubleshooting guide on migrating auth users says the hashed passwords move with the auth tables, so users do not need to reset them. Existing sessions end unless the new project uses the same JWT secret, so users sign in once more.
Can I export Supabase users from the dashboard?
The Authentication › Users page is for viewing and managing users. For a complete export with identities and password hashes, query the auth schema with SQL or dump it with pg_dump, as shown in this guide.
Is it safe to keep a CSV of auth.users?
Treat it like a password database: it holds emails, phone numbers and bcrypt hashes. Keep it encrypted, out of git, and delete copies you no longer need.