Skip to main content
skill CX Codex

database-migrator — Claude Code skill: database migrations

database-migrator moves schemas, data, and database logic across PostgreSQL, MySQL, Supabase, PlanetScale, and MongoDB. Useful when a migration needs checks and a rollback plan.

MIT 267 installs ★ 440 updated 2026-10-20

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add OneWave-AI/claude-skills --skill database-migrator -a claude-code
Open on GitHub

What database-migrator does

The skill inspects the source database, collecting tables, columns, types, defaults, constraints, indexes, foreign keys, triggers, procedures, views, sequences, and row counts. For MongoDB, it scans collections to infer a schema. It then maps data types, translates provider-specific SQL, and writes scripts for schema creation, data transfer, and database logic.

Its output includes row-count checks, checksums, foreign-key validation, index checks, and sample-data queries. It also creates reverse-order drop scripts, backup and restore commands, application rollback steps, a downtime estimate, and migration-plan.md with the execution sequence. A relational-to-MongoDB move requires schema redesign, so it cannot be treated as a simple dialect conversion.

Supported paths cover PostgreSQL, MySQL, Supabase, PlanetScale, and MongoDB in either direction. Before running it, provide the source and target providers, connection method, schema scope, data scope, data volume, application dependencies, and downtime tolerance.

What it helps with

  • move a database between providers
  • map incompatible data types
  • generate schema and data migration scripts
  • validate rows, checksums, and foreign keys
  • prepare rollback steps and downtime estimates

Example prompts for the agent

  • Move the schema and data from PostgreSQL to Supabase and create migration-plan.md.
  • Compare types, indexes, triggers, and procedures while migrating from MySQL to PostgreSQL.
  • Plan a MongoDB-to-PostgreSQL migration with data checks and rollback steps.

How to install database-migrator

1Skills CLI (Vercel)

npx skills add OneWave-AI/claude-skills --skill database-migrator -a claude-code

2Manually: put the files in place

~/.claude/skills/database-migrator/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/database-migrator/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about database-migrator

How do I install database-migrator in Claude Code?

Run npx skills add OneWave-AI/claude-skills --skill database-migrator -a claude-code, then check ~/.claude/skills/database-migrator/SKILL.md.

What does database-migrator do?

It moves schemas, data, and database logic between PostgreSQL, MySQL, Supabase, PlanetScale, and MongoDB. It produces migration scripts, validation queries, rollback steps, and migration-plan.md.

Can it migrate a relational database to MongoDB?

Yes, but that path needs schema redesign because the source and target use different data models. It is more than a SQL dialect conversion.

Source text

SKILL.md · MIT
---
name: database-migrator
description: Migrates databases between providers (Postgres, MySQL, Supabase, PlanetScale, MongoDB). Reads source schema, generates migration scripts, handles data type mapping, foreign keys, indexes, triggers, stored procedures. Validates migration with row counts and checksums. Generates migration-plan.md with step-by-step execution guide, rollback procedures, estimated downtime.
tools: Read, Write, Bash, Glob, Grep, Agent
user_invocable: true
---

# Database Migrator

Move schemas, data, and logic between database providers. This is a cross-provider migration engine, not a schema designer: it handles data type incompatibilities, provider-specific SQL dialects, foreign key ordering, sequence and auto-increment translation, trigger rewrites, and stored procedure conversion. It validates with row counts and checksums and produces an auditable migration-plan.md.

## Contents

- references/schema-discovery.md -- Extraction queries for relational, MongoDB, Supabase, and PlanetScale sources.
- references/type-mapping.md -- Data type maps (PG/MySQL/Mongo) and SQL function translation.
- references/script-generation.md -- DDL, sequence, trigger, procedure, and view translation.
- references/data-migration.md -- Export, transform, and import commands per provider.
- references/validation.md -- Row count, checksum, FK integrity, index, and spot-check queries.
- references/rollback-and-downtime.md -- Rollback scripts, backup/restore, downtime estimation.
- references/migration-plan-template.md -- Full migration-plan.md output template.
- references/edge-cases.md -- Large tables, lossy mappings, document flattening, multi-schema, quality checklist.

## Supported Paths and Complexity

Supported source/target pairs: PostgreSQL, MySQL, Supabase (Postgres), PlanetScale (MySQL), and MongoDB, in any direction.

