Skip to content

Commit cad3546

Browse files
committed
Doc updates now that modernization moved over to pnp framework including support for on-premises as transformation source
1 parent 3e1d3a3 commit cad3546

13 files changed

+133
-390
lines changed

docs/transform/modernize-userinterface-site-pages-approach.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Understanding in-place page transformation versus cross-site page transformation
33
description: Explains the differences between in-place and cross-site page transformation and when to use which one
4-
ms.date: 02/06/2020
4+
ms.date: 02/11/2021
55
ms.prod: sharepoint
66
localization_priority: Priority
77
---
@@ -18,19 +18,19 @@ Overall in-place transformation will give you the best results as there's no ris
1818

1919
## Cross-site transformation
2020

21-
Cross site page transformation will read the classic page (e.g. mypage.aspx) and will then create the modern page (e.g. mypage.aspx) in **another** site collection. Typical use case of cross-site transformation is for transforming page types which cannot be used together with modern pages in the same site: this applies to classic publishing pages, blog pages and Delve blog pages. Another important use case is when you transform on-premises pages: given page transformation only supports SharePoint Online as the target platform for modern pages, this means these transformations are cross-site page transformations.
21+
Cross site page transformation will read the classic page (e.g. mypage.aspx) and will then create the modern page (e.g. mypage.aspx) in **another** site collection. Typical use case of cross-site transformation is for transforming page types which cannot be used together with modern pages in the same site: this applies to classic publishing pages and blog pages. Another important use case is when you transform on-premises pages: given page transformation only supports SharePoint Online as the target platform for modern pages, this means these transformations are cross-site page transformations.
2222

2323
## In-place transformation versus cross-site transformation
2424

2525
Below table provides an overview on whether you need to use in-place transformation, cross-site transformation or whether you can choose.
2626

27-
Source\Type | Wiki page | Web part page | Publishing page | Blog page | Delve blog page
28-
------------------|-----------|---------------|-----------------|-----------|----------------
29-
SharePoint Online | In-place (preferred) or cross-site | In-place (preferred) or cross-site | Cross-site | Cross-site | Cross-site
30-
SharePoint 2019 | Cross-site | Cross-site | Cross-site | Cross-site | N/A
31-
SharePoint 2016 | Cross-site | Cross-site | Cross-site | Cross-site | N/A
32-
SharePoint 2013 | Cross-site | Cross-site | Cross-site | Cross-site | N/A
33-
SharePoint 2010 | Cross-site | Cross-site | Cross-site | Cross-site | N/A
27+
Source\Type | Wiki page | Web part page | Publishing page | Blog page
28+
------------------|-----------|---------------|-----------------|-----------
29+
SharePoint Online | In-place (preferred) or cross-site | In-place (preferred) or cross-site | Cross-site | Cross-site
30+
SharePoint 2019 | Cross-site | Cross-site | Cross-site | Cross-site
31+
SharePoint 2016 | Cross-site | Cross-site | Cross-site | Cross-site
32+
SharePoint 2013 | Cross-site | Cross-site | Cross-site | Cross-site
33+
SharePoint 2010 | Cross-site | Cross-site | Cross-site | Cross-site
3434

3535
## Limitations on allowed target sites during a cross-site transformation
3636

docs/transform/modernize-userinterface-site-pages-configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Options to control the page transformation process
33
description: Explains how to configure the page transformation process
4-
ms.date: 03/06/2020
4+
ms.date: 02/11/2021
55
ms.prod: sharepoint
66
localization_priority: Normal
77
---
@@ -11,7 +11,7 @@ localization_priority: Normal
1111
When you use the page transformation framework you do have a lot of control on how the page transformation is done. The model to control this is by specifying the correct configuration as part of the `PageTransformationInformation` instance for wiki and web part pages or a `PublishingPageTransformationInformation` instance for publishing pages. The created transformation instance is what you use to launch page transformation. In this article you'll learn more about the available options.
1212

