Automated Supabase Migration: How Lift & Shift Eliminates the pg_dump Headache

Migrate from Supabase Cloud to self-hosted in minutes, not hours. Enter credentials, click migrate, done. No pg_dump, no manual storage transfer.

Cover Image for Automated Supabase Migration: How Lift & Shift Eliminates the pg_dump Headache

If you've ever tried migrating from Supabase Cloud to self-hosted, you know the drill: hunt down your database connection string, run pg_dump with the right flags, pray you didn't miss an extension, manually download storage files, re-enter all your OAuth credentials, and hope everything works when you flip the switch.

It's a process that should take 10 minutes but somehow consumes an entire afternoon.

We built Lift & Shift to fix this. Enter your Supabase Cloud credentials, select what you want to migrate, and Supascale handles the rest—database export, storage file transfer, and auth provider detection, all streamed in real-time so you can watch the progress.

The Problem with Manual Migration

The Supabase community has been vocal about migration pain points. In GitHub discussions, developers consistently mention the same frustrations:

Database export is straightforward but tedious. Running pg_dump isn't hard, but getting the flags right matters. Miss --no-owner and you'll spend hours debugging role errors. Forget about extensions and your import fails halfway through.

Storage gets forgotten. Your database backup doesn't include Storage files. That's a separate system entirely. For small projects, you're manually downloading and re-uploading files. For large ones, you're scripting S3 syncs and hoping bucket policies carry over.

Auth configuration doesn't export. OAuth provider settings live in environment variables, not your database. You'll need to reconfigure Google, GitHub, Discord—whatever you're using—and update redirect URIs in each provider's dashboard. Miss one and users can't log in.

It's a multi-hour commitment. What seems like a quick migration turns into half a day of careful work, testing, and inevitably fixing something that broke.

Lift & Shift: Automated Migration

Lift & Shift connects directly to your Supabase Cloud project and migrates everything in one operation. Here's what happens when you run it:

What Gets Migrated Automatically

ComponentStatusDetails
DatabaseFull migrationTables, data, schema, extensions, RLS policies
StorageFull migrationAll buckets, all files, preserves folder structure
Auth UsersIncludedPart of database migration
Auth ProvidersDetection onlyIdentifies configured providers, secrets need re-entry

What You'll Need

