[BUG] Wiki Page Internal Links Missing "SitePages"
See original GitHub issueProblem Area
[x] Page Transformation: Error during the use of page transformation from PnP PowerShell [ ] Page Transformation: Error during the use of page transformation from .Net [ ] Page Transformation: Page is not looking correct after transformation [ ] Modernization Scanner: something went wrong…
Expected or Desired Behavior
I’m converting a Wiki library in SharePoint 2010 to SharePoint Online. Because I’m converting from SP2010, I’m using SharePointPnPPowerShell v 3.29.2101.0, which as I understand it is the last version which works with SP2010. The files convert beautifully, though they are placed into a folder in the Site Pages library, as mentioned in pnp/pnpframework#626. The pages also aren’t published in the destination.
Observed Behavior
The bug is with the links inside the pages. They aren’t fixed up properly. The pages end up in a folder called Wiki, as that is the name of the source Wiki library.
- Home.aspx is copied to: https://[tenant].sharepoint.com/sites/apps_CCR/SitePages/Wiki/Home.aspx
- CCR Regional Expert List.aspx is copied to: https://[tenant].sharepoint.com/sites/apps_CCR/SitePages/Wiki/CCR%20Regional%20Expert%20List.aspx
- etc.
So, the pages land in appropriate locations. But the lniks insode the pages are missing the SitePages part of the URLs:
- Within CCR Regional Expert List.aspx , the link to Home.aspx is: https://[tenant].sharepoint.com/sites/apps_CCR/Wiki/Home.aspx
- Within Home.aspx, the link to CCR Regional Expert List.aspx is: https://[tenant].sharepoint.com/sites/apps_CCR/Wiki/CCR%20Regional%20Expert%20List.aspx
- etc.
Steps to Reproduce
My PowerShell looks something like below. I’ve tried every combination of the property settings (-Target*) I can think of to remedy this. I’ve also had @ToddKlindt take a look to make sure I’m not doing something dumb. Am I holding it wrong?
Import-Module -Name SharePointPnPPowerShellOnline
$sourceSiteUrl = "sourceSiteUrl"
$targetSiteUrl = "targetSiteUrl"
$sourceLibrary = "Wiki"
$sourceConnection = Connect-PnPOnline -Url $sourceSiteUrl -ReturnConnection -Credential (Get-StoredCredential -Target "Marc")
$targetConnection = Connect-PnPOnline -Url $targetSiteUrl -ReturnConnection -UseWebLogin
$wikiPages = Get-PnPListItem -Connection $sourceConnection -List $sourceLibrary -PageSize 500
$filteredWikiPages = $wikiPages | Select-Object -First 5
foreach ($page in $filteredWikiPages) {
$targetPageName = $page.FieldValues.FileLeafRef
Write-Host "Writing page <$($page.FieldValues.FileLeafRef)> to <$($targetPageName)>"
ConvertTo-PnPClientSidePage `
-Connection $sourceConnection `
-Library $sourceLibrary `
-Identity $page.FieldValues["ID"] `
-Overwrite `
-CopyPageMetadata `
-TargetConnection $targetConnection `
-TargetPageName $targetPageName `
-LogType File -LogFolder .
}
p.s. Convert-WikiAndWebPartPages.ps1 doesn’t seem to be all that tuned for Wiki pages. Most Wikis in older on premises versions are going to be in a separate library from SitePages.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
FYI - I decided to migrate the Wiki into SPO with ShareGate. Now I can run the page transformation on it with up-to-date PnP.PowerShell. I think this approach will work.
Yeah, I know I’m in oldster land. I have to be for SP2010, right?
I have played with those in every combination I can think of. I can make the pages land in a different folder in SitePages, but I can’t seem to have any effect on the internal URLs.