Nov 30 2021 12:24 PM
Hi,
I have used PowerShell many times to export a SharePoint site and load to a new site.
However I am now getting the following error message.
get-pnpsitetemplate : server relative urls must start with spweb.serverrelativeurl
The only change I have made was to rename the site and to change the location address of the site in SharePoint Admin, all was confirmed as good and the site works as expected with the name and address. But trying to export now delivers the error message.
The script is as follows xxxx to protect the guilty.
$url = "https://xxxxx.sharepoint.com/sites/CustomerPortal"
Connect-PnPOnline -Url $url -Interactive
Get-PnPSiteTemplate -Configuration "C:\xxxx\xxxxxx\config.json" -Out "C:\xxxxx\xxxxx\Template.xml"
Disconnect-PnPOnline
the config.json looks like this.
{
"$Schema": "https://aka.ms/sppnp-configuration-schema",
"handlers": [
"Lists",
"WebSettings",
"Pages",
"Fields",
"Navigation",
"Files",
"Theme",
"SiteHeader",
"SiteFooter"
],
"pages": {
"excludeAuthorInformation": true,
"includeAllClientSidePages": true
},
"lists": {
"lists": [
{
"includeItems": true,
"title": "Events"
},
{
"includeItems": true,
"title": "Photo Gallery"
},
{
"includeItems": true,
"title": "Documents"
}
]
},
"navigation": {
"removeExistingNodes": true
},
"persistAssetFiles": true,
"siteSecurity": {"includeSiteGroups": false}
Is there a line I can add to the config.json that will handle the problem or do I need to add a line to the script?
Thanks so much in advance.
Banging head.
Dec 27 2022 03:45 AM
I am also facing the issue
Jun 28 2023 02:52 PM
Any news on this? same issue here too.