Migration
Migrate from Supabase
A step-by-step guide for migrating from Supabase to EEv3. Most migrations complete in 1–2 weeks depending on database complexity.
Feature Mapping
| Supabase | EEv3 | Notes |
|---|---|---|
| PostgreSQL | ee.database | Full SQL support. Automatic migrations and schema versioning. |
| Supabase Auth | ee.auth | All social providers, MFA, RBAC. Session management included. |
| Supabase Storage | ee.storage | S3-compatible. CDN, transforms, and signed URLs. |
| Edge Functions | ee.compute | Global edge deployment. TypeScript-first. No cold starts. |
| Realtime | ee.streaming | SSE-based streaming. WebSocket adapter available. |
1. Migrate Database
Export your PostgreSQL database using pg_dump and import it into EEv3 using the CLI migration tool.
# Export your Supabase database
pg_dump --format=custom \
--no-owner \
--no-privileges \
-h db.YOUR_PROJECT.supabase.co \
-U postgres \
-d postgres \
> supabase_export.dump
# Import into EEv3
npx @evileye/cli db:import \
--entity my-company \
--file supabase_export.dump \
--format pg_dump2. Update Queries
Replace the Supabase client with the EEv3 SDK. Query patterns are similar but use a slightly different API.
Before (Supabase)
// Supabase
import { createClient } from '@supabase/supabase-js'
const supabase = createClient(url, anonKey)
const { data, error } = await supabase
.from('users')
.select('*')
.eq('role', 'admin')
.order('created_at', { ascending: false })
.limit(10)After (EEv3)
// EEv3
const result = await ee.database.query({
table: 'users',
filter: { role: 'admin' },
orderBy: { created_at: 'desc' },
limit: 10,
})
const users = result.data.rows3. Row-Level Security to RBAC
Supabase uses PostgreSQL Row Level Security policies. EEv3 uses a role-based access control (RBAC) system that is configured declaratively.
Before (RLS)
-- Supabase Row Level Security
CREATE POLICY "Users can view own data"
ON users FOR SELECT
USING (auth.uid() = id);
CREATE POLICY "Admins can view all"
ON users FOR SELECT
USING (
EXISTS (
SELECT 1 FROM user_roles
WHERE user_id = auth.uid()
AND role = 'admin'
)
);After (RBAC)
// EEv3 RBAC Configuration
await ee.auth.configureRoles({
roles: [
{
name: 'user',
permissions: [
{ face: 'database', action: 'query', condition: 'owner' },
],
},
{
name: 'admin',
permissions: [
{ face: 'database', action: 'query', condition: 'all' },
{ face: 'database', action: 'insert', condition: 'all' },
{ face: 'database', action: 'update', condition: 'all' },
],
},
],
})4. Migrate Auth & Storage
Supabase Auth users can be exported via the management API. The EEv3 import tool handles password hash migration, preserving sessions. Storage files can be synced directly from your Supabase storage bucket using the CLI.
# Migrate auth users
npx @evileye/cli auth:import \
--entity my-company \
--source supabase \
--project-ref YOUR_PROJECT_REF
# Sync storage files
npx @evileye/cli storage:sync \
--entity my-company \
--source supabase \
--bucket publicEstimated Timeline
Most Supabase migrations complete in 1–2 weeks. Complex migrations with extensive RLS policies or custom PostgreSQL functions may take 2–3 weeks.
Back to Migration Guides