InfoPath may be retired, but many organizations still have important business data sitting inside legacy InfoPath forms, SharePoint libraries, or classic list item attachments. Moving that data into a modern SharePoint list can be painful, especially when the original form data is stored as XML and includes embedded attachments.
To help with that challenge, I created a new open-source tool: InfoPath XML to SharePoint List Migration.
You can find it on GitHub here:
https://github.com/mikelee1313/InfoPath-Migration
What the tool does
This migration script helps move legacy InfoPath XML records from a source SharePoint list or document library into a modern target SharePoint list. It uses PnP.PowerShell and app-only certificate authentication, making it suitable for controlled migration scenarios where unattended or repeatable execution is important.
At a high level, the script:
- Connects to the source and target SharePoint locations
- Reads InfoPath XML payloads from XML files or list item attachments
- Parses metadata from the InfoPath XML
- Maps that metadata into SharePoint list fields
- Optionally creates missing target columns
- Extracts embedded InfoPath attachments
- Handles duplicate records using configurable strategies
- Writes detailed run output and logging
Why I built it
A lot of InfoPath migration conversations focus on replacing the form experience, but the data migration side is just as important. Many legacy forms contain years of business records, approvals, requests, supporting files, and metadata that still need to be retained.
Manually extracting that information is time-consuming and error-prone. I wanted a repeatable tool that could help modernize the data layer while giving administrators control over how records are created, skipped, or replaced.
Key features
The script includes several features designed for real-world SharePoint migration work:
- Certificate-based app-only authentication
- Cross-site migration support
- Source and target lists by title, GUID, or URL
- InfoPath XML parsing
- Embedded attachment extraction
- Optional metadata column creation
- Duplicate handling with Skip, Overwrite, or CreateNew
- Duplicate detection by Title or metadata plus attachment names
- Full-item replacement mode for overwrite scenarios
- Structured logging and run summaries
- Retry handling for throttling and transient SharePoint failures
- Performance improvements for larger lists using in-memory indexes
Duplicate handling
One of the areas I wanted to make flexible was duplicate handling. Depending on the migration scenario, you may want to avoid duplicates, replace existing migrated items, or always create new records.
The tool supports three duplicate actions:
- Skip: leave the existing target item as-is
- Overwrite: delete the matched target item and recreate it from the source
- CreateNew: always create a new target item
For duplicate detection, you can use a simple Title match or a more advanced comparison based on mapped metadata and attachment file names.
Recommended migration approach
For production migrations, I recommend starting small:
- Run a test batch using
-MaxItems 20 - Confirm the metadata mapping and attachment results
- Decide whether duplicate detection should use Title or metadata plus attachment names
- Run the full migration in monitored batches
This gives you a safer path to validate the output before processing a large set of records.
Getting started
The main script is:
migrate-infopath-xml-to-list-pnp.ps1
A basic certificate-authenticated run looks like this:
$params = @{
SiteUrl = 'https://contoso.sharepoint.com/sites/Main'
SourceList = 'https://contoso.sharepoint.com/sites/Legacy/Shared%20Documents'
TargetList = 'https://contoso.sharepoint.com/sites/Modern/Lists/Subscriptions'
TenantId = 'tenant-guid'
ClientId = 'app-guid'
AuthType = 'Certificate'
Thumbprint = 'CERT_THUMBPRINT'
CertStore = 'LocalMachine'
}
.migrate-infopath-xml-to-list-pnp.ps1 @params
The script requires PnP.PowerShell and an Entra ID app registration with the appropriate SharePoint application permissions and certificate authentication configured.
Final thoughts
InfoPath migrations can vary a lot from one environment to another, especially when forms contain custom XML structures, attachments, or unique field mapping requirements. This tool is intended to provide a practical starting point that can be tested, extended, and adapted for specific migration needs.
If you are dealing with legacy InfoPath data in SharePoint and need a way to move XML-based records into a modern list, take a look at the repository: