Export and migrate your Supabase project to a new account
This repository contains the comprehensive strategy and step-by-step guide for exporting an existing Supabase project and deploying it to a different Supabase account. Perfect for transferring projects between organizations, clients, or personal accounts.
The Supabase Takeover strategy enables you to:
- ✅ Export complete projects from one Supabase account
- ✅ Deploy to a new account with all schema, data, and configuration
- ✅ Version control your entire database schema, functions, and settings
- ✅ Transfer between organizations (agency to client, personal to team, etc.)
- ✅ Maintain full functionality including RLS policies, functions, and auth
- ✅ CLI-driven workflow for repeatable, reliable migrations
-
Supabase Takeover Strategy - Complete technical implementation guide
- Exporting from existing Supabase account
- Step-by-step migration process
- Deploying to new Supabase account
- Schema and data transfer
- Testing and validation
-
Git Workflow & Setup - Version control best practices
- Repository structure
- Git workflow for database changes
- CLI-driven development
- Team collaboration patterns
- Deployment strategies
- Supabase CLI (
brew install supabase/tap/supabase) - Access to your source Supabase account/project
- Access to your destination Supabase account
- Git repository for version control
- Extract - Pull schema, functions, and config from source project
- Version Control - Commit everything to git for safety
- Create New Project - Set up fresh project in destination account
- Deploy - Push schema and functions to new project
- Migrate Data - Transfer data using pg_dump/restore
- Switch - Update your applications to point to new project
See sb_takeover.md for detailed steps.
- Database Schema - All tables, columns, types, extensions
- Row Level Security (RLS) - All policies and rules
- Functions - PostgreSQL functions and triggers
- Indexes - All database indexes for performance
- Extensions - PostgreSQL extensions (uuid, pgcrypto, etc.)
- Edge Functions - Deno serverless functions
- Storage Configuration - Buckets and access policies
- Auth Settings - User tables and authentication config
- Environment Variables - Secrets and API keys
┌─────────────────────┐
│ Source Account │
│ (Old Project) │
└──────────┬──────────┘
│
│ supabase db pull
│ supabase functions download
↓
┌─────────────────────┐
│ Git Repository │
│ (Version Control) │
└──────────┬──────────┘
│
│ supabase db push
│ supabase functions deploy
↓
┌─────────────────────┐
│ Destination Account │
│ (New Project) │
└─────────────────────┘
Agency to Client Handoff
- Develop project in your agency account
- Transfer complete project to client's account
- Clean ownership transfer with all data and config
Organizational Changes
- Moving from personal to team account
- Merging projects across accounts
- Separating projects after company splits
Account Consolidation
- Multiple projects across different accounts
- Consolidate into single organization account
- Better project management and billing
Complete Migration
- All schema, policies, and functions transferred
- No data loss or manual recreation
- Maintain all existing functionality
Version Controlled
- Everything saved in git before migration
- Easy rollback if needed
- Audit trail of all changes
Repeatable Process
- CLI-driven workflow
- Document every step
- Repeat for multiple projects
- Supabase CLI - Project export and deployment
- Git - Version control for all migrations
- GitHub CLI - Repository management
- pg_dump/pg_restore - Data migration utilities
This strategy is ideal for:
- Agency Project Handoffs - Transfer completed projects to client accounts
- Account Consolidation - Merge projects from multiple accounts
- Organizational Changes - Move projects between personal/team accounts
- Client Onboarding - Set up identical environments for new clients
- Backup & Recovery - Create versioned backups of entire projects
- Multi-tenant Setups - Deploy same schema to multiple accounts
Before migrating, consider:
- Data Migration - Large databases may take time to export/import
- Downtime - Plan for brief downtime during the switch
- API Keys - All applications need new project URLs and keys
- Auth Users - User passwords cannot be migrated (users must reset)
- Storage Files - Large file storage may need separate migration
- Testing - Thoroughly test new project before switching production traffic
- ✅ Strategy documented
- ✅ Git workflow defined
- 🔄 Implementation in progress
- ⏳ Production deployment pending
This is a living document. As we learn more through implementation, we'll update the strategy and add:
- Migration scripts
- Deployment automation
- Monitoring setup
- Backup strategies
- Performance optimization guides
Questions or need help? Open an issue or reach out to the team.
Last Updated: November 2024
Status: Active Development
License: Internal Use