[ ] Bug
[ ] Enhancement
[ ] Page Transformation: Error during the setup/use of the Page Transformation UI solution (did you check our troubleshooting guide?)
[ ] Page Transformation: Error during the use of page transformation from PnP PowerShell
[ ] Page Transformation: Error during the use of page transformation from .Net
[x] Page Transformation: Page is not looking correct after transformation
[ ] Modernization Scanner: something went wrong...
We have picked custom (layout) web part page and created a mapping file but not been able to recreate this in the destination communication site.

As above.
(pnpCommandlet ver: 3.14.1910)
Export-PnPClientSidePageMapping -BuiltInPageLayoutMapping -CustomPageLayoutMapping PublishingPage "Business-Travel-and-Expenses-Policy.aspx"
ConvertTo-PnPClientSidePage -PublishingPage -Business-Travel-and-Expenses-Policy.aspx -Overwrite -PageLayoutMapping C:\user\Client\Docs\ModernizationExp\custompagelayoutmapping.xml
Related Queries
Do we need to move the Custom page layouts used from Source site to Target site before the page transformation? This is for getting correct zone/section layout as like the source page.
Is it possible to map a custom page layout to an OOB page layout using –PageLayoutMapping file, to avoid the customizations in Modern site?
How do we keep the custom styles from Source page to Target site page? What are the options available? We lost the styles after the migration.
How would we convert the Script editor web part/CEWP with script tags to the Modern site page? Is SPFx the available option? Note, we've deployed the Modern Search solution in our test tenant so this might be an option going
Is the preferred alternate to Content Query/Content Search web part say one of the Modern Search Results web parts
The publishing pages will migrate to a separate site collection only. So the Library/List view web parts in a page will migrate, if a list/library with the same name exists in the target site. How we can avoid to recreate the backend lists/libraries in target site. What be the approach on it?
Thanks for your contribution! Sharing is caring.
Hi @westerdaled ,
When you transform publishing pages you typically need to customize the generated page layout mapping file. When we generate a mapping file it's meant as as starting basis, typical customizations that folks do are:
So looking at your command line I assume you want to transform a publishing page (we can do web part pages as well) and your publishing page has 2 web part zones, among other content parts. So in the generated page layout file you should see Zone1 and Zone2 being listed in the WebPartZones node: if you update the Zone1 WebPartZone element to be at row 1 and column 1 and the Zone2 WebPartZone element to be at row 1 and column 2 you'll see the web parts in these zones being position in a 2 column section. See https://docs.microsoft.com/en-us/sharepoint/dev/transform/modernize-userinterface-site-pages-model-publishing for more details on the page layout mapping model.
About your other questions:
Hi @jansenbe
Thanks for the level of detail you have provided. The team and I have been attempting implement your recommendations.
ConvertTo-PnPClientSidePage -PublishingPage –Identity “BusinessPolicy.aspx” -Overwrite -TargetWebUrl “https://tenant.sharepoint.com/” -PageLayoutMapping "C:\user\client\Docs\ModernizationExp\custLayout.xml"
When the same lists with the same view exists in the target site collection we indeed try to match up the lists, if there's no match the mapping is cancelled. Do you want to insert "unconfigured" modern list/library/events web parts when we don't find the needed list/library?
We found the Current classic site publishing page contains a library/list web part. During page conversion the page will create in a separate site collection. If the library/lists are not present in the target site, the web part is not migrated. In this case it was a simple .pdf file held in a library
Finally, like the idea of the community contribution. Happy to have a go before or after the "David Warner community contribution / Git pull request master class" 😀
Hi @westerdaled ,
About the getting the zones right in the page layout template:
Export-PnPClientSidePageMapping cmdlet...if not you can run Export-PnPClientSidePageMapping -BuiltInPageLayoutMapping -CustomPageLayoutMapping -Folder c:\temp -Overwrite and compare the generated mapping with yours. Also please share the custom page layout file (the .aspx file) if you're unable to resolve this-LogType File -LogVerbose -LogFolder c:\temp to your cmdlet run) and provide the logs. The logs will tell which mapping was selectedAbout the missing library:
Hi @jansenbe
I think you have alluded as where our issue is
Export-PnPClientSidePageMapping -BuiltInWebPartMapping -PublishingPage $sourcePublishingPage -BuiltInPageLayoutMapping -CustomPageLayoutMapping -Overwrite -Folder $workingFolder -Logging
[Page Layout Analyser] Generating mapping for
Two Zone Header–One Sidebar Zonelayout
The generated customapagelayoutmapping-testpage.xml, doesn't have the web part zones and ids which have in your test file. Btw I have a colleague in India who is also trying these commands against our live intranet site so that we rule out any platform issues. please see attached custompagelayout (.asxpx saved as .txt)
Two Zone Header–One Sidebar Zone.txt
Whist we wait your thoughts we're going test out other articles with different custom page layouts.

Hi @westerdaled ,
In the page layout you've shared the webpart zone names are 9d0a4d08e9ad42c3a8b3063a06451806, x5a37f6775a2f40509c87954de3686063, xc9893e9f4d734cc9ad8846c0cd8075d1,...
So in your web part mapping file you'll need to use these names to identify the zones. You would have for example something like this:
<WebPartZones>
<WebPartZone Row="1" Column="1" ZoneId="9d0a4d08e9ad42c3a8b3063a06451806" ZoneIndex="0" />
<WebPartZone Row="1" Column="2" Order="1" ZoneId="x5a37f6775a2f40509c87954de3686063" ZoneIndex="0" />
<WebPartZone Row="1" Column="2" Order="2" ZoneId="xc9893e9f4d734cc9ad8846c0cd8075d1" ZoneIndex="0" />
</WebPartZones>
If you're still stuck after this then send me a note on [email protected] to setup a troubleshooting meeting.
Hi @jansenbe You have confused me a bit when you mentioned the web part mapping file.
I have added the web part zones to the generated custom layout but it is not being accepted as a parameter - we had this same issue earlier today
ConvertTo-PnPClientSidePage -PublishingPage -Identity $sourcePublishingPage -PageLayoutMapping .\custompagelayoutmapping-260d45e9-6139-4c59-9640-afc736a62e93-business-travel-and-expenses-policy.xml -WebPartMappingFile .\webpartmapping.xml -Overwrite -TargetWebUrl $targetModernSite -LogType File -LogVerbose -LogFolder $workingFolder
ConvertTo-PnPClientSidePage : Provided pagelayout mapping file .\custompagelayoutmapping-260d45e9-6139-4c59-9640-afc736a62e93-business-travel-and-expenses-policy.xml does not exist
At line:1 char:1
- ConvertTo-PnPClientSidePage -PublishingPage -Identity $sourcePublishi ..
it does of course and I even use intellisense to pick it as argument . The debug session looks like the way , thanks for the offer.
Hi @westerdaled,
My bad, I indeed meant page layout mapping file instead of web part mapping file. Please specify a full path to both XML files, that should work.
@jansenbe
A bit of a progress update. My wily colleague spotted an error in the logs regarding not detecting the layout:
So the layout name
<PageLayout Name="Two Zone Header–One Sidebar Zone" AssociatedContentType="" PageLayoutTemplate="AutoDetect" PageHeader="Custom">
.... needs to be changed to
<PageLayout Name="Two%20Zone%20Header–One%20Sidebar%20Zone" AssociatedContentType="" PageLayoutTemplate="AutoDetect" PageHeader="Custom">
Then we get the two zones in our target communication site page.
The focus is now
Let's then close this issue as the original question has been answered. Feel free to open a new issue if you encounter other issues.