1313
> [!IMPORTANT]
14-
> The SharePoint PnP Modernization framework is continuously evolving, checkout [the release notes](https://github.com/SharePoint/sp-dev-modernization/tree/master/Tools/SharePoint.Modernization/Modernization%20Framework%20release%20notes.md) to stay up to date on the latest changes. If you encounter problems please file an issue in the [sp-dev-modernization GitHub issue list](https://github.com/SharePoint/sp-dev-modernization/issues).
14+
> SharePoint PnP Modernization is part of the [PnP Framework](https://github.com/pnp/pnpframework) and is continuously evolving, checkout [the release notes](https://github.com/pnp/pnpframework/blob/dev/src/lib/CHANGELOG.md) to stay up to date on the latest changes. If you encounter problems please file an issue in the [PnP Framework GitHub issue list](https://github.com/pnp/pnpframework/issues).
1515
1616
## Overwrite option
1717

docs/transform/modernize-userinterface-site-pages-dotnet.md

Lines changed: 25 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
---
22
title: Transform classic pages to modern pages using .NET
33
description: Explains how to transform classic wiki and web part pages into modern modern pages using the SharePoint .NET
4-
ms.date: 06/05/2020
4+
ms.date: 02/11/2021
55
ms.prod: sharepoint
66
localization_priority: Normal
77
---
88

99
# Transforming to modern site pages using .NET
1010

1111
> [!IMPORTANT]
12-
> The SharePoint PnP Modernization framework is continuously evolving, checkout [the release notes](https://github.com/SharePoint/sp-dev-modernization/tree/master/Tools/SharePoint.Modernization/Modernization%20Framework%20release%20notes.md) to stay up to date on the latest changes. If you encounter problems please file an issue in the [sp-dev-modernization GitHub issue list](https://github.com/SharePoint/sp-dev-modernization/issues).
12+
> SharePoint PnP Modernization is part of the [PnP Framework](https://github.com/pnp/pnpframework) and is continuously evolving, checkout [the release notes](https://github.com/pnp/pnpframework/blob/dev/src/lib/CHANGELOG.md) to stay up to date on the latest changes. If you encounter problems please file an issue in the [PnP Framework GitHub issue list](https://github.com/pnp/pnpframework/issues).
1313
14-
The page transformation engine is built using .NET and is distributed as a [nuget](https://www.nuget.org/packages/SharePointPnPModernizationOnline) package. Once you've added the nuget package you'll see that 2 additional files are added to your solution:
14+
The page transformation engine is built using .NET and is distributed as a [nuget](https://www.nuget.org/packages/PnP.Framework) package. Once you've added the nuget package you'll see that 2 additional files are added to your solution:
1515

1616
![page transformation solution files](media/modernize/pagetransformation_2.png)
1717

1818
> [!Note]
19-
> The minimal .NET Framework version for this solution to work is 4.5.
19+
> The PnP Framework nuget package contains a .NET Standard 2.0 version and a .NET 5.0 version, allowing you to embed page transformation in any .NET project.
2020
2121
The `webpartmapping.xml` and `webpartmapping_latestfrompackage.xml` represent the transformation model that describes how the transformation will happen. You typically will tweak the `webpartmapping.xml` file to your needs by for example adding additional mappings to your own web parts. If you later on install an updated version of the nuget package your `webpartmapping.xml` will not be overwritten by default but the `webpartmapping_latestfrompackage.xml` will be. You can use this latter file to compare the latest out-the-box mapping with your mapping and take over the changes you need.
2222

2323
With the mapping file in place you now can use below snippet (coming from the [Modernization.PageTransformation sample on GitHub](https://github.com/SharePoint/PnP/tree/dev/Samples/Modernization.PageTransformation)) to transform all the pages in a given site:
2424

2525
```csharp
2626
string siteUrl = "https://contoso.sharepoint.com/sites/mytestsite";
27-
string userName = "[email protected]";
28-
AuthenticationManager am = new AuthenticationManager();
29-
using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl, userName, GetSecureString("Password")))
27+
AuthenticationManager am = new AuthenticationManager("<Azure AD client id>", "[email protected]", "Pwd as SecureString");
28+
using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl))
3029
{
3130
var pageTransformator = new PageTransformator(cc);
3231
var pages = cc.Web.GetPages();
@@ -55,7 +54,7 @@ using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl, userNa
5554

5655
## FAQ
5756

58-
### I want to set mapping properties (as of March 2019 release, version 1.0.1903.*)
57+
### I want to set mapping properties
5958

6059
Mapping properties are set to drive mapping behavior (e.g. configure the use of the community script editor). You can configure mapping properties like shown in below sample code:
6160

@@ -73,16 +72,15 @@ pageTransformator.Transform(pti);
7372

7473
Consult the [web part transformation list](modernize-userinterface-site-pages-webparts.md) article to learn more on the possible mapping properties.
7574

76-
### I want to transform pages into another site collection (as of March 2019 release, version 1.0.1903.*)
75+
### I want to transform pages into another site collection
7776

7877
The default transformation behavior is doing an in-place transformation, meaning the modern page is created in the same ___location as the classic page was. You can however also create the modern version of the page in another site collection by providing a client context object for the target site collection.
7978

8079
```csharp
8180
string siteUrl = "https://contoso.sharepoint.com/sites/mytestsite";
8281
string targetSiteUrl = "https://contoso.sharepoint.com/sites/mytargetsite";
83-
string userName = "[email protected]";
84-
AuthenticationManager am = new AuthenticationManager();
85-
using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl, userName, GetSecureString("Password")))
82+
AuthenticationManager am = new AuthenticationManager("<Azure AD client id>", "[email protected]", "Pwd as SecureString");
83+
using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl))
8684
{
8785
using (var ccTarget = cc.Clone(targetSiteUrl))
8886
{
@@ -113,16 +111,15 @@ using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl, userNa
113111
> [!Note]
114112
> Not all web parts lend themselves well for a cross site transfer, check the **Cross site support** column in [web part transformation list](modernize-userinterface-site-pages-webparts.md) to learn more.
115113
116-
### I want to transform publishing pages (as of April 2019 release, version 1.0.1904.*)
114+
### I want to transform publishing pages
117115

118116
Publishing page transformation always will be a cross site transformation as mixing modern pages with publishing pages is unsupported. Below sample shows how all publishing pages starting with an "a" are transformed to modern pages in the https://contoso.sharepoint.com/sites/mycommunicationsite site. This sample also shows how to provide a custom page layout mapping file.
119117

120118
```csharp
121119
string siteUrl = "https://contoso.sharepoint.com/sites/mytestportal";
122120
string targetSiteUrl = "https://contoso.sharepoint.com/sites/mycommunicationsite";
123-
string userName = "[email protected]";
124-
AuthenticationManager am = new AuthenticationManager();
125-
using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl, userName, GetSecureString("Password")))
121+
AuthenticationManager am = new AuthenticationManager("<Azure AD client id>", "[email protected]", "Pwd as SecureString");
122+
using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl))
126123
{
127124
using (var ccTarget = cc.Clone(targetSiteUrl))
128125
{
@@ -153,24 +150,22 @@ using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl, userNa
153150
> [!Note]
154151
> Not all web parts lend themselves well for a cross site transfer, check the **Cross site support** column in [web part transformation list](modernize-userinterface-site-pages-webparts.md) to learn more.
155152
156-
157-
### Read publishing page in on-premises SharePoint and create the modern page in SharePoint Online (as of June 2019 release, version 1.0.1906.*)
153+
### Read publishing page in on-premises SharePoint and create the modern page in SharePoint Online
158154

159155
When you want to bring over your classic on-premises publishing portals you could first move the complete portal from on-premises to a classic portal in SharePoint Online and then do the modernization work. However, often it's easier to directly read the classic publishing page from your SharePoint on-premises portal and create the modern version in SharePoint Online.
160156

161157
```csharp
162158
string siteUrl = "https://sp.contoso.com/sites/myonpremisesportal";
163159
string targetSiteUrl = "https://contoso.sharepoint.com/sites/mycommunicationsite";
164-
string userName = "[email protected]";
165-
AuthenticationManager am = new AuthenticationManager();
160+
AuthenticationManager am = new AuthenticationManager("<Azure AD client id>", "[email protected]", "Pwd as SecureString");
166161

167162
// Setup on-premises client context
168163
using (var cc = new ClientContext(siteUrl))
169164
{
170165
cc.Credentials = CredentialCache.DefaultCredentials;
171166

172167
// Setup SharePoint Online context
173-
using (var ccTarget = am.GetSharePointOnlineAuthenticatedContextTenant(targetSiteUrl, userName, GetSecureString("Password")))
168+
using (var ccTarget = am.GetSharePointOnlineAuthenticatedContextTenant(targetSiteUrl))
174169
{
175170
var pageTransformator = new PublishingPageTransformator(cc, ccTarget, "C:\\temp\\custompagelayoutmapping.xml");
176171

@@ -205,21 +200,19 @@ using (var cc = new ClientContext(siteUrl))
205200
```
206201

207202
> [!NOTE]
208-
> - This feature supports SharePoint 2010, 2013, 2016 and 2019 as source. Target is always SharePoint Online
203+
> - This feature supports SharePoint 2013, 2016 and 2019 as source. Target is always SharePoint Online
209204
> - It's important to run your code on a machine that is able to connect to both the on-premises SharePoint server as the SharePoint Online environment
210-
> - There (currently) is no user mapping feature, hence item level permissions are not copied over from the on-premises publishing page to the SharePoint Online modern page
211205
> - This approach can also be used for page transformation across tenants (whenever that would make sense)
212206
213-
### I want to use the logging features (as of April 2019 release, version 1.0.1904.*)
207+
### I want to use the logging features
214208

215209
By default there are three possible log observers (Console, Markdown and MarkdownToSharePoint). The latter two create an MD based report and put them on disk or in SharePoint as a modern page, whereas the first one simply outputs console messages. Below sample shows how you can use the loggers from .NET:
216210

217211
```csharp
218212
string siteUrl = "https://contoso.sharepoint.com/sites/mytestportal";
219213
string targetSiteUrl = "https://contoso.sharepoint.com/sites/mycommunicationsite";
220-
string userName = "[email protected]";
221-
AuthenticationManager am = new AuthenticationManager();
222-
using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl, userName, GetSecureString("Password")))
214+
AuthenticationManager am = new AuthenticationManager("<Azure AD client id>", "[email protected]", "Pwd as SecureString");
215+
using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl))
223216
{
224217
using (var ccTarget = cc.Clone(targetSiteUrl))
225218
{
@@ -255,59 +248,19 @@ using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl, userNa
255248
}
256249
```
257250

258-
### I choose the "AddPageAcceptBanner" option but don't see the banner web part on the created pages
259-
260-
In order to make the banner webpart work there are 2 requirements that have to be met:
261-
262-
- The banner web part must have been installed in your tenant app catalog
263-
- The banner web part must have been referenced in the used webpartmapping.xml file
264-
265-
#### Installing the banner web part
266-
267-
To install the default banner web part follow these steps:
268-
269-
- Open your tenant app catalog site collection and go to the **Apps for SharePoint** list
270-
- Download the banner web part solution (**sharepointpnp-pagetransformation-client.sppkg**) from the [sp-dev-modernization](https://github.com/SharePoint/sp-dev-modernization/blob/master/Solutions/PageTransformationUI/assets/sharepointpnp-pagetransformation-client.sppkg?raw=true) repository
271-
- Drag and drop the sppkg file in the **Apps for SharePoint** list. Doing so will ask to **make this solution available to all sites in your organization**. Check the box and click on **Deploy**.
272-
273-
> [!NOTE]
274-
> The page banner web part is configured to **not** be visible in the web part picker...so even if you've deployed it to all sites in your tenant it will still not be visible for your users. It can only programmatically be added to a page
275-
276-
#### Checking your webpartmapping.xml file
277-
278-
When the page transformation engine puts the banner web part on a page it gets it's definition from the webpartmapping.xml file. Check if you find a web part of type **SharePointPnP.Modernization.PageAcceptanceBanner** in your mapping file. Below sample shows the default configuration using the default web part uploaded in the previous step.
279-
280-
```xml
281-
<WebPart Type="SharePointPnP.Modernization.PageAcceptanceBanner">
282-
<Properties>
283-
<Property Name="SourcePage" Type="string"/>
284-
<Property Name="TargetPage" Type="string"/>
285-
</Properties>
286-
<Mappings>
287-
<Mapping Default="true" Name="default">
288-
<ClientSideWebPart Type="Custom" ControlId="d462a7c4-b2e1-4e80-867a-7b46d279c161" Order="10" JsonControlData="&#123;&quot;serverProcessedContent&quot;:&#123;&quot;htmlStrings&quot;:&#123;&#125;,&quot;searchablePlainTexts&quot;:&#123;&#125;,&quot;imageSources&quot;:&#123;&#125;,&quot;links&quot;:&#123;&#125;&#125;,&quot;dataVersion&quot;:&quot;1.0&quot;,&quot;properties&quot;:&#123;&quot;description&quot;:&quot;modernizationPageDemo&quot;,&quot;sourcePage&quot;:&quot;{SourcePage}&quot;,&quot;targetPage&quot;:&quot;{TargetPage}&quot;&#125;&#125;"/>
289-
</Mapping>
290-
</Mappings>
291-
</WebPart>
292-
```
293-
294-
> [!NOTE]
295-
> - The default mapping file already contains the correct configuration
296-
> - You can use your own custom banner web part by simply deploying it and then updating the mapping in the used webpartmapping.xml file.
297-
298251
### Modern site pages don't work on the site I want to transform pages in
299252

300253
By default the modern site page capability is enabled on most sites but maybe it was turned off afterwards. If that's the case the [SharePoint Modernization scanner](https://aka.ms/sppnp-modernizationscanner) will tell you which sites have turned of the modern page feature. To remediate this use below sample PnP PowerShell script:
301254

302255
```PowerShell
303-
$minimumVersion = New-Object System.Version("2.24.1803.0")
304-
if (-not (Get-InstalledModule -Name SharePointPnPPowerShellOnline -MinimumVersion $minimumVersion -ErrorAction Ignore))
256+
$minimumVersion = New-Object System.Version("1.3.0")
257+
if (-not (Get-InstalledModule -Name PnP.PowerShell -MinimumVersion $minimumVersion -ErrorAction Ignore))
305258
{
306-
Install-Module SharePointPnPPowerShellOnline -MinimumVersion $minimumVersion -Scope CurrentUser
259+
Install-Module PnP.PowerShell -MinimumVersion $minimumVersion -Scope CurrentUser
307260
}
308-
Import-Module SharePointPnPPowerShellOnline -DisableNameChecking -MinimumVersion $minimumVersion
261+
Import-Module PnP.PowerShell -DisableNameChecking -MinimumVersion $minimumVersion
309262
310-
Connect-PnPOnline -Url "<your web url>"
263+
Connect-PnPOnline -Url "<your web url>" -Interactive
311264
312265
# Enable modern page feature
313266
Enable-PnPFeature -Identity "B6917CB1-93A0-4B97-A84D-7CF49975D4EC" -Scope Web -Force

0 commit comments

Comments
 (0)