question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Wiki Page Internal Links Missing "SitePages"

See original GitHub issue

Problem 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:open
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
sympmarccommented, Mar 5, 2022

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.

1reaction
sympmarccommented, Mar 4, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wiki pages containing internal links does not rend...
Hi, I decided to update my old Alfresco community server from 5.0.d to 7.1.0 community (docker container). Since the update, the wiki pages...
Read more >
VSTS Wiki link to different page with anchors does not work
I think that VSTS is not correctly expanding links to other pages within the wiki. I am using Markdown Wiki but with full...
Read more >
Wiki pages in subdirectories fail to render
Since updating to our docker based GitLab instance to 14.10.2 all wiki pages that are not at the root of the wiki [1]...
Read more >
Unable to view wiki pages in UI that contain empty spaces
Since GitLab version 15.5, it is no longer possible to preview the wiki pages that have a space ( ) in their names....
Read more >
Microsoft Teams WIKI copy link to Page - Section not working
The 'Copy link' on a Section within a WIKI Page in Microsoft Teams just brings you somewhere in an arbitrary Section within the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found