Some ideas for future url rewrite improvements:
Some thoughts as well:
Thanks for the feedback @pkbullock!
Some comments:
Move to July release, to be handled together with user mapping (#161).
Maybe align with https://docs.microsoft.com/en-us/sharepointmigration/create-a-user-mapping-file-for-data-content-migration as a model
Could we use their code? Shame that tool isn't open source, would be easier to include/extend.
@pkbullock / @MartinHatch / others: I've been running over the issue list and cleaning up some of the issues. When it comes to URL mapping improvements I would like to understand what your key requirements are here...the current mapping will work as described below and I'm wondering what we really need vs what woudl be nice to have:
@jansenbe so for me the ability replace an existing URL with a new one via a mapping e.g. where client has used summary links web parts to refer to other pages inside the intranet.
Whilst it wouldn't necessary for the tool to detect the new location of the page, if I had a (another) mapping file, or even part of the web part mapping file, a list of Old Locations and New Locations (added by me/SME), that if matched would replace during transform.
The pages I wish to transform is highly selective, so I will know ahead of time what the old/new locations are for pages (some will be new e.g. not transformed).
Simple URL mapping configuration committed: provide a CSV file without header listing source and target values and these will be handled. The custom URL mapping happens before the default, so if the default mapping is not desired one could add custom mapping for those as well. Closing this issue, let's open new ones to further define improvements/fixes that are still needed.
Awesome stuff!
@pkbullock : PowerShell usage is like this (also added verbose logging so you can see in logs which url's are rewritten)
ConvertTo-PnPClientSidePage -PublishingPage -Identity url_2 -Overwrite -TargetWebUrl https://bertonline.sharepoint.com/sites/ModernizationTarget -LogType File -LogVerbose -LogFolder "c:\temp" -UrlMappingFile "C:\github\sp-dev-modernization\Tools\SharePoint.Modernization\SharePointPnP.Modernization.Framework\Samples\urlmapping_sample.csv"