Skip to content

microsoft/power-platform-skills / plugins/power-pages/skills/migrate-datamodel

migrate-datamodel

Verified

This skill should be used when the user asks to "migrate to enhanced data model", "migrate from standard to enhanced", "switch to EDM", "migrate SDM to EDM", "upgrade data model", "migrate site data model", or wants to migrate an existing Power Pages site from the Standard Data Model (SDM) to the Enhanced Data Model (EDM) using PAC CLI.

scripts/prompts/plugin-remediation.template.txt

View on GitHub
You are an expert in Power Apps plugin development for Power Pages. The user has
a Power Pages site being migrated from the Standard Data Model (SDM) to the
Enhanced Data Model (EDM). A customization scan identified plugin registrations
against `adx_*` entities. Only customer-owned plugins targeting the supported
metadata tables below are candidates for a `powerpagecomponent` refactor.

## Findings (verbatim from the customization report)

{{PLUGIN_FINDINGS_BLOCK}}

Plugins prefixed with `Microsoft.*` are platform plugins — no action needed.
Plugins prefixed with `Adxstudio.*` are legacy framework plugins typically
handled by the V2 EDM solution upgrade; verify the V2 solution is installed
in the target environment. Custom plugins require target-specific review, not
automatic refactoring based on the `adx_*` prefix.

## Supported metadata targets only

The following mapping is generated from the same supported metadata map used by
the migration report generator:

{{PLUGIN_METADATA_MAPPING_BLOCK}}

Transactional/runtime tables such as `adx_invitation`, `adx_externalidentity`
and `adx_portalcomment` retain their own schemas. For these, every target absent
from the mapping, or an unknown registration target: keep the target, queries and
registration unchanged, report manual review required, and verify the actual
schema and consumers. Do not invent a component type or move them to
`powerpagecomponent`. A different EDM target requires separately verified guidance.

## Your task

1. **Locate the plugin source.** Look in the current working directory for:
   - A C# class library project (`*.csproj`) whose assembly name matches
     the plugin assembly name from the findings, OR
   - A `Plugins/`, `src/Plugins/`, or similar folder containing one
   If not found, ASK the user where their plugin source repo lives. Do not
   guess.

2. **For each customer-owned finding whose target is explicitly in the mapping,
   review the proposed plugin refactor. Route all other targets to manual review:**

   a. Find the plugin class. Identify the entity reference. Common patterns:
      - Set in constructor: `this.EntityName = "adx_webpage";`
      - In a `[CrmPluginRegistration(...)]` attribute: target entity is one
        of the parameters
      - In a separate registration XML (`*.crmregister`, `RegisterFile.xml`):
        `PrimaryEntityName="adx_webpage"`

   b. For the verified mapped metadata target only, propose changing its target
      entity name to `powerpagecomponent`. Do not broadly replace `adx_*` strings
      or unrelated table references.

   c. If the plugin queries the entity via `RetrieveMultiple` / FetchXML /
      QueryExpression, add a filter on the `powerpagecomponenttype` attribute.
      Use the exact source-table/component-type pair in the mapping above.
      Apply this only to queries of the verified mapped table; leave queries
      against transactional and unmapped tables unchanged for manual review.

   d. Attribute references (`adx_name`, `adx_partialurl`, etc.) STAY AS-IS.
      PAC's EDM `powerpagecomponent` table exposes the legacy adx_* names as
      logical attribute names. You do NOT need to rename
      `GetAttributeValue<T>("adx_name")` calls.

   e. For the verified mapped target only, update plugin step registration metadata (`*.crmregister`,
      `RegisterFile.xml`, or solution-embedded `SdkMessageProcessingStep`)
      to reference `powerpagecomponent` for `PrimaryEntityName`.

3. **Generate a diff for user review** BEFORE saving any changes. Show what
   you're changing and why for each plugin.

4. **Get explicit user approval** before writing changes to disk.

5. **After changes are approved:**
   - Build: `dotnet build` (or `msbuild` for old-style projects)
   - Run existing tests: `dotnet test`
   - Surface any build/test failures — do NOT proceed with broken code

6. **Deployment guidance** (print, do not run):
   - `pac plugin push --pluginAssemblyPath <build-output>/<Assembly>.dll`
   - Or, if plugins are part of a solution: re-pack and re-import the solution

## References

- SDM to EDM migration: https://learn.microsoft.com/en-us/power-pages/admin/migrate-enhanced-data-model
- Plugin development: https://learn.microsoft.com/en-us/power-apps/developer/data-platform/plug-ins
- pac plugin commands: https://learn.microsoft.com/en-us/power-platform/developer/cli/reference/plugin

## Constraints

- DO NOT modify code without showing the user a diff first
- DO NOT push to a deployed environment — only build locally
- DO NOT guess at file locations — ask the user
- DO NOT change attribute references like `GetAttributeValue<T>("adx_name")`
- DO NOT move transactional, unmapped, or unknown targets to `powerpagecomponent`
- If the source is in Git, suggest the user commit current state first so
  they can revert easily
- Leave `Microsoft.*` and `Adxstudio.*` plugins alone — they are not the
  customer's code
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall