---
name: data-migration
description: Plan and execute database migrations, data transformations, and system migrations safely with rollback strategies and data integrity validation. Use when migrating databases, transforming data schemas, moving between database systems, implementing versioned migrations, handling data transformations, ensuring data integrity, or planning zero-downtime migrations.
---

# Data Migration - Safe Schema Changes

## When to use this skill

- Migrating database schemas and structures
- Transforming data between formats
- Moving data between database systems
- Implementing versioned database migrations
- Handling data transformations during migrations
- Ensuring data integrity and validation
- Planning zero-downtime migrations
- Rolling back failed migrations safely
- Migrating from legacy systems
- Implementing data backfill strategies
- Testing migrations in staging environments
- Creating migration rollback procedures

## When to use this skill

- Migrating data between schemas, zero-downtime deployments.
- When working on related tasks or features
- During development that requires this expertise

**Use when**: Migrating data between schemas, zero-downtime deployments.

## Process
1. Add new column
2. Dual-write to old & new
3. Backfill historical data
4. Switch reads to new column
5. Remove old column

## Example
\`\`\`sql
-- Step 1: Add column
ALTER TABLE users ADD COLUMN email_new VARCHAR(255);

-- Step 2: Backfill
UPDATE users SET email_new = email WHERE email_new IS NULL;

-- Step 3: Swap
ALTER TABLE users DROP COLUMN email;
ALTER TABLE users RENAME COLUMN email_new TO email;
\`\`\`

## Resources
- [Database Migrations](https://www.prisma.io/docs/concepts/components/prisma-migrate)


---
Source attribution: Microck
Original project: https://github.com/Microck/ordinary-claude-skills/blob/1056d293d41a3a3b86518d8ab6ec0a79091ccedb/skills_all/data-migration/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2025 Microck

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.

i did not write most of these. i just collected them.

*   **anthropic skills:** mit license (mostly)
*   **community skills:** check the `LICENSE` file in each specific folder.

credits go to https://github.com/anthropics, https://github.com/obra, https://github.com/ComposioHQ, and the other people listed in the source tables. if you own one of these and want me to take it down, just open an issue and i will nuke it.



# Dave AI resource metadata

Creator / publisher: Microck
Original project: https://github.com/Microck/ordinary-claude-skills/blob/1056d293d41a3a3b86518d8ab6ec0a79091ccedb/skills_all/data-migration/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: Backend Developer, Data Engineer, Database Administrator
Specialties: Backend, Database
Tools: MongoDB, MySQL, Prisma, PostgreSQL, SQLite
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: ded586fa2528b816291ba6f38844d3b3ae6465e9fbd303fcaa0f735edd051761
