spanner-to-tidb-migration

Migrate Cloud Spanner schemas and data to TiDB Cloud.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrate Cloud Spanner databases to TiDB, providing an end-to-end, phase-driven workflow that guides users from readiness assessment through schema conversion, data loading, and validation.

Core Features & Use Cases

  • End-to-end Spanner to TiDB migration workflow covering connect, scan, assess, score, convert, load, and validate.
  • Interactive, command-driven guidance that responds to user outputs and moves to the next phase.
  • Compatibility assessment with blockers and warnings, plus a formal readiness score and conversion artifacts.
  • DDL conversion rules including interleave flattening to foreign keys, commit-timestamp handling, TTL mapping, and view/function translation; supports multiple TiDB Cloud tiers.
  • Data loading orchestration via Dataflow/GCS and TiDB import/load paths; supports Starter/Essential/Dedicated tiers and CDC-based cutover guidance.
  • Validation and cutover planning, including delta checks and optional change stream configuration.

Quick Start

Follow Phase 1 to connect, then progress through Phase 2, Phase 3, Phase 4, Phase 5, Phase 6, and Phase 7 in sequence.

Frequently Asked Questions about spanner-to-tidb-migration

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

FAQPage Schema
How do I migrate a Cloud Spanner database to TiDB?

Migrating Cloud Spanner to TiDB involves an end-to-end workflow encompassing readiness assessment, DDL conversion, data loading, and validation. This process generates conversion artifacts and load plans for various TiDB Cloud tiers.

What is involved in converting Spanner schemas to TiDB?

Spanner schema conversion to TiDB includes flattening interleave tables to foreign keys, handling commit timestamps, mapping TTL, and translating views and functions. A compatibility checklist identifies blockers and warnings.

Can I load Spanner data into different TiDB Cloud tiers?

Yes, data loading supports Starter, Essential, and Dedicated TiDB Cloud tiers. Orchestration uses Dataflow and GCS alongside TiDB import and load paths, including CDC-based cutover guidance for delta checks.

How does Spanner to TiDB migration handle compatibility readiness?

Compatibility readiness is assessed through a formal scoring system that enforces or notes blockers and warnings. It builds a checklist to evaluate schema and data viability before generating conversion artifacts.

What is the best way to plan cutover during a Spanner to TiDB migration?

The best way to plan cutover involves validation and delta checks with optional change stream configuration. This ensures data consistency when transitioning from Cloud Spanner to TiDB Cloud.

Do I need Dataflow and GCS to load Spanner data into TiDB?

Dataflow and GCS are used for data loading orchestration alongside TiDB import and load paths. They facilitate moving data extracted from Cloud Spanner into the selected TiDB Cloud tier.