- Low: Same underlying engine (e.g., Postgres to Supabase). Mostly connection and permission changes.
- Medium: Same paradigm, different dialect (e.g., Postgres to MySQL). Requires type mapping and dialect translation.
- Medium-High: Different dialect plus provider constraints (e.g., PlanetScale has no database-level foreign keys).
- High: Paradigm shift (e.g., relational to document). Requires schema redesign, not just translation.

## When to Use

- Moving a production database from one provider to another.
- Migrating between self-hosted and managed services.
- Replicating a schema across providers for multi-cloud or disaster recovery.
- Consolidating multiple databases into a single provider.
- Translating a complete data model between relational and MongoDB.
- Producing a validated, auditable migration plan before executing in production.

## When NOT to Use

- Designing a new schema from scratch (use database-schema-designer).
- Migrating application code between frameworks (use full-codebase-migrator).
- Changing a few columns or adding one table (write the ALTER statements directly).
- Real-time replication or CDC -- this skill generates point-in-time scripts, not streaming pipelines.

## Workflow

Follow these steps precisely when this skill is invoked.

1. Gather migration parameters. Establish: source provider and version; target provider and version; connection method (live or dump file); schema scope (which schemas/tables); data migration (schema only or schema + data, full or partial); downtime tolerance; data volume; application dependencies; and output location (default to current directory). If the user already supplied these, skip the questions and proceed.

2. Discover the source schema. Extract tables, columns, types, defaults, constraints, indexes, foreign keys, triggers, procedures, functions, views, sequences, enums, and row counts. For MongoDB, scan collections to infer schema. For Supabase, also extract RLS policies, extensions, and publications. See references/schema-discovery.md.

3. Map data types. Translate every source type to the best target type and flag lossy or precision-changing conversions. Translate provider-specific SQL functions. See references/type-mapping.md.

4. Generate schema scripts. Resolve table creation order by topological sort (defer cyclic foreign keys). Generate DDL, translate sequences/auto-increment, rewrite triggers and stored procedures, and translate views. See references/script-generation.md.

5. Generate data migration scripts. Produce export, transform, and import commands for the source and target providers. See references/data-migration.md.

6. Generate the validation plan. Produce row count, checksum, foreign key integrity, index, trigger/procedure, and sample data spot-check queries for source and target. See references/validation.md.

7. Generate the rollback plan and downtime estimate. Produce reverse-order DROP scripts, backup/restore commands, application rollback steps, and a phased downtime estimate with reduction strategies. See references/rollback-and-downtime.md.

8. Generate migration-plan.md. Assemble the executive summary, scope, schema inventory, type mapping, incompatibilities, scripts, validation, rollback, downtime, risk assessment, checklists, step-by-step execution guide, and required application changes. Use the template in references/migration-plan-template.md.

9. Handle edge cases. Account for extremely large tables, lossy mappings, MongoDB document flattening, PlanetScale foreign key workarounds, Supabase specifics, and multi-schema migrations. Verify the plan against the quality checklist. See references/edge-cases.md.

© OneWave-AI · MIT · OneWave-AI/claude-skills

Similar skills

All skills for Data and databases →

From the same set185

The whole set →
weekly-business-report weekly-business-report is a Claude Code skill that collects weekly KPIs from enabled sources, compares them with targets and prior weeks, and saves a report. It brings business figures into a shared weekly view. CX Codex +1 276installs client-health-dashboard client-health-dashboard builds a client health view from CRM and engagement data, then produces a risk-ranked report with scores, trends, and next actions. CX Codex +1 276installs hiring-scorecard Builds a structured hiring scorecard for any role with weighted competencies, interview questions, evaluation matrix, red/green flags, and reference check questions. CX Codex +1 268installs sub-agent-orchestrator sub-agent-orchestrator chains different agents so each step feeds the next, with the flow defined in YAML. Handles retries, timeouts and parallel branches. CX Codex +1 267installs agent-to-agent agent-to-agent coordinates multi-agent workflows across Claude agents using shared context files, structured handoffs, and predefined orchestration patterns. CX Codex +1 263installs pricing-strategy Builds a pricing strategy for a product or service: analyzes costs, researches competitors, selects a model (cost-plus, value-based, penetration, premium), designs tier structure, projects revenue. CX Codex +1 260installs ai-readiness-assessment ai-readiness-assessment evaluates business readiness for AI adoption across six dimensions and generates an ai-readiness-report.md document with gap analysis. CX Codex +1 260installs api-load-tester api-load-tester — a skill for Claude Code, Codex, Cursor and other platforms that stress-tests HTTP endpoints with progressive concurrency. CX Codex +1 260installs

Project sponsors

Companies that keep this analytics open