[x] Page Transformation: Error during the use of page transformation from PnP PowerShell
Is to have publishing pages converted from the source site to the target site
The script run successfully without any error but pages haven't converted to modern pages in the target site
Run this script Convert-PublishingPages.ps1
Hi @mohammadamer ,
Please provide some more details:
Would recommend to try to convert 1 page to start by manually calling ConvertTo-PnPPage (or ConvertTo-PnPClientSidePage if you're using an older version of PnP PowerShell) and see what that gives. Here's a sample cmdlet execution that transforms a single publishing page into a modern page in another site:
ConvertTo-PnPClientSidePage -PublishingPage -Identity somepage.aspx -Overwrite -TargetWebUrl https://contoso.sharepoint.com/sites/targetsite -KeepPageCreationModificationInformation -PostAsNews -LogType File -LogVerbose -LogFolder c:\temp
If that throws an error please share the produced log. If not please capture a Fiddler trace and share it.
Hi Bert,
I am using PnP.PowerShell
PnP.PowerShell 1.2.14
PnP.PowerShell 1.2.0
SPO
SharePoint Online Publishing Site to SharePoint Online Communication Site
I'll try a single page as per your recommendation. I'll update you.
Thanks for your quick response
Hi Bert,
I would say that the above line of power shell worked convert very simple classic page to Modern Page.
But when it comes to Convert-PublishingPages.ps1, I am trying to make it work :)
Some more details
When I run (Convert-PublishingPages.ps1) using -UseWebLogin , nothing happened. I figured out that it was permission issue although I have rights on both sites.
When I run (Convert-PublishingPages.ps1) using Azure AD APP , For some reasons it can't find the library name in the source although the library is present in the source.
Get-PnPListItem : No list found with id, title or url 'Page Library Name'
Well, the key thing is that you can achieve what you need via calling ConvertTo-PnPPage (or ConvertTo-PnPClientSidePage which is the old name)...based upon above feedback that seems to be the case. What the Convert-PublishingPages.ps1 script does is loop over the pages in the source site and call ConvertTo-PnPPage...so to check things I would recommend the following:
Get-PnPListItem -List "Pages" -Connection $sourceConnection -PageSize 500 does list the pages you want to get converted. Note that if your site is localized the list might not be named Pages but something else.Closing this one and continuing this via #167