Before starting, gather three pieces of information from your Supabase Cloud dashboard:

  1. Project URL — Found in Settings → API (looks like https://xxxxx.supabase.co)
  2. Service Role Key — In Settings → API under "Project API keys" (the service_role key, not anon)
  3. Database Password — The password you set when creating the project, or reset it in Settings → Database

That's it. No command line tools to install, no connection strings to construct.

Step-by-Step: Running a Lift & Shift Migration

1. Create and Start Your Target Project

In Supascale, create a new project if you haven't already. The project needs to be running for database migration—we need a live PostgreSQL instance to import into.

2. Navigate to Import

Go to Backups → Import / Migrate in the Supascale dashboard. Select your target project from the dropdown.

3. Enter Your Credentials

In the "Automatic Migration" section, enter:

  • Your Supabase Cloud project URL
  • Your service role key
  • Your database password

4. Select Components

Choose what to migrate:

  • Database — Your PostgreSQL data, schema, and extensions
  • Storage — All buckets and files
  • Auth Config — Detects which OAuth providers are configured

Most migrations want Database and Storage. Auth Config is useful for documentation—it tells you which providers need re-configuration.

5. Click Migrate

Hit "Start Migration" and watch the progress dialog. Lift & Shift streams real-time updates:

  • Validating credentials — Tests the connection to your Supabase Cloud project
  • Database migration — Exports via session pooler, imports to your self-hosted instance
  • Storage migration — Downloads files from source, uploads to target
  • Auth detection — Identifies OAuth providers for manual re-configuration

For a typical project (few GB database, moderate storage), expect 5-15 minutes. Large databases take longer—you'll see progress indicators throughout.

6. Reconfigure OAuth Providers

This is the one manual step. OAuth secrets can't be exported from Supabase Cloud (security measure), so you'll need to:

  1. Go to your self-hosted project's Settings → Authentication → Auth Providers
  2. Re-enter client secrets for each provider
  3. Update redirect URIs in each provider's developer console

The new redirect URI format is: https://your-domain/auth/v1/callback

See our OAuth providers documentation for provider-specific setup guides.

How It Works Under the Hood

For the technically curious, here's what Lift & Shift does:

Database Migration:

  • Connects to Supabase Cloud via the session pooler (IPv4 compatible)
  • Runs pg_dump with appropriate flags (--clean, --no-owner, --no-privileges)
  • Streams the dump directly into your self-hosted PostgreSQL via psql
  • Triggers PostgREST schema reload

Storage Migration:

  • Uses the Supabase JavaScript client with your service role key
  • Lists all buckets and recursively discovers files
  • Downloads each file to a temp directory
  • Re-uploads to your self-hosted storage with the same path structure
  • Preserves bucket settings (public/private)

Auth Detection:

  • Checks which OAuth providers are enabled
  • Reports findings in the migration summary
  • Generates warnings about manual re-configuration needed

Lift & Shift vs. Manual Migration

AspectLift & ShiftManual
Time5-15 minutes2-4 hours
DatabaseAutomaticpg_dump + psql
StorageAutomaticManual download/upload
AuthDetection + guidanceEntirely manual
ProgressReal-time streamingGuess and wait
Error handlingAutomatic rollback infoDebug yourself

Manual migration still makes sense for edge cases: massive databases where you need to chunk the transfer, custom PostgreSQL configurations, or when you need to transform data during migration. For most projects, Lift & Shift handles everything.

Common Questions

Does this work with any Supabase Cloud project?

Yes, as long as you have the service role key and database password. The migration uses standard Supabase APIs and PostgreSQL connections.

What about Edge Functions?

Edge Functions aren't included in Lift & Shift currently. Export them manually with tar -czf functions.tar.gz -C supabase functions and use the manual import endpoint.

Will my users need to log in again?

Yes. JWT secrets differ between instances, so all existing sessions become invalid. This is expected behavior for any Supabase migration.

What if the migration fails partway through?

The progress dialog shows exactly where it stopped. Database migrations are transactional—if they fail, nothing gets partially imported. Storage uploads are idempotent—re-running won't duplicate files.

Can I migrate to an existing project with data?

Yes, but be careful. Database import uses --clean which drops existing objects first. If you have data you want to keep, back it up before migrating.

API Access

Lift & Shift is also available via the REST API for automation:

curl -X POST https://your-supascale/api/v1/projects/my-project/import/lift-shift \
  -H "X-API-Key: your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "sourceUrl": "https://xxxxx.supabase.co",
    "serviceRoleKey": "eyJhbGciOi...",
    "databasePassword": "your-password",
    "components": ["database", "storage"]
  }'

The endpoint returns Server-Sent Events for real-time progress tracking—useful for building custom migration workflows or CI/CD pipelines.

After Migration: Next Steps

Once Lift & Shift completes:

  1. Verify your data — Check tables in the SQL Editor, browse storage files
  2. Test authentication — Try signing up and signing in
  3. Update your application — Point to the new Supabase URL and keys
  4. Set up backups — Self-hosted means backups are your responsibility
  5. Configure monitoring — You're running the infrastructure now

For production migrations, we recommend running Lift & Shift to a test project first, verifying everything works, then migrating your production data.

Why We Built This

The Supabase self-hosting community is growing fast. More developers are moving to self-hosted for cost reasons (Cloud charges $25/project/month minimum), compliance requirements, or simply wanting full control.

But migration has been a barrier. The manual process isn't hard—it's just tedious and error-prone. We kept seeing the same questions in forums: "How do I export storage?" "Why are my extensions failing?" "Did I miss something with auth?"

Lift & Shift turns a multi-hour manual process into a few clicks. Enter credentials, select components, migrate. That's it.

Getting Started

Ready to migrate? Here's the quick path:

  1. Install Supascale if you haven't already
  2. Create and start a project for your migrated data
  3. Go to Backups → Import / Migrate
  4. Enter your Supabase Cloud credentials
  5. Click Start Migration

For the complete walkthrough with screenshots, see our Migration from Supabase Cloud documentation.

If you prefer the manual approach or need more control, our complete manual migration guide covers every step in detail.


Further Reading