pnp / pnpframework

PnP Framework is a .NET library targeting Microsoft 365 containing the PnP Provisioning engine and a ton of other useful extensions
https://pnp.github.io/pnpframework/
MIT License
211 stars 145 forks source link

Transform SharePoint Classic Pages to Modern Pages - Images appears only in EDIT mode #1092

Open GopalTiwari007 opened 1 week ago

GopalTiwari007 commented 1 week ago

Hello

I have been working to convert SharePoint 2013 classic publishing page to SharePoint online Modern pages. I am following below article and using PnP framework to transform the pages.

https://pnp.github.io/script-samples/modernize-classic-pages-from-publishing-sites/README.html?tabs=pnpps

I have tried two approaches Approach # 1. Directly converting the pages from on-prem to SPO modern pages using below sample code: ConvertTo-PnPClientSidePage -Identity "Challenging-Spirit-on-Display-at-Convention.aspx" -PublishingPage -TargetConnection $spOnlineConn -Connection $sp13Conn -Overwrite -PageLayoutMapping "C:\temp\Demo\525\custompagelayoutmapping-0c687c95-c46f-48a8-84c3-1e4b53244eb6-challenging-spirit-on-display-at-convention.xml" -KeepPageCreationModificationInformation -DisablePageComments -LogType File ` -LogFolder "C:\Temp\Logs\"

With this approach, I am able to convert the classic page to Modern page but Images in transformed pages only visible in EDIT mode, they don't show up in normal view mode.

Approach # 2 I used third party migration tool "ShareGate" to copy classic page from on-prem environment to SharePoint online site's PAGES (classic pages) library. Then, used PnP script to transform the page to Modern page using below code: ConvertTo-PnPClientSidePage -Identity "Challenging-Spirit-on-Display-at-Convention.aspx" -PublishingPage -TargetConnection $spOnlineConn -Overwrite -KeepPageCreationModificationInformation -TargetPageName "SPOPnP_Challenging-Spirit-on-Display-at-Convention.aspx" -TargetWebUrl $TargetWebURL -DisablePageComments -LogType File -LogFolder "C:\Temp\Logs\"

with this approach, Images appear properly in VIEW mode, but the moment I go to EDIT mode, all images disappear from the page.

Source site has "Content Editor Web part" which contains text and Images in the page. Content Editor web part also uses "HTML Table" to display the images in tabular format.

So, In my case, both approaches (Direct migration from on-prem to SPO, Using Third Party Migration tool ShareGate), both does not seem to be working.

Any help will be appreciated.

GopalTiwari007 commented 1 day ago

@pkbullock @VesaJuvonen Paul, Vesa, any help will be greatly appreciated. Is it a bug with PnP Transformation code or a usage error on my part? I have to migrated thousands of pages from On-Prem SP 2013 to SPO Modern pages and desperately looking for a solution to this.