How to securely back up and restore 3 Supabase Auth users on Free plan using only mobile devices? #52257
Replies: 4 comments
|
Free plan has no scheduled backups, but you can run Two things matter:
Sketch of a workflow in a private repo. Store the connection string as the secret name: auth-backup
on: workflow_dispatch
jobs:
backup:
runs-on: ubuntu-latest
steps:
- name: Dump auth users and identities
run: |
sudo apt-get install -y postgresql-client gnupg
pg_dump "$DB_URL" --data-only --no-owner -t auth.users -t auth.identities > auth.sql
gpg --batch --pinentry-mode loopback --passphrase "$BACKUP_PASSPHRASE" -c auth.sql
env:
DB_URL: ${{ secrets.DB_URL }}
BACKUP_PASSPHRASE: ${{ secrets.BACKUP_PASSPHRASE }}
- uses: actions/upload-artifact@v4
with:
name: auth-backup
path: auth.sql.gpg
retention-days: 30
Notes:
|
|
Since you only need to back up and restore 3 users and don't have access to a computer or CLI, setting up external tooling or GitHub Actions is honestly overkill. You can do this entire process directly inside the Supabase Dashboard using Safari or Chrome on your phone. Because queries in the Dashboard SQL Editor execute under the privileged Here is the straightforward mobile workflow: Step 1: Back up the 3 users from your mobile browser
select id, email, encrypted_password, email_confirmed_at, raw_app_meta_data, raw_user_meta_data, created_at
from auth.users
where email in ('user1@example.com', 'user2@example.com', 'user3@example.com');
select id, user_id, identity_data, provider, provider_id, last_sign_in_at, created_at, updated_at
from auth.identities
where user_id in (
select id from auth.users
where email in ('user1@example.com', 'user2@example.com', 'user3@example.com')
);Download this CSV as well. Because this all happens inside the dashboard over HTTPS and saves directly to your device, no raw data leaves your controlled environment. Step 2: Restore the users in your new project When you are ready to restore into a fresh Supabase project:
set session_replication_role = 'replica';
insert into auth.users (
id,
instance_id,
aud,
role,
email,
encrypted_password,
email_confirmed_at,
raw_app_meta_data,
raw_user_meta_data,
created_at,
updated_at
) values (
'PASTE_USER_UUID',
'00000000-0000-0000-0000-000000000000',
'authenticated',
'authenticated',
'user1@example.com',
'PASTE_ENCRYPTED_PASSWORD_HASH', -- the $2a$10$... bcrypt string
now(),
'{"provider": "email", "providers": ["email"]}'::jsonb,
'{}'::jsonb, -- or your raw_user_meta_data from the backup
now(),
now()
);
insert into auth.identities (
id,
user_id,
identity_data,
provider,
provider_id,
last_sign_in_at,
created_at,
updated_at
) values (
'PASTE_IDENTITY_ID', -- from your identities backup (or matches user UUID)
'PASTE_USER_UUID',
jsonb_build_object('sub', 'PASTE_USER_UUID', 'email', 'user1@example.com'),
'email',
'PASTE_USER_UUID',
now(),
now(),
now()
);(Note: Do not include
set session_replication_role = 'origin';Key benefits of doing it this way:
If this helps you safely back up and restore your auth accounts from mobile, please mark it as the answer so others can find it easily! |
|
i'd hold off on using the csv restore example for the 3 original accounts. it replaces i'd start with supabase's cli backup/restore route, recommended for free projects. the data dump includes auth records, and github actions can run it off-device. none of these documents establishes a supported mobile-only selective restore or guarantees existing sessions survive your synthetic test is a useful start. i'd keep the live accounts untouched and test your encrypted backup in a separate project, checking the restored ids, identity links and password sign-in |
|
Without a computer, whatever runs ReviveDB works from the browser. You connect the project with Supabase OAuth, and every backup includes the https://revivedb.dev (I build ReviveDB) |
Uh oh!
There was an error while loading. Please reload this page.
Hello Supabase Community,
I am using Supabase Free and need a secure, officially supported method to back up and independently restore three existing Supabase Auth users and their email identities.
I only have an iPhone and an Android phone, with access to Safari, GitHub, and the Supabase dashboard. I do not have a computer.
We have successfully tested encrypted backup and independent restoration using three synthetic Auth users, but we still need to protect and verify recovery of the three original accounts.
The Free plan does not include scheduled dashboard backups.
Is there a supported, no-additional-cost procedure that can be safely operated from mobile devices, preserving user IDs, identity relationships, and password hashes?
We do not want to modify existing users, reset passwords, disrupt sessions, or expose credentials and sensitive Auth records.
Please provide the recommended documentation and steps.
Thank you for your help.
All reactions