Help Center / Components
Database Schema Migration
Your database schema is the structural foundation of your Supabase project. It defines the shape of your data -- the tables, columns, relationships, and rules that hold everything together. The Database Schema component lets you migrate all of that structure from one Supabase instance to another.
What Gets Migrated
When you select the Database Schema component, Stack2X copies the following from your source instance to the destination:
- Tables -- All table definitions including column names, data types, default values, and nullable settings.
- Views -- Standard and materialized views are recreated on the destination.
- Indexes -- Primary keys, unique indexes, and any custom indexes you have created.
- Constraints -- Foreign keys, check constraints, and unique constraints are preserved.
- Custom Types -- Enums and composite types defined in your schema.
- Extensions -- PostgreSQL extensions that are enabled on the source project.
Stack2X reads your schema directly from the source database and rebuilds it on the destination in the correct order so that dependencies between tables and types are respected.
Plan Availability
Database Schema migration is included on all plans, including the Free tier. There are no restrictions on the number of tables or complexity of the schema.
Tips and Considerations
- Run schema before data. If you plan to migrate both your schema and your data, always run the schema migration first. Stack2X handles this ordering automatically when you select both components together.
- Check extensions. Some PostgreSQL extensions may not be available on all Supabase plans. If an extension on your source project is not supported on the destination, Stack2X will flag it during the pre-flight check.
- Custom schemas. Stack2X migrates the
publicschema by default. Tables in other schemas likeprivateor custom-named schemas are also detected and included. - Existing objects. If the destination already has tables with the same names, Stack2X will warn you before overwriting. You can choose to skip those tables or replace them.