---
name: role-database-database-migration-e163d7b2aeb4
description: |
  Schema and data migration patterns across all engines. Migration tools (Flyway, Liquibase, Alembic, Prisma Migrate, Atlas, golang-migrate, Knex, Ecto, EF Core, Diesel, ActiveRecord). Zero-downtime migration (expand-contract, blue-green, shadow writes). Cross-engine migration (MySQL→PG, Oracle→PG, MongoDB→PG). CDC-based migration (Debezium, DMS). Use when planning schema changes, migrating between databases, or implementing zero-downtime deployments.
allowed-tools: Read, Grep, Glob, Bash
---

# Database Migration

## Reference Files

Load from `references/` based on what's needed:

### references/tools-zero-downtime.md
Migration tool comparison table (11 tools across all languages).
Expand-contract pattern step-by-step (expand, dual-write, backfill, switch, contract).
Online DDL operations matrix (PostgreSQL vs MySQL locking behavior).
PostgreSQL concurrent index creation with INVALID index recovery.
Batch migration for large tables. MySQL online tools (pt-osc, gh-ost).
Load when: choosing a migration tool, implementing zero-downtime changes, or migrating large tables.

### references/cross-engine-cicd.md
MySQL to PostgreSQL type mapping and pgloader one-liner.
Oracle to PostgreSQL key syntax differences and tooling.
MongoDB to PostgreSQL flattening patterns.
CDC-based migration with Debezium connector config and AWS DMS overview.
Migration validation (row count + checksum comparison).
CI/CD pipeline integration with Flyway. Safety checklist and anti-patterns.
Load when: migrating between database engines, using CDC for live migration, or integrating migrations into CI/CD.


---
Source attribution: rnavarych
Original project: https://github.com/rnavarych/alpha-engineer/blob/c5b74102c7fd584af3d344ba7c331a7bbec3c729/plugins/roles/role-database/skills/database-migration/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Raman Navarych

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: rnavarych
Original project: https://github.com/rnavarych/alpha-engineer/blob/c5b74102c7fd584af3d344ba7c331a7bbec3c729/plugins/roles/role-database/skills/database-migration/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering, Product Management
Roles: Backend Developer, Data Engineer, Database Administrator, DevOps / SRE, Technical Product Manager
Specialties: Database
Tools: Activerecord, Alembic, Atlas, Dms, Debezium, Diesel, Ecto, Flyway, Knex, Liquibase, Golang Migrate, Ef Core, Prisma Migrate
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 095cb41fd9e5c8361416029cd1970b229198031a1e9f6b4db0abc16a42056ea8
