- Home
- Skills
- Data & Databases
- DB Migration Guardian: Zero-Downtime Migration Planner
Works with the AI Agents you already use
DB Migration Guardian: Zero-Downtime Migration Planner
Design safe, zero-downtime database migrations with engine-specific locking analysis and resumable backfill plans.
$23.99
DB Migration Guardian: Zero-Downtime Migration Planner
Example session with this skill installed
I need to rename the 'email' column to 'primary_email' on a 500GB PostgreSQL 15 table with high write volume. We need zero downtime.
- Read your context and instructions
- Compiled the db migration guardian
The proposed migration for renaming email to primary_email is classified as
High Risk due to the table size and write volume. A direct rename is not recommended for zero-downtime rolling deployments as it would break the current application version.
Migration Sequence: PostgreSQL 15 Expand-Contract
| Phase | Change | Compatibility | Validation Gate |
|---|---|---|---|
| 1. Expand | Add primary_email as a nullable column | Old app ignores new col; New app writes both | DDL completes (check pg_stat_activity) |
| 2. Deploy | Release code with dual-write logic | Apps write to both, read from email | Error rate < 0.1% |
| 3. Backfill | Batch copy email to primary_email | Reads remain on email | count(*) where primary_email is null = 0 |
| 4. Switch | Update app to read from primary_email | Old app (if any) still writes both | P99 latency stable |
| 5. Contract | Drop the email column | All clients verified on new col | Final cleanup approval |
Backfill Strategy
Use a keyset-based batch script to avoid long-held locks:
-- Resumable batch update (pseudocode)
UPDATE users
SET primary_email = email
WHERE id > :last_id AND id <= :last_id + 1000
AND primary_email IS NULL;
Locking Note: PostgreSQL 15 adds columns without a full table rewrite if the column is nullable. However, the UPDATE backfill will generate WAL volume; monitor replication lag.
Next steps
- Confirm the
idcolumn is a sequential Primary Key for the backfill cursor. - Verify available disk space for increased WAL generation during the dual-write phase.
- Schedule a rehearsal in staging with a restored production dataset.
Connects securely to your tools. The creator never sees your data.
About this skill
Database migrations are often the single point of failure during production deployments. This skill helps you avoid data loss, application downtime, and irreversible schema changes by generating precise, operator-ready migration plans. It moves beyond basic DDL generation to provide deep analysis of engine-specific locking, application compatibility, and resumable data backfills.
What it does
- Compatibility mapping analyzes how old and new application versions will interact with schema changes during rolling deployments.
- Lock and load analysis evaluates the specific database engine and version to predict table locks, index-build overhead, and replication lag.
- Backfill orchestration designs idempotent, batched, and resumable data migrations to prevent transaction log exhaustion or performance degradation.
- Recovery planning distinguishes between schema rollbacks, data roll-forwards, and point-in-time recovery steps.
- Release sequencing generates a phased deployment table covering expansion, application rollout, backfill, verification, and contraction.
How it works
- Discovery phase where you provide the database engine, version, current schema, and data volume metrics.
- Analysis phase where the agent classifies the change risk and identifies engine-specific operational constraints.
- Plan generation resulting in a structured migration runbook including SQL validation queries and observability gates.
Frameworks & tools
Works with any relational database engine including PostgreSQL, MySQL, and SQL Server. Compatible with migration tools like Liquibase, Flyway, Alembic, or Prisma.
Why this beats prompting it yourself
Generic prompts often overlook the "contract" phase of a migration or ignore engine-specific locking behaviors that cause outages. This skill enforces a strict expand-contract methodology and requires resumable backfill logic that handles concurrent writes.
Use cases
- Adding a
NOT NULLconstraint to a high-traffic table without downtime. - Changing a data type on a multi-terabyte table where a direct
ALTER TABLEwould lock the database. - Renaming columns across microservices that share a database and require zero-downtime releases.
- Implementing complex data rewrites that require dual-writing and checksum verification.
Known limitations
Does not execute SQL directly or connect to production environments. Requires manual input of database metrics and schema definitions to produce accurate risk assessments.
Requires manual input of engine specs and data metrics. Does not execute code or connect to live DBs. Analysis is limited to the accuracy of provided schema and volume facts.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 14 days ago
Permissions
No special permissions declared or detected