Engineering · 6 min read

Migrate Supabase to Aurabase, keep your RLS

Affane Daylami · Fondateur · September 20, 2026

Back to blog

If you are on Supabase and are eyeing Aurabase (see our detailed comparison), the good news is that the hardest part is choosing. The table below lists precisely what changes in a migration — and it's short: schema, RLS policies, SDK, auth and storage remain the same.

This English text was generated automatically from the French original and has not been reviewed yet.

At Aurabase, we gave ourselves a strong constraint from the design stage: the SDK surface and the RLS conventions had to be drop-in compatible with Supabase. Same createClient(), same .from().select().eq(), same SQL Postgres policies. The idea: if you want to leave, leave — we make it trivial. Here is the full playbook.

#
Prior audit

What moves, what stays

Before you begin, list what will change and what will stay. Spoiler: the majority remains.

Postgres SchemaSAMEpg_dump → pg_restore. Extensions, triggers, functions, indexes — everything goes.
RLS PoliciesSAMESame syntax. auth.uid(), auth.role(), auth.jwt() work as is.
JavaScript SDK95% IDENTICALReplace @supabase/supabase-js with @aurabase/aurabase-js. Same chainable API.
Auth flowsSAMEsignUp, signInWithPassword, signInWithOAuth, mfa — same names, same signatures.
Storage APISAMEaura.storage.from(bucket).upload(...) · compat S3 · transferable RLS policies.
RealtimeSAMEchannel().on("postgres_changes", ...) unchanged. Presence + broadcast the same.
Edge FunctionsSAMEDeno.serve() pasted as is into the Studio editor. The CLI will have functions deploy aimed at a separate path (Rust compiled to WASM).
DashboardDIFFERENTStudio Aurabase · we help you find your bearings.
#
Step 1

Create the target Aurabase project

Create a new Aurabase project with the official CLI, then link this folder to the project so that the following commands apply to it automatically.

terminalbash
# Aurabase account + CLI
npm i -g @aurabase/cli
aura login

# Create the project (Postgres engine)
aura projects create my-app --engine postgres

# Link this folder to the created project
aura link --project-id <uuid-du-projet>

# Retrieve the API keys of the linked project
aura projects api-keys
#
Step 2

Dump Supabase, restore Aurabase

A standard pg_dump / pg_restore: Aurabase exposes a direct Postgres connection string for each project (Studio → Settings → Connection), no need for intermediate transformation.

terminalbash
# Retrieve the Supabase connection string from their dashboard
export SUPABASE_DB_URL="postgresql://postgres:...@db.xxx.supabase.co:5432/postgres"

# Public schema dump (without Supabase system schemas)
pg_dump "$SUPABASE_DB_URL" \
  --schema=public \
  --no-owner --no-acl \
  --format=custom \
  -f supabase-dump.pgdump

# Retrieve Aurabase connection string (Studio → Settings → Connection)
# The ?search_path= parameter is MANDATORY: it routes to the schema of your project
export AURA_DB_URL="postgresql://aura:...@<host>:5432/aura_db_master?search_path=project_<id>"

# Restore with standard pg_restore
pg_restore --no-owner --no-acl -d "$AURA_DB_URL" supabase-dump.pgdump

# Regenerate TypeScript types
aura db generate > src/aurabase.types.ts
#
Step 3

Migrate users

A point to correct compared to what we stated here previously: Aurabase hashes passwords with Argon2id, but Supabase (GoTrue) hashes its own by default with bcrypt — the two formats are not interchangeable. Your users will therefore have to reset their password once, as with most migrations.

Aurabase does not currently offer a mass import tool from Supabase. Two options: let your users re-register themselves (signUp with the same email address), or recreate them one by one on the admin side with aura auth users create --email <email> before triggering a password reset.

Info

Active sessions on the Supabase side are not ported (technically impossible — each platform signs its JWTs with its own key). Users will need to log in again, with their new password.

#
Step 4

Adapt the client code

A search/replace is sufficient for 95% of cases.

lib/supabase.ts → lib/aurabase.tstypescript
// BEFORE (Supabase)
import { createClient } from '@supabase/supabase-js'
export const supabase = createClient(url, key)

// AFTER (Aurabase)
import { createClient } from '@aurabase/aurabase-js'
export const aura = createClient(url, key)

// The rest of the code does not change:
await aura.from('posts').select('*').eq('author_id', userId)
#
Step 5

Deploy Edge Functions

Aurabase offers two paths for Edge Functions: the Studio code editor (Deno runtime, same as Supabase — paste your function as is) and the aura functions deployCLI, which aims for a separate path for functions written in Rust and compiled in WASM. To migrate existing Deno code without rewriting, use the Studio.

functions/hello/index.tstypescript
// Works the same, pasted as is into the Studio editor
Deno.serve(async (req) => {
  const { name } = await req.json()
  return new Response(JSON.stringify({ hello: name }))
})
#
Cutover

DNS switchover and production launch

Two possible strategies. The first is recommended for 99% of cases.

  1. Direct cutover — change NEXT_PUBLIC_AURABASE_URL and NEXT_PUBLIC_AURABASE_ANON_KEY in your env vars, redeploy. Users reconnect, everything works. Recommended for the majority of projects.
  2. Temporary dual-write — write in Supabase + Aurabase simultaneously for 48 hours, check the consistency of critical tables manually (row counting, checksums), then shut down Supabase. Preferred for critical apps.
#
Help

We're here if things get stuck

For large projects or with strict compliance constraints, our team can support you with the migration. Contact us for an offer tailored to your project.

Request support →

READY TO DEPLOY?

Your backend in five minutes.

No credit card required · 500 MB free · 50,000 MAU