WZ-IT Logo
How-toSupabase

Migrate Supabase Cloud to self-hosted: complete process

Timo WevelsiepTimo WevelsiepUpdated: 25.08.2026

Editorial note: Versions, commands and prices may change. Please verify critical steps independently before production use. This guide does not replace individual consulting.

Avoid treating the move as a one-off database import. WZ-IT delivers a Supabase migration from €3,490 with assessment, rehearsal, cutover and a documented rollback checkpoint.

A Supabase Cloud to self-hosted migration consists of several connected moves. PostgreSQL is the core, but Auth, Storage, Functions, secrets, Realtime and application configuration all need to point to the target.

The official Supabase guide explains the database transfer and explicitly states that storage objects and Edge Functions are not moved by that process. A production application therefore needs a broader runbook.

1. Inventory the source

Collect at least:

  • PostgreSQL version, database size and write rate
  • active extensions and custom roles
  • schemas, views, functions, triggers and cron jobs
  • auth providers, MFA, SMTP and redirect URLs
  • user count and active sessions
  • storage buckets, object count, total volume and policies
  • Edge Functions, secrets, webhooks and external APIs
  • Realtime, Broadcast and Presence usage
  • pooling, direct database connections and domains
  • frontends, mobile apps, servers and automations
  • required RPO, RTO and maintenance window

The assessment also needs a Cloud-to-self-hosted feature matrix. Branching, managed backups/PITR and other platform capabilities are not automatically available on the target.

2. Prepare a compatible target

The target stack should be fully operational before importing data:

  • version-tracked self-hosted Supabase stack
  • compatible PostgreSQL version and extensions
  • TLS, firewall and protected Studio access
  • SMTP and auth providers
  • storage backend with adequate capacity
  • backup for PostgreSQL, Storage, configuration and Functions
  • monitoring, logs and alerts
  • domains, pooling and network access

Supabase notes that Cloud and self-hosted deployments may use different PostgreSQL or service versions. A rehearsal identifies incompatible settings, tables or extensions before the production window.

3. Export roles, schema and data

The official restore guide creates three exports:

supabase db dump --db-url "$DATABASE_URL" -f roles.sql --role-only
supabase db dump --db-url "$DATABASE_URL" -f schema.sql
supabase db dump --db-url "$DATABASE_URL" -f data.sql --use-copy --data-only

The Supabase CLI runs pg_dump internally but filters reserved roles and internal schemas for the platform. An unfiltered direct dump can fail during restore because of ownership or reserved roles.

Custom login roles need new passwords after restore because passwords are not included in the dump.

4. Run a test restore

Restore roles, schema and data in the required order. A successful psql exit code is not sufficient. Validate:

  • table and row counts
  • constraints, indexes and sequences
  • views, triggers and database functions
  • extensions and versions
  • owners and grants
  • RLS policies
  • critical queries and performance
  • application migration history

Record every difference. The rehearsal also provides a realistic transfer duration for the maintenance window.

5. Handle Auth separately

Auth data partly lives in PostgreSQL and may move with the data. The environment still needs confirmed configuration:

  • Site URL and allowed redirects
  • OAuth providers and callback URLs
  • SMTP, sender and templates
  • JWT keys and token validity
  • anonymous and public sign-up
  • MFA and CAPTCHA

The official documentation notes that different JWT secrets invalidate existing tokens. Users then need to sign in again. OAuth configuration in Google, Apple, GitHub or other providers must point to the new hostname.

6. Transfer Storage objects

A database dump transfers tables and Storage metadata, not the file content. Storage requires its own process:

  1. Inventory buckets, policies and metadata.
  2. Read every object from the source.
  3. Transfer files to the target backend.
  4. Compare paths, size, checksums and object counts.
  5. Test public and signed access paths.

For large buckets, Storage transfer can take longer than the database move. Incremental transfer then requires a separately designed strategy.

7. Redeploy Functions, secrets and integrations

Treat Edge Functions as source code and deployment artefacts. Move:

  • function code and imports
  • environment variables and secrets
  • webhook endpoints
  • cron or queue triggers
  • JWT verification and service-role usage
  • external API access

Self-hosted Functions run on the target Deno runtime rather than the automatically global Cloud edge network. Test latency, scaling and timeouts for the new operating model.

8. Test the application against the target

Connect a staging deployment to the target before cutover. Acceptance should include:

  • registration, login, logout and password reset
  • OAuth and email flows
  • create, read, update and delete per role
  • negative RLS tests between users and tenants
  • uploads, downloads and signed Storage URLs
  • Realtime connections
  • Functions and webhooks
  • direct server and pooled connections

These tests show whether the backend works as a system rather than only as a restored database.

9. Cutover and rollback

Derive the final sequence from the rehearsal:

  1. Activate a change freeze or controlled write pause.
  2. Perform the final database and Storage transfer.
  3. Verify quantities and critical records.
  4. Switch secrets, URLs and application deployments.
  5. Run smoke tests and business acceptance.
  6. Keep the source unchanged for the agreed rollback window.

Rollback is only credible when new writes after the switch have a defined treatment. Complex applications may require incremental synchronisation, which increases the scope and must be priced individually.

Operations begin after migration

Self-hosting changes responsibility. Activate these controls immediately:

  • monitoring and alerting
  • database and Storage backups
  • documented restore
  • update and patch process
  • capacity controls
  • incident ownership
  • recurring RLS and configuration review

WZ-IT can operate these controls as a managed Supabase service after migration.

Sources

Rather have it operated?

You'd rather not run Supabase yourself? WZ-IT handles setup, operations and maintenance - privacy-focused from Germany.

Enquiry

Migrate, secure, or operate Supabase

We migrate Supabase projects and existing backends such as Firebase, Lovable, PostgreSQL, MySQL or Auth0, build the target environment, and can take over ongoing operations.

How should we get back to you?

Frequently Asked Questions

Answers to the most important questions

Core components and application data can be migrated. Cloud-specific platform capabilities such as branching, managed backups or platform metrics still need to be assessed and replaced where required.

Not necessarily. The official restore documentation notes that JWT keys can differ. Existing tokens then become invalid and users need to sign in again.

No. The dump contains Storage metadata but not the objects themselves. Files need a separate transfer and must be reconciled with buckets and metadata.

It depends on data volume, write rate, transfer path and application behaviour. A rehearsal provides the basis for a reliable maintenance window, final sync and rollback checkpoint.

A Supabase migration starts at €3,490 excluding VAT. This is an entry price; scope and binding price are proposed after the technical assessment of source, target and requirements.

Contact

Let's Talk About Your Idea

Whether a specific IT challenge or just an idea - we look forward to the exchange. In a brief conversation, we'll evaluate together if and how your project fits with WZ-IT.

Email
[email protected]
Arrange a callback

Callback

Arrange a callback

Leave your number and we will call back — at the latest on the next business day.

For a longer conversation you can book an appointment instead.

Companies worldwide trust WZ-IT

  • ml&s
  • Rekorder
  • Keymate
  • Führerscheinmacher
  • SolidProof
  • ARGE
  • Boese VA
  • nextGYM
  • Maho Management
  • Golem.de
  • Millenium
  • Paritel
  • Yonju
  • EVADXB
  • Mr. Clipart
  • Aphy AG
  • Negosh
  • ABCO Water Systems
1/3 - Topic Selection33%

What is your inquiry about?

First select the service area that best matches your project.