To migrate from Supabase to WoWSQL, dump your public schema from Supabase with pg_dump, drop the foreign keys that point at auth.users, and restore it into WoWSQL with pg_restore/psql over the direct connection string, or with wowsql db restore --file from the WoWSQL CLI if you can't reach port 5432. Then enable the Data API, have users sign in again (password hashes can't be imported with any documented tool), copy your storage files with a short script, and replace supabase-js calls with @wowsql/sdk. Supabase and WoWSQL both run PostgreSQL and both use auth.uid() with anon, authenticated and service_role roles, so tables, data, functions, triggers and most RLS policies come across unchanged.
This guide adds the WoWSQL CLI to our earlier Supabase to WoWSQL walkthrough. We checked every WoWSQL command against wowsql --help for CLI 1.7.0 on 30 November 2026. We ran the pg_dump, pg_restore and psql commands against a local PostgreSQL 17 database set up like Supabase (an auth schema, auth.uid(), an extensions schema and RLS policies). We didn't run anything against a live Supabase or WoWSQL project, so rehearse on scratch projects first.
Key facts (checked 30 November 2026)
- WoWSQL connection: the Connect menu shows
postgresql://USER:[YOUR-PASSWORD]@db.your-project-slug.wowsqlconnect.com:5432/postgres, the project URL and the anon key. The service role key is in Project Settings (dashboard docs).- Supabase connection: use the direct string
postgresql://postgres:[PASSWORD]@db.[PROJECT-REF].supabase.co:5432/postgres. If your network has no IPv6, use the Session pooler string instead, as Supabase's backup guide says.- WoWSQL CLI:
pip install wowsql-cli, version 1.7.0 on PyPI. It's a Python package, not npm.- Data API: off by default on new WoWSQL projects. Calls return
403 DATA_API_DISABLEDuntil you enable it (Compute docs).- Users: WoWSQL documents no user or password-hash import (auth docs).
- Regions: Mumbai, US East and Frankfurt. There's no UK region. Plans: Free $0, Pro $25/month, Scale $99/month (pricing).
Supabase to WoWSQL: what moves, and how
| On Supabase | Moves with | Notes |
|---|---|---|
Tables, views, functions, triggers and data in public |
pg_dump then pg_restore/psql (Step 4), or wowsql db restore (Step 5) |
Standard Postgres |
RLS policies using auth.uid() |
The same dump | WoWSQL policies use auth.uid() too |
FKs to auth.users(id) |
Dropped during restore | User IDs change on WoWSQL |
extensions.uuid_generate_v4() defaults |
Rewritten to gen_random_uuid() |
Supabase installs extensions in an extensions schema |
auth.users, identities, sessions |
Users sign in again (Step 7) | No documented hash import |
Triggers on auth.users (for example "create profile on sign-up") |
App code after signUp |
They aren't in a public dump |
| Storage buckets and files | Copy script (Step 8) | Public/private buckets. No presigned URLs per the docs |
| Realtime | POST /realtime/v1/enable per table (Step 9) |
64 KiB payload cap |
| Edge Functions (Deno) | WoWSQL Compute, Node.js or Python (Step 10) | One file per function, no package installs |
supabase-js |
@wowsql/sdk 3.10.0 (Step 11) |
CommonJS: use require or named imports |
| GraphQL, Vault, branching | Rewrite or drop | Not offered on WoWSQL |
Step 1: Install the tools
# Postgres client tools, same major version as the newer of the two servers
pg_dump --version
# WoWSQL CLI (Python 3.8+)
pip install wowsql-cli
wowsql --version # wowsql, version 1.7.0
# Node 18+ for the storage and claim scripts
npm install @wowsql/sdk@3.10.0 @supabase/supabase-js
Run select version(); on both databases. If your pg_dump is newer than the WoWSQL server, the plain-SQL output may contain settings the older server doesn't know (PostgreSQL 17's SET transaction_timeout, for example). Delete that line if the restore stops on it.
Step 2: Create the WoWSQL project and point the CLI at it
- Create the project in the dashboard at app.wowsql.com and choose Mumbai, US East or Frankfurt. The CLI's
projects createhas no region option. - Enable Authentication. The setup asks for a JWT secret of at least 32 characters and creates the auth tables.
- Copy the direct connection string, the anon key and the service role key.
export SUPABASE_DB_URL='postgresql://postgres:[PASSWORD]@db.[PROJECT-REF].supabase.co:5432/postgres'
export WOWSQL_DB_URL='postgresql://USER:[PASSWORD]@db.your-project-slug.wowsqlconnect.com:5432/postgres'
wowsql login
wowsql projects set-default your-project-slug
wowsql status
wowsql db connect # prints host, port, database, user and a psql command
CLI 1.7.0 tip: wowsql projects set-default is what makes later commands find your project. wowsql link link --project … saves .wowsql/config.yaml in the folder, but the other commands don't read it yet, so set the default or pass --project your-project-slug each time.
Step 3: Back up both projects first
mkdir -p backups
# Full Supabase dump for rollback (custom format)
pg_dump "$SUPABASE_DB_URL" --format=custom --file=backups/supabase-full.dump
# WoWSQL: local SQL backup of the (empty) target, saved on your machine
wowsql backup create --name before-migration --output ./backups/wowsql-before.sql
WoWSQL Free has no platform backups, and Pro/Scale keep daily backups for 7 days that you restore through support (backups policy). A local file is the fastest way back.
Step 4: Move the schema and data over the direct connection (recommended)
This is the route we tested end to end. It dumps only public, removes the foreign keys to auth.users, turns the archive into an editable SQL file, fixes Supabase's extension-qualified defaults and restores everything in one transaction:
# 1. Dump public: schema and data, no Supabase owners or grants
pg_dump "$SUPABASE_DB_URL" --schema=public --no-owner --no-privileges \
--format=custom --file=public.dump
# 2. List the foreign keys that point at auth.users
psql "$SUPABASE_DB_URL" -At -c "select conname from pg_constraint where contype = 'f' and confrelid = 'auth.users'::regclass and connamespace = 'public'::regnamespace" > auth_fks.txt
# 3. Build a restore list without those FKs and without the public schema itself
pg_restore --list public.dump \
| grep -v -F -f auth_fks.txt \
| grep -v -E 'SCHEMA - public|COMMENT - SCHEMA public' > restore.list
# 4. Write the filtered archive out as SQL so you can review it
pg_restore --use-list=restore.list --no-owner --no-privileges --file=public.sql public.dump
# 5. Supabase puts uuid-ossp in the "extensions" schema; use the built-in function instead
sed -i 's/extensions\.uuid_generate_v4()/gen_random_uuid()/g' public.sql
# 6. Restore into WoWSQL, all or nothing
psql "$WOWSQL_DB_URL" --single-transaction --variable ON_ERROR_STOP=1 --file=public.sql
On macOS, use sed -i '' instead of sed -i. Search public.sql for any other extensions. references (for example extensions.pgp_sym_encrypt) and for extensions you haven't enabled. Enabling extensions needs Pro or Scale (docs).
In our local test, this restored the tables, data, identity sequences, the trigger and the auth.uid() RLS policy, and only the two auth.users foreign keys were removed.
Step 5: Or move it with the WoWSQL CLI over HTTPS
If port 5432 is blocked where you work, the CLI sends a SQL file to the WoWSQL API. The file must be plain SQL with no psql features:
# Plain SQL with INSERT statements instead of COPY ... FROM stdin
pg_dump "$SUPABASE_DB_URL" --schema=public --no-owner --no-privileges \
--column-inserts --file=public_inserts.sql
# Remove psql meta-commands, the public schema, auth.users FKs; fix uuid defaults
perl -0pi -e '
s/^\\(un)?restrict .*\n//mg;
s/^CREATE SCHEMA public;\n//m;
s/^COMMENT ON SCHEMA public IS .*\n//m;
s/^ALTER TABLE ONLY \S+\n\s+ADD CONSTRAINT \S+ FOREIGN KEY [^;]*REFERENCES auth\.users\b[^;]*;\n//mg;
s/extensions\.uuid_generate_v4\(\)/gen_random_uuid()/g;
' public_inserts.sql
# Send it (asks for confirmation; add --confirm to skip)
wowsql db restore --file public_inserts.sql
wowsql backup restore ./public_inserts.sql is the same idea under the backup command. Know the limits before you choose this route:
- We couldn't run
wowsql db restoreagainst a live project. We confirmed the cleaned file restores without errors throughpsqlon PostgreSQL 17. Whether the WoWSQL server splits every statement correctly, especially functions with$$bodies, is something to check on a scratch project. - The CLI reads the whole file into memory and submits it in one request with a 120-second timeout, then polls for progress. Use it for small databases.
- Leave
--skip-errorsoff on the first try, so a failed statement stops the restore instead of leaving a half-loaded schema.
Step 6: Enable the Data API and check the result
New WoWSQL projects start with the Data API off. In the dashboard, enable it and expose the tables your app calls. Until then, REST and SDK calls return 403 DATA_API_DISABLED.
Because the dump used --no-privileges, check grants too. If an exposed table returns permission errors instead of rows or an empty list, grant the API roles what the app needs and let RLS do the filtering:
grant select, insert, update, delete on public.todos to authenticated;
grant select on public.todos to anon; -- only if anonymous reads are intended
Then compare source and target with the verification queries. Run them on both databases and compare the output. Set the time zone first so timestamps print the same way:
set timezone = 'UTC';
-- Exact row count for every table in public
select table_name,
(xpath('/row/c/text()',
query_to_xml(format('select count(*) as c from %I.%I', table_schema, table_name),
false, true, '')))[1]::text::bigint as row_count
from information_schema.tables
where table_schema = 'public' and table_type = 'BASE TABLE'
order by table_name;
-- Content fingerprint for one table (repeat for important tables)
select md5(string_agg(t::text, '|' order by t.id)) as todos_fingerprint
from public.todos t;
-- Tables with RLS switched off, and the policies that came across
select c.relname from pg_class c join pg_namespace n on n.oid = c.relnamespace
where n.nspname = 'public' and c.relkind = 'r' and not c.relrowsecurity;
select tablename, policyname, cmd from pg_policies where schemaname = 'public' order by 1, 2;
From the CLI: wowsql db tables list and wowsql db query "select count(*) from public.todos".
Step 7: Move auth users
Supabase keeps users in auth.users with bcrypt hashes in encrypted_password. WoWSQL's auth supports sign-up, password sign-in, magic links, email and phone OTP, 19 working OAuth providers and TOTP 2FA, but it documents no way to import users or hashes. So:
- OAuth users: set up the same provider in WoWSQL (callback
https://your-project-slug.wowsqlconnect.com/auth/v1/oauth/<provider>/callback). They sign in once and get a new WoWSQL user ID. - Password users: they sign up again, or use
auth.forgotPassword(email)after an account exists. Sessions never carry over.
Keep a mapping so their old rows follow them. Export from Supabase:
psql "$SUPABASE_DB_URL" -c "\copy (select id, email from auth.users) to 'legacy_users.csv' with (format csv, header true)"
Load it into a schema outside public, so the Data API never exposes it:
create schema if not exists migration;
create table migration.legacy_users (old_id uuid primary key, email text not null, new_id uuid);
psql "$WOWSQL_DB_URL" -c "\copy migration.legacy_users (old_id, email) from 'legacy_users.csv' with (format csv, header true)"
Then, on the server, claim the rows the first time each user signs in. Take the identity from the verified token, never from the request body:
const { ProjectAuthClient } = require('@wowsql/sdk')
const { Pool } = require('pg') // node-postgres, WoWSQL direct connection string
const auth = new ProjectAuthClient({ projectUrl: 'your-project-slug', apiKey: process.env.WOWSQL_ANON_KEY })
const db = new Pool({ connectionString: process.env.WOWSQL_DB_URL })
async function claimLegacyRows(accessToken) {
const user = await auth.getUser(accessToken) // verified by WoWSQL
const { rows } = await db.query(
`update migration.legacy_users set new_id = $1
where lower(email) = lower($2) and new_id is null
returning old_id`,
[user.id, user.email],
)
if (rows.length === 0) return
await db.query('update public.todos set user_id = $1 where user_id = $2', [user.id, rows[0].old_id])
await db.query('update public.profiles set id = $1 where id = $2', [user.id, rows[0].old_id])
}
Repeat the update for every table with a user column. Only match by email when the WoWSQL account's email is verified. If keeping passwords is a hard requirement, email support@wowsql.com before you plan around it.
Step 8: Copy storage files
WoWSQL buckets are public or private. Public files are served from https://your-project-slug.wowsqlconnect.com/storage/v1/object/public/{bucket}/{path}, and private files are downloaded with an API key (storage docs). Run this once with both service keys on a trusted machine:
// copy-storage.mjs: node copy-storage.mjs
import { createClient } from '@supabase/supabase-js'
import { WowSQLStorage } from '@wowsql/sdk' // named import works in Node ESM
const supabase = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_SERVICE_ROLE_KEY)
const wow = new WowSQLStorage({ projectUrl: 'your-project-slug', apiKey: process.env.WOWSQL_SERVICE_KEY })
async function copyFolder(bucket, prefix = '') {
for (let offset = 0; ; offset += 1000) {
const { data, error } = await supabase.storage.from(bucket).list(prefix, { limit: 1000, offset })
if (error) throw error
for (const item of data) {
const path = prefix ? `${prefix}/${item.name}` : item.name
if (item.id === null) { await copyFolder(bucket, path); continue } // folder
const { data: blob, error: dlError } = await supabase.storage.from(bucket).download(path)
if (dlError) throw dlError
await wow.upload(bucket, blob, path, item.name) // folder comes from path
console.log('copied', `${bucket}/${path}`)
}
if (data.length < 1000) break
}
}
const { data: buckets, error } = await supabase.storage.listBuckets()
if (error) throw error
for (const b of buckets) {
await wow.createBucket(b.name, { public: b.public })
await copyFolder(b.name)
}
In SDK 3.10.0, upload(bucket, data, path, fileName) stores the file under the folder part of path with the name fileName, so users/u1/avatar.png keeps its path. Then rewrite stored URLs:
update public.profiles
set avatar_url = replace(avatar_url,
'https://OLD_REF.supabase.co/storage/v1/object/public/',
'https://your-project-slug.wowsqlconnect.com/storage/v1/object/public/')
where avatar_url like 'https://OLD_REF.supabase.co/storage/v1/object/public/%';
There's no equivalent of createSignedUrl. The storage docs say presigned URLs aren't available, so serve private files through a server route that checks the user and downloads with your key. For a handful of files, wowsql storage upload ./file.png --path folder/file.png works too, but CLI 1.7.0 always writes to the bucket named default.
Step 9: Re-enable realtime
Each table needs one call before change events flow: POST /realtime/v1/enable with {"schema_name":"public","table_name":"messages"} (realtime docs). Broadcast and presence don't need it. The SDK connects with the anon or service key in the URL (wss://your-project-slug.wowsqlconnect.com/realtime/v1/websocket?apikey=…), and 3.10.0 has no option to pass a user token. Test subscriptions on tables with RLS on a scratch project before you rely on them.
const { WowSQLClient } = require('@wowsql/sdk')
const client = new WowSQLClient({ projectUrl: 'your-project-slug', apiKey: process.env.WOWSQL_ANON_KEY })
client.realtime.channel('chat')
.on('postgres_changes', { event: '*', schema: 'public', table: 'messages' }, (p) => console.log(p.event, p.new || p.old))
.subscribe()
Step 10: Port Edge Functions to WoWSQL Compute
WoWSQL Compute runs one-file Node.js or Python handlers at https://your-project-slug.wowsqlconnect.com/functions/v1/{name}. Each request gets a fresh process, packages can't be installed, and project secrets arrive as environment variables (Compute docs). A Supabase Deno.serve function becomes:
// Node.js handler on WoWSQL Compute
module.exports = async function (event) {
const res = await fetch(`${process.env.WOWSQL_URL}/rest/v1/orders?status=eq.paid&limit=10`, {
headers: { apikey: process.env.WOWSQL_SERVICE_KEY },
})
if (!res.ok) return { statusCode: res.status, body: { error: await res.text() } }
return { statusCode: 200, body: await res.json() }
}
wowsql secrets set WOWSQL_SERVICE_KEY "wowsql_service_your_key_here"
wowsql secrets set STRIPE_SECRET "sk_live_..."
Functions that relied on npm packages need rewriting with built-in fetch, or moving to your own server. The service key isn't injected automatically, so store it as a secret and keep that function behind Verify JWT / API key.
Step 11: Swap supabase-js for @wowsql/sdk
| supabase-js | @wowsql/sdk 3.10.0 |
|---|---|
createClient(url, anonKey) |
new WowSQLClient({ projectUrl, apiKey }), plus new ProjectAuthClient(...) and new WowSQLStorage(...) |
from('todos').select('id,title') |
table('todos').select('id', 'title').get() |
.eq() .neq() .gt() .lt() .like() .ilike() .in() .is() |
.eq() .neq() .gt() .lt() .like() .ilike() .in() .isNull() on the query |
.order('created_at', { ascending: false }).limit(20) |
.order('created_at', 'desc').limit(20).get() |
.single() / .maybeSingle() |
.single() / .first() |
.insert(row) |
table('todos').insert(row) (or create) |
.upsert(row) |
table('todos').upsert(row) |
.update(v).eq('id', 5) |
table('todos').update(5, v) (matches a column named id) |
.delete().eq('id', 5) |
table('todos').delete(5) (matches a column named id) |
auth.signUp / signInWithPassword |
auth.signUp({ email, password }) / auth.signIn({ email, password }) |
auth.signInWithOAuth({ provider }) |
auth.getOAuthAuthorizationUrl(provider, redirectUri) |
auth.getUser() / auth.signOut() |
auth.getUser(token) / auth.logout() |
storage.from(b).upload(path, file) |
storage.upload(b, file, path) |
storage.from(b).getPublicUrl(path) |
storage.getPublicUrl(b, path) |
rpc('fn', args) |
No rpc() helper in 3.10.0. Call the REST API or use a view |
The biggest difference: supabase-js sends the signed-in user's JWT for you, while WowSQLClient sends the API key you gave it, so queries run as anon unless you change that. The documented way is to send the anon key in apikey and the user's token in Authorization (SDK connection guide). With 3.10.0 you can set that header on the client's HTTP instance. We verified the headers against a mock server, but the docs don't describe it:
import { WowSQLClient, ProjectAuthClient } from '@wowsql/sdk' // or require() in CommonJS
const auth = new ProjectAuthClient({ projectUrl: 'your-project-slug', apiKey: process.env.WOWSQL_ANON_KEY })
function clientForUser(accessToken) {
const client = new WowSQLClient({ projectUrl: 'your-project-slug', apiKey: process.env.WOWSQL_ANON_KEY })
client.getHttpClient().defaults.headers['Authorization'] = `Bearer ${accessToken}`
return client
}
const login = await auth.signIn({ email: 'user@example.com', password: 'SecurePassword123' })
const mine = await clientForUser(login.session.accessToken).table('todos').select('*').get()
There's no onAuthStateChange. Store the session yourself and use auth.setSession, auth.getSession and auth.refreshSession. Generate types with wowsql gen typescript --output ./src/types/database.ts, and update env vars (WOWSQL_PROJECT_URL, WOWSQL_ANON_KEY, with the service key on servers only).
Step 12: Keep schema changes in CLI migrations
After the move, keep the schema in version control with the CLI's migration files:
wowsql migration new add_todos_due_date # creates migrations/<timestamp>_add_todos_due_date.sql and .down.sql
wowsql migration up --dry-run
wowsql migration up
wowsql migration status
wowsql migration down --count 1 # runs the matching .down.sql
wowsql db diff compares unapplied migration files with the live schema. For the cutover itself (write freeze, final dump, env switch and rollback), follow the migration runbook.
Supabase vs WoWSQL after the move
| Supabase | WoWSQL | |
|---|---|---|
| Plans | Free, Pro from $25/month plus per-project compute | Free $0, Pro $25, Scale $99 |
| Regions | Many AWS regions, including London | Mumbai, US East, Frankfurt |
| Password-hash import | Documented | Not documented |
| Signed URLs for private files | Yes | No (per storage docs) |
| Branching, GraphQL, Vault | Yes | No |
| Backups | Daily on Pro | Daily, kept 7 days on Pro/Scale; none on Free |
| CLI | supabase (npm/Homebrew) |
wowsql (pip) |
Supabase is the stronger choice if you need its extras. WoWSQL fits teams that want flat plans and one of these three regions. See WoWSQL vs Supabase and Supabase pricing explained.
FAQ
How do I migrate from Supabase to WoWSQL?
Dump the public schema with pg_dump (--schema=public --no-owner --no-privileges), drop the foreign keys to auth.users, and restore with pg_restore or psql into the WoWSQL connection string, or send a cleaned --column-inserts file with wowsql db restore --file. Then enable the Data API, have users sign in again, copy storage with a script and switch to @wowsql/sdk.
How do I migrate a Supabase database to plain Postgres?
Use pg_dump on Supabase's direct or session-pooler connection string, limited to the public schema, then pg_restore into the new server. Remove foreign keys to auth.users and replace extensions.uuid_generate_v4() defaults with gen_random_uuid() if the target has no extensions schema.
Can the WoWSQL CLI import a Supabase dump directly?
It can restore a plain SQL file with wowsql db restore --file or wowsql backup restore. Dump with --column-inserts and remove psql meta-commands like \restrict first, because the default COPY format is a psql feature. For anything beyond a small database, restore with psql over the direct connection.
Do Supabase RLS policies work on WoWSQL?
Policies on public tables come across in the dump, and WoWSQL uses auth.uid() and the anon, authenticated and service_role roles too. Test with two real users after migrating. Policies on storage.objects don't carry over; WoWSQL buckets are public or private.
Will my Supabase users have to reset their passwords?
Yes, unless they use OAuth. WoWSQL documents no import of users or bcrypt hashes, so password users sign up again or reset, OAuth users sign in with the same provider, and you re-map user_id columns with a mapping table.
How long does a Supabase to WoWSQL migration take?
It depends on database size and how many files you have. The database restore itself is a single dump and restore. Plan a trial run on a scratch project, then a short write freeze for the final dump, file sync and env switch.
Related guides
- Migrate to WoWSQL: complete guide
- Migration checklist and runbook
- Supabase to WoWSQL walkthrough (no CLI)
- What is Row Level Security?
- How to add login to your app
- Postgres realtime subscriptions
Create a free WoWSQL project and rehearse the restore there first. · Pricing · CLI docs