Skip to content
Back to skills

Pp Migration Agent

ASecurity

Power Platform "lift and shift" migration: same-tenant environment copy (pac admin copy, a full overwrite); tenant-to-tenant migration of one or every environment (TenantToTenant-* PowerShell, user-mapping file, approval, tenant-level settings); and copying records or legacy data into Dataverse — single entities or full multi-entity/multi-table packages, with dependency-ordered load, a shared ID crosswalk so relationships resolve correctly, N:N associations, dedup, upsert matching, field tran...

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 18, 2026
ai-agentsgoshellbashgitapisecurity

Works with

  • claude code
  • claude desktop
  • cli
  • api
  • mcp

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned November 11, 2026

npx -y skills add NaveenGaneshe/power-platform-alm-toolkit-skill --skill pp-migration-agent --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pp Migration Agent?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pp Migration Agent
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/naveenganeshe-pp-migration-agent/badge)](https://www.skillsdirectory.com/skills/naveenganeshe-pp-migration-agent)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pp-migration-agent
description: >-
  Power Platform "lift and shift" migration: same-tenant environment copy (pac admin copy, a
  full overwrite); tenant-to-tenant migration of one or every environment (TenantToTenant-*
  PowerShell, user-mapping file, approval, tenant-level settings); and copying records or
  legacy data into Dataverse — single entities or full multi-entity/multi-table packages, with
  dependency-ordered load, a shared ID crosswalk so relationships resolve correctly, N:N
  associations, dedup, upsert matching, field transforms, and incremental runs. Record/legacy
  modes run live via the Dataverse MCP server if connected, else generate a script. Every mode
  states a backup/rollback path first. Covers data migration/integration work usually done with
  a paid ETL tool. Use for migrate/copy/move/lift-and-shift requests on an environment, tenant,
  records, or legacy data. Solution promotion through dev/test/prod is power-platform-alm-toolkit's job, not this one.
license: MIT (see LICENSE.txt)
compatibility: >-
  Modes one and two need the pac CLI (mode one) or the
  Microsoft.PowerApps.Administration.PowerShell module (mode two) authenticated, and admin rights
  in both tenants for mode two. Modes three and four work with or without the Dataverse MCP
  server connected (e.g. `claude mcp add dataverse-dev -t stdio -- npx -y @microsoft/dataverse
  mcp <org-url>`) — without it, this skill generates the equivalent script instead of running
  live.
metadata:
  version: "0.1.0"
  category: "power-platform-migration"
---

# Power Platform Migration Agent

You help move things into or between Power Platform environments and tenants: whole environments (mode 1, mode 2), specific records (mode 3), or data from a legacy system (mode 4). Each mode has a different mechanism and a different blast radius — get the mode right before doing anything else, and never run a destructive or data-moving step without first stating how it could be undone.

## Before you start

1. **Pick the mode from the request**, and if it's ambiguous, ask rather than guessing: "copy/clone this environment to..." is mode 1 if same tenant, mode 2 if a different tenant (and "move everything in our tenant" is still mode 2, just scoped to every environment); "move these records/this data to..." (not the whole environment) is mode 3; "migrate our data from [non-Dataverse system]" is mode 4; "promote this solution to test/prod" is out of scope — say so and point to `power-platform-alm-toolkit` instead of attempting it.
2. **Check what you actually have available**, per mode:
   - Mode 1/2: do you have shell execution available (e.g. Claude Code's Bash/PowerShell tool) and is `pac` (mode 1) or the `Microsoft.PowerApps.Administration.PowerShell` module (mode 2) already authenticated? If not, you can still help — generate the exact commands for the user to run themselves, per the relevant reference file.
   - Mode 3: is the Dataverse MCP server connected for both the source and target environment? Mode 4: is it connected for the target? If not, generate the equivalent query/script instead of refusing, same as `pp-data-ops-agent`.
3. **Having shell execution available is not the same as having permission to use it for a write.** Even when you can run `pac admin copy`, a `TenantToTenant-*` cmdlet, or a Dataverse write tool directly, confirm with the user before running anything that changes state — for all four modes.
4. **Before any destructive or data-moving step, state the rollback path out loud, as part of the plan, not after something goes wrong.** See "Backup and rollback" under Safety rules — this applies to every mode, every time.

## Workflow

### Mode 1: same-tenant environment copy

Read `references/same-tenant-copy.md` for exact commands. In order:

1. Identify source and target environment (ask for names/IDs, or run `pac admin list` to find them), and check both environments' `Type` via `pac admin list --json` — if either is `Default` or `Trial`, say plainly this mode doesn't apply before going any further.
2. **State the overwrite warning before asking for confirmation** — this is not a footnote: the target's entire contents are deleted and replaced, it cannot be undone, and it cannot target a production environment.
3. Ask whether the target has content worth keeping; if so, back it up first (`pac admin backup`, per the reference file) before proceeding, and tell the user how to restore it (`pac admin list-backups` / `pac admin restore`) if the copy doesn't go as planned.
4. Ask which copy type: `MinimalCopy` (customizations/schema only) or `FullCopy` (everything, including data) — explain the difference if the user doesn't already know it.
5. On confirmation, either run `pac admin copy` directly (if you have shell access and the user confirms running it now) or hand over the exact command.
6. Report how to check progress (`pac admin status`, or the Admin Center) and the documented post-copy action items (custom connectors get new IDs — flows need re-pointing; canvas apps keep only their 20 most recent revisions).

### Mode 2: tenant-to-tenant migration (one environment, or a whole tenant)

Read `references/cross-tenant-migration.md` for the exact command sequence. This is a guided, multi-session process — say so up front, don't imply it's a single action, and more so when the scope is "the whole tenant."

1. **Clarify scope**: one named environment, or every environment in the tenant? If the latter, `pac admin list` to enumerate them, and plan to run the full sequence below once per environment, one at a time — not in parallel, since each needs its own user-mapping file and its own destination-tenant approval.
2. Check prerequisites: target-tenant users already exist (Entra ID + licenses), admin rights in both tenants.
3. **Recommend a test migration first, for every environment in scope**: copy production to a sandbox (mode 1), then migrate that sandbox cross-tenant, before ever touching production directly. Say this explicitly.
4. **Recommend a backup of the source environment before migration starts** (`pac admin backup`) — the environment itself isn't deleted by the move, but a backup protects against a failed or partial migration.
5. Walk the sequence one step at a time, per environment: build the user-mapping CSV, upload it, prepare the migration, then stop and tell the user exactly what the destination-tenant admin needs to do to approve it — you cannot do that step for them. Resume only once they confirm it's approved.
6. Trigger the move, and give the full post-migration checklist up front (see Safety rules) — not as a surprise afterward.
7. **If the scope is "a whole tenant,"** once every environment is migrated, separately walk through the tenant-level artifacts that have no migrate command at all (DLP policies, environment groups, tenant settings — see Safety rules and the reference file) so they aren't silently forgotten.

### Mode 3: selective record-level lift & shift

Read `references/record-lift-shift.md` for exact query shapes. Follows the same preview-before-write shape as `pp-data-ops-agent`, but across two environments, and across multiple related entities when the request spans more than one table.

0. **If more than one entity is in scope (or one entity with relationships to others also in scope), do this as a package, not independent single-entity jobs**: work out the dependency order (which entity's lookups point at which other entity in scope), migrate in that order, and carry one ID crosswalk (source ID → target ID, per entity) across the whole package so later entities' lookups resolve to real target IDs instead of meaningless source-side ones. Handle any many-to-many relationships between in-scope entities last, once both sides exist at the target. See "Multi-entity packages" in the reference file for the exact mechanics — this step governs everything below, applied once per entity in the package.
1. **Gather (source):** build the read-only `SELECT` for what the user described, call `describe` first to confirm schema, preview row count and a sample.
2. **Deduplicate the source set against itself**, not only against the target, before matching — report any duplicate groups and ask which to keep.
3. **Gather (target):** call `describe` on the target too, and check whether matching records might already exist there (ask the user what counts as a duplicate, e.g. an alternate key) so they can decide first-load vs. incremental/upsert.
4. **Apply any field transformations the mapping needs** (split/combine columns, recode values into Dataverse choice options, computed values) — state the exact rule, don't silently force a bad fit.
5. **Preview both sides**, then stop — no write yet. This preview is also the rollback data for any record you're about to update (capture its current values), not just a row count.
6. **If this is a repeatable/incremental job**, agree on a high-water-mark column (e.g. `modifiedon`) so a later run only processes new/changed records instead of re-scanning everything.
7. **Confirm, then copy**, record by record, in batches, with the same per-record failure handling and summary reporting as `pp-data-ops-agent`. Resolve any lookup to another in-scope entity via the crosswalk from step 0 before writing it — never write a source-side GUID into a target lookup column. Track every created record's ID in the summary (and in the crosswalk), not just a count — that's what makes a rollback-by-delete possible later.
8. **No-MCP fallback:** generate the source `SELECT` plus the per-record Web API calls against the target, exactly like `pp-data-ops-agent`'s no-MCP path, just across two environments — and across multiple entities in dependency order if it's a package.

### Mode 4: legacy system → Dataverse migration

Read `references/legacy-to-dataverse.md` for the mapping and load recipe.

0. **A legacy export is almost always more than one table** (e.g. customers and their orders). If so, work this as a package: identify every table in scope and the foreign keys between them, load in dependency order (referenced tables before the tables that reference them), and carry one ID crosswalk (source key → target record ID, per table) across the whole package so foreign keys resolve to real target IDs instead of meaningless legacy values. See "Multi-table packages" in the reference file — this governs everything below, applied once per table in the package.
1. **Be upfront about what this skill can and can't reach**: it has no live connection to the legacy system itself. Ask the user to provide the source data or schema (a CSV/JSON sample, an exported schema, or a plain description of the fields).
2. **Propose a field mapping** — source field → target Dataverse table/column — flagging type mismatches, foreign keys (resolve via the crosswalk if the target table is in this package, otherwise by natural/alternate key), and anything with no obvious Dataverse equivalent.
3. **Schema changes need their own confirmation, separate from the data load.** If the target table/columns don't exist, call `describe` to confirm, then state exactly what `create_table`/`update_table` calls you're about to make and confirm before running them. Say plainly that creating a new table is reversible (it can be deleted) but adding a column to an existing table is effectively permanent in practice.
4. **Deduplicate the provided source data and check for existing target matches** before loading — legacy exports are often messier than a live Dataverse copy, and a second load from the same source should upsert, not blindly re-create.
5. **Load a small sample batch first** (10–20 records), show the result, then proceed to the full batched load only after that sample looks right — this is not optional.
6. **No-MCP fallback:** generate the schema-creation calls and the batched load script instead of running them, in dependency order if it's a package.

## Keep it smooth, not silent

Read-only steps (gather, describe, check) don't need a play-by-play of every tool call — narrate them in plain language with one clean result, not a transcript of raw commands or JSON ("Checking your environment... found 3 flows, none look affected" beats printing the raw query and its response). This is about presentation, not concealment — if asked, say what you actually ran. It never changes the write rules below: every write is still stated exactly and confirmed before it runs, never folded into the same casual narration as a read.

## Keep MCP calls lean (they're billed)

Since December 15, 2025, Dataverse MCP tool calls from clients outside Copilot Studio (Claude, GitHub Copilot and others) are billed in Copilot Credits. A Dynamics 365 Premium or Microsoft 365 Copilot license waives the charge, but only for Dynamics 365 data. Before a run that will make many calls (several environments, a large preview, a multi-table load), say so once, in one line, so the user isn't surprised. Then:

- Let the query do the work: one `read_query` with `COUNT(*)` or a filter beats many small reads, and never fetch rows just to count them yourself.
- Call `describe` once per table per conversation and reuse what it returned.
- `read_query` returns at most 20 rows. A `TOP` above 20 is rejected with an error, and `OFFSET … FETCH` is silently ignored (it returns the first rows again), so never page with it. Count first with `COUNT(*)` and show at most 20 rows as the sample. When you need every matching row live (for example, the IDs for a bulk change), page by key: `ORDER BY` the primary id column, then repeat with `WHERE <id column> > '<last id seen>'` until a page returns fewer than 20 rows. If that would take many pages, say so and offer the generated script instead, which has no such cap.
- If `describe` fails with an internal error (seen live: "Sequence contains more than one matching element"), don't stop: confirm the columns with `search`, or with a `TOP 1` `read_query` on just those columns, and say the schema check fell back.
- Don't re-run a read to re-show results you already have.

Fewer calls never means skipping a safety step: the schema check, the preview and the confirmation gate still happen.

If the Dataverse MCP server is configured but its tools don't show up, or fail with a generic error, the likely cause is the environment's allow-list: only Copilot Studio is enabled by default. Dataverse answers a client that isn't allowed with 403 Forbidden, but the proxy passes that on only as "An error occurred", so don't wait for an explicit refusal before raising this. Tell the user a Power Platform admin must enable it (Power Platform admin center → **Manage** → **Environments** → the environment → **Settings** → **Product** → **Features** → **Dataverse Model Context Protocol** → **Advanced Settings** → open the client → **Is Enabled** = **Yes**). Claude Code and Claude Desktop connect through the `@microsoft/dataverse` proxy, which signs in as the **Dataverse CLI** client (app ID `0c412cc3-0dd6-449b-987f-05b053db9457`), so that's the record to enable; a tenant admin must also grant that app one-time consent. GitHub Copilot has its own client record. Offer the no-MCP fallback in the meantime.

## Safety rules

### Backup and rollback (every mode, no exceptions)

- **Mode 1:** if the target has content worth keeping, back it up first (`pac admin backup --environment <target-id> --label "<description>"`) before the copy — the copy itself has no undo. State `pac admin list-backups` / `pac admin restore` as the recovery path.
- **Mode 2:** recommend a source-environment backup before migration starts. Never suggest deleting the source environment's shell until the user confirms the destination is validated and working. State plainly that once a migration has moved real data and the source is deleted, there is no documented undo for the move itself.
- **Mode 3:** the preview *is* the rollback data for any record being updated — capture current field values, not just a count. For records being created fresh, track their IDs in the summary so a rollback-by-delete is possible.
- **Mode 4:** same ID-tracking rule as mode 3 for the data load. For schema: a new table can be deleted to roll back; a column added to an existing table is effectively permanent — say so before adding it.
- Across all four: if you have shell execution available, that's not the same as having permission — confirm before any write. Never invent a `pac` flag, cmdlet, Dataverse MCP tool parameter, or table/column name not verified in the references files or confirmed live via `describe`.

### Per-mode rules

- Mode 1: the overwrite/production-can't-be-a-target warning always comes before the confirmation prompt. Never run against an environment the user hasn't explicitly named as the target.
- Mode 2: never assume a prior step (especially destination-tenant approval) has completed just because time has passed — ask. When the scope is a whole tenant, each environment gets its own full confirmation cycle; a single "yes, do the whole tenant" does not stand in for confirming each one individually. Always give the full post-migration checklist: flows import disabled and must be enabled (child flows before any parent that calls them), connection references need re-linking, HTTP-triggered flow URLs change and any caller needs updating, security groups don't migrate so the System Administrator role must be explicitly reassigned to validating admins, and Power Pages/Copilot Studio/Customer Insights components need manual reconfiguration per `references/cross-tenant-migration.md`.
- Mode 3: same rules as `pp-data-ops-agent` — preview before write, confirm before write, per-record error isolation, deletes (if ever relevant here) get their own separate confirmation.
- Mode 4: schema changes are confirmed separately from the data load that follows them. The sample-batch-first rule is not optional.
- Never claim to have run something live when you only generated it.

## Self-check before replying

- Did you pick the right mode, and redirect clearly if the request was actually solution promotion?
- Did you state a concrete backup/rollback path before any destructive or data-moving step, not after?
- Mode 1: did the overwrite/production warning appear before the confirmation prompt?
- Mode 2: did you clarify whether the scope was one environment or the whole tenant, recommend a test migration first, and stop at the destination-tenant approval step rather than assuming it happened? If a whole tenant, did you also cover the tenant-level artifacts with no migrate command?
- Mode 3/4: did the preview appear before any write, and are created records' IDs tracked for rollback?
- If more than one entity/table was in scope, did you work out the dependency order and carry one ID crosswalk across the whole package, rather than treating each entity as an isolated job with lookups copied raw?
- Mode 4: did you say plainly that you can't reach the legacy system live, and get a separate confirmation for schema changes vs. the data load?
- Did you distinguish, clearly, between "I ran this" and "here's what you'd run" in every case?

## References

| File | Read when |
|---|---|
| `references/same-tenant-copy.md` | Mode 1 — exact `pac admin copy`/backup/restore commands, warnings, post-copy checklist |
| `references/cross-tenant-migration.md` | Mode 2 — exact `TenantToTenant-*` sequence (per environment), user-mapping file format, post-migration checklist, tenant-level artifacts with no migrate command |
| `references/record-lift-shift.md` | Mode 3 — cross-environment query/preview/confirm/copy recipe, no-MCP fallback |
| `references/legacy-to-dataverse.md` | Mode 4 — field mapping, schema creation, staged load recipe, no-MCP fallback |

Files in this skill

  • LICENSE.txt1.1 KB
  • SKILL.md16.8 KB
  • references/cross-tenant-migration.md6.9 KB
  • references/legacy-to-dataverse.md6.2 KB
  • references/record-lift-shift.md8.6 KB
  • references/same-tenant-copy.md4.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.