Import from Supabase.
Bring Supabase users across from one COPY statement against your project's database.
Run this statement against your project’s database, with psql and
the connection string from the dashboard:
Shell
psql "$SUPABASE_DB_URL" -c "COPY (
SELECT
u.id,
u.email,
u.encrypted_password,
u.email_confirmed_at,
u.created_at,
u.banned_until,
u.deleted_at,
coalesce(
(SELECT json_agg(json_build_object('provider', i.provider, 'provider_id', i.provider_id)
ORDER BY i.provider, i.provider_id)
FROM auth.identities i
WHERE i.user_id = u.id AND i.provider <> 'email'),
'[]') AS identities
FROM auth.users u
ORDER BY u.id
) TO STDOUT WITH (FORMAT csv, HEADER)" > supabase-users.csvThe statement is also authexport.SupabaseCopy.
- Each user keeps the UUID from
auth.users. - The address is verified when
email_confirmed_atis set. - A bcrypt
encrypted_passwordcomes across. - An identity with the provider
googlebecomes a Google identity, andgithuba GitHub identity. - A user whose
banned_untilis after the import is skipped asblocked, and a user withdeleted_atasdeleted. - Multi-factor factors in
auth.mfa_factorsstay behind. Those people enroll again.