Moving in and out
Move in from Supabase
Tables, data, access rules, accounts with their passwords, and files, into a new Rezin Core project. Start at Move in in your company's sidebar and choose Supabase. The general steps and safety rules are on Move a project in.
This has been tested against dumps shaped like Supabase's and a stand-in database, not yet against a live Supabase project. The dry run shows you everything before anything is written; read it.
What you supply
Either of these for the database:
- A dump. Made with
pg_dumpfrom your Supabase database:
`` pg_dump "postgresql://postgres.abcdefgh:[YOUR-PASSWORD]@aws-0-us-east-1.pooler.supabase.com:5432/postgres" \ --no-owner --no-privileges --schema=public --schema=auth --schema=storage -f dump.sql ``
- The connection string. Rezin Core runs
pg_dumpfor you, in a read-only session over an encrypted connection. It reads yourpublicschema, and the rows ofauth.users,auth.identities,storage.bucketsandstorage.objects. The connection string is used for this import and never stored.
And, only if you want the files themselves brought over:
- Your project's address and service key. The list of files is in the database; the files are fetched one at a time from your project's storage with the key. Used for this import and never stored.
What comes over
| On Supabase | On Rezin Core |
|---|---|
Tables, columns, defaults, constraints, indexes, sequences in public | The same, in the new project's schema |
| Enumerated types, views | The same |
| Functions and triggers in SQL or PL/pgSQL | The same, unless security definer (refused and listed) |
| Rows | The same rows, identity and sequence values carried on |
| Row-level security policies | Translated, shown beside the original, and held for you to put in force |
auth.users | Your application's accounts, with the same IDs |
| bcrypt password hashes | Kept. Checked once at the person's first sign-in here and replaced with an Argon2 hash |
| Google and GitHub identities | Connected to the same accounts |
| User metadata, confirmation and last sign-in times | A table in your project, imported_accounts, one row per account |
| Storage buckets and objects | Buckets with their public setting, size limit and allowed types; files fetched if you gave the key |
Account IDs are kept, so a user_id column in your tables still matches the account it meant.
How access rules are translated
| In your policy | Becomes | |
|---|---|---|
auth.uid() | core.app_user() | The signed-in account's ID. |
auth.role() | (case when core.app_user() is null then 'anon' else 'authenticated' end) | The same two answers. |
to authenticated | An added condition core.app_user() is not null | Your application has one database role here; "signed in" is a condition. |
to anon, to public, or no to | No added condition | It applied to callers who were not signed in; it still does. |
public. in front of a name | The new project's schema | |
auth.jwt(), auth.email() | Not translated | Listed with the reason. Rewrite the rule by hand. |
to service_role | Not translated | Here your secret key is used by your own server. Write a rule for that if you need one. |
A rule that reads storage.objects or another Supabase schema | Not translated | That table does not exist here. |
Every translation is shown beside the original with a note for each change. A rule that could not be translated is listed with the reason, and its table stays closed until you write one.
After the import each translated rule waits for you. Putting one in force creates the policy and gives your application the matching permission on that table (reading for a select rule, and so on). Use View as on the project's Access rules page to see what a caller would be given.
What does not come over
- Edge functions. They are not in the database. Rewrite each as a function: one JavaScript module, called at its own address.
- Database webhooks. Listed by table; recreate them on the Webhooks page.
- Realtime. The tables in your
supabase_realtimepublication are listed; switch live updates on for each. - Extensions.
uuid_generate_v4()is rewritten to the built-ingen_random_uuid(). Anything else that needs an extension is reported where it failed. - **Links to
auth.users.** A foreign key from your table toauth.usersbecomes a plain column. The IDs are kept, so the values still match. - Accounts with no email address (phone-only or anonymous), and accounts marked deleted.
- Accounts whose email address already has an account on Rezin Core. Listed, with most of the address hidden.
- Supabase's own schemas (
auth,storage,realtime,vault,extensionsand the rest), its roles and their grants.
Passwords
Supabase stores bcrypt hashes. They are brought over as they are. The first time each person signs in here, the password they type is checked against the old hash; if it matches, it is stored again as an Argon2id hash and the old one is removed. Nobody is asked to choose a new password. Someone who signed up with Google or GitHub only has no password and signs in as before.
Switching over
The finished import shows the checklist described on Move a project in, and From their client calls to ours maps the calls your application makes.