supabase-to-tidb-migration

Migrate Supabase databases to TiDB through phased assessment, conversion, and validation.

2|1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/pingcap-inc/TiShift --skill supabase-to-tidb-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-to-tidb-migration
Source: https://github.com/pingcap-inc/TiShift/tree/main/supabase-to-tidb
Command: npx skills add https://github.com/pingcap-inc/TiShift --skill supabase-to-tidb-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrate Supabase databases to TiDB by guiding through readiness assessment, RLS policy extraction, DDL conversion, data loading, and validation. The skill helps teams understand the scope of a move, including the PostgREST / GoTrue / Realtime / Storage application-layer rewrite, and ensures a structured, phase-driven approach.

Core Features & Use Cases

  • Phase-driven migration workflow: scan → convert → load → check → optional sync.
  • RLS rewrite planning: extracts policies into a structured checklist for app-layer rewrite.
  • Schema conversion: translates Postgres DDL to TiDB-compatible DDL with type mappings.
  • Safe data load: enforces schema allow-list to avoid shipping auth/storage data.
  • External-work planning: surfaces the required non-DB work streams for platform teams.

Quick Start

Start with the Scan phase by launching the skill in your AI assistant and verifying source/target connectivity before moving to Phase 2.

Frequently Asked Questions about supabase-to-tidb-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a Supabase database to TiDB?

Migrating Supabase to TiDB requires a multi-phase workflow: scanning source connectivity, converting Postgres DDL, loading data with schema filtering, validating results, and optionally syncing. The process includes readiness assessment, RLS policy extraction, and planning app-layer rewrites for PostgREST, GoTrue, Realtime, and Storage components.

Can I move Supabase Row Level Security policies directly to TiDB?

Supabase RLS policies cannot be migrated directly to TiDB. The process extracts RLS policies into a structured checklist, which teams use to plan and execute an app-layer rewrite, enforcing those security rules within the application logic instead of the database.

What happens to Supabase auth and storage data during a TiDB migration?

Supabase auth and storage data is excluded during TiDB migration. The data loading phase enforces a strict schema allow-list to filter out Supabase internal schemas, ensuring internal authentication or storage tables are not shipped to the target database.

Do I need to rewrite my application layer when moving from Supabase Postgres to TiDB?

Moving from Supabase Postgres to TiDB requires an application-layer rewrite. The migration surfaces an external-work plan for platform teams to rewrite components relying on PostgREST, GoTrue, Realtime, and Storage, as these Supabase features are not natively supported by TiDB.

How do I convert Postgres DDL schemas to TiDB-compatible DDL?

Converting Postgres DDL to TiDB-compatible DDL is handled during the schema conversion phase. The process translates Postgres data types and DDL statements into TiDB-compatible equivalents, generating a detailed compatibility report to identify required manual adjustments.

What is the best way to assess compatibility before a Supabase to TiDB migration?

The best way to assess compatibility is starting with the Scan phase. This readiness assessment verifies source and target connectivity, enforces schema filtering, compiles a detailed compatibility report, and surfaces an external-work plan for non-database components before executing the migration.