What does Page Transformation do?
Page Transformation converts the page into a modern experience by creating modern pages in the library. But not all the functionalities are migrated as is; we need to re-write those functionalities with SPFx framework.
How to use it?
- PnP PowerShell https://akka.ms/sppnp-powershell
- .NET development https://nuget.org
- UI Integration https://aka.ms/sppnp-pagetransformationui
Sharepoint Page Transformation Using PowerShell
In this article, we are going to see the process of transforming the classic wiki web part pages into modern pages in a different scenario by using PnP PowerShell.
ConvertTo-PnPClientSidePage
Converts a classic page (wiki or web part page) into a Client-Side Page
We have a simple classic page. Now, we will see how to convert this page into Modern page using PnP command.
Execute the following PnP command. This will help in converting to Modern Page.
ConvertTo-PnPClientSidePage -Identity "somepage.aspx" -Overwrite
Converted site is in the Modern experience.
Page Swapping
We have created a simple classic NewsWikipage, now we are going to convert it into a modern page by retaining the old page as it is in Sitepage library.
Step 1
We are going to connect to Sharepoint online site by using the pnp command.
Step 2
TakeSourcePageName takes its name from the previous classic page. Classic page gets renamed to previous-<Page>.aspx
Powershell - ConvertTo-PnPClientSidePage -Identity "somepage.aspx" –Overwrite -TakeSourcePageName
Now the wiki page is looking like this
New page created will be available in the SitePage library.
Page Logging
We can get the details of logging during the Page Transformation that will help to understand what happened during the transformation of the page.
Now, we are going to see how to log details in Sharepoint by using PnP command
PowerShell - ConvertTo-PnPClientSidePage -Identity "somepage.aspx" –Overwrite –LogType Sharepoint
Once the command is executed successfully, open Site Page Library. A new folder will be created with the name “Transformation-Reports”. A Page-Transformation-Report will be created where it includes the Modernization summary report like Source Page, TargetUrl….
Metadata and permission
We can also Convert a wiki page to a client-side page, including the copying of the page metadata.
Real world pages often have custom metadata defined, sometimes they also have custom permission defined. Now we will see how to transform these pages.
We can also skip the Item level permission if any.
Hope you learned something in this article. Stay tuned for the next article where we are going to learn to transform the Publishing pages using PnP PowerShell.