{
 "schema": "aiblocks-page/1",
 "id": "agent-database-migration-planner",
 "type": "skill",
 "name": "Agent database migration planner",
 "summary": "Plan a database migration that keeps your existing agent data. You get a schema map, staging checks, release order and rollback limits.",
 "headline": "Agent database migration planner",
 "subhead": "Plan a database change that preserves existing agent data. Get a schema map, staging checks, release order and recovery steps.",
 "job": {
  "id": "build-software",
  "name": "Build and ship software"
 },
 "level": "intermediate",
 "thinking": "medium",
 "tested": true,
 "updated": "2026-10-28",
 "first_published": "2026-10-25",
 "inputs": [
  {
   "type": "codebase",
   "required": true,
   "label": "Codebase",
   "what": "a project's code, in a folder or repo the AI can open"
  },
  {
   "type": "data_model",
   "required": true,
   "label": "Data model",
   "what": "a database design: the tables or collections, their fields and keys, and how they link"
  }
 ],
 "outputs": [
  {
   "type": "code_change",
   "required": true,
   "label": "Code change",
   "what": "a change to the code, with what it fixes and how it was checked"
  }
 ],
 "you_give": [
  "Your code, as a repo path or a zipped copy",
  "Your schema file or a database dump, with the names of the agent tables in use",
  "The exact change you want, and what you allow (plan only, or also write files)",
  "Backup and restore details, if you have them (optional)"
 ],
 "you_get": [
  "A current-state summary of your tables, constraints, data size and backups",
  "A source-to-target mapping of agent records to your tables",
  "Ordered migration steps, with backfill and access rules",
  "Staging checks and a rehearsal plan on a test copy",
  "Release order and rollback limits",
  "A list of what is missing and what was not run"
 ],
 "use_when": [
  "Your agents already store data, and you need to change the tables without losing it.",
  "Your agent tables do not match your project's tables, and you need a map from one to the other.",
  "You want a rehearsal and a recovery plan before anyone touches live data."
 ],
 "skip_when": [
  "You only add one column to a table with no data you need to keep: use your normal migration tool.",
  "You want to wipe and rebuild a live database: this plan refuses a reset, so use a script made for a throwaway test copy.",
  "You need the migration run for you: this makes a plan and files, so ask a developer to run them on your servers."
 ],
 "output_sample": {
  "input": [
   "Your code and database schemas for the project",
   "The exact change you want made",
   "The actions you allow, such as writing files or only planning",
   "Backup and restore details (optional)"
  ],
  "prerequisites": [
   "A test copy of your database, kept apart from live data, to rehearse the change"
  ],
  "output": [
   {
    "name": "Current state summary",
    "contains": "What the tables, constraints, data size and backups look like now, and which jobs read them."
   },
   {
    "name": "Source-to-target mapping",
    "contains": "Each agent record type matched to your project, with missing columns, renamed fields and meaning changes listed apart."
   },
   {
    "name": "Ordered migration plan",
    "contains": "Forward steps that add or change data in sequence, with backfill and access rules, and no table reset."
   },
   {
    "name": "Staging checks",
    "contains": "Queries and steps to test the change and the restore on a test copy, including row counts and old clients."
   },
   {
    "name": "Release order and rollback limits",
    "contains": "The order to ship, any locking or downtime, what to watch, and what a rollback cannot bring back."
   },
   {
    "name": "Run evidence and open questions",
    "contains": "What was run and what was not, plus assumptions and missing inputs."
   }
  ]
 },
 "how_to_use": [
  "Open the skill in your AI, or copy it and paste it into a new chat.",
  "Give it your code, your schema or dump, the table names, and the exact change you want.",
  "Read the mapping and the ordered steps. Check them against your own tables.",
  "Next, a developer runs the staging rehearsal on a test copy and brings the results back to your AI, which confirms the rollback plan.",
  "Release to live data only after the rehearsal and the restore both pass."
 ],
 "checks": [],
 "next": [
  {
   "name": "Database schema planner",
   "url": "https://useaiblocks.com/skills/database-schema-planner",
   "why": "Build it"
  },
  {
   "name": "Database designer",
   "url": "https://useaiblocks.com/skills/database-design-guide",
   "why": "Build it"
  },
  {
   "name": "Oracle migration risk reviewer",
   "url": "https://useaiblocks.com/skills/copilot-reviewing-oracle-to-postgres-migration",
   "why": "Build it"
  }
 ],
 "source": null,
 "credits": [],
 "files": [
  "references/worked-example.md"
 ],
 "links": {
  "page": "https://useaiblocks.com/skills/agent-database-migration-planner",
  "markdown": "https://useaiblocks.com/skills/agent-database-migration-planner.md",
  "json": "https://useaiblocks.com/skills/agent-database-migration-planner.json",
  "instructions": "https://useaiblocks.com/skills/agent-database-migration-planner/SKILL.md",
  "download": "https://useaiblocks.com/skills/agent-database-migration-planner.zip",
  "api_item": "https://useaiblocks.com/api/v1/items/agent-database-migration-planner",
  "api_document": "https://useaiblocks.com/api/v1/documents/skill/agent-database-migration-planner",
  "mcp": "https://useaiblocks.com/mcp"
 }
}
