Closed ddbardsley closed 4 years ago
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Hello, would someone please respond to this issue. We are trying to provision publishing sites but the Navigation items do not provision to the new sites.
I have discovered the root cause of the problem. The issue is that the templates acquired from the pages within the "Pages" library (not to be confused with the "SitePages" library) via the "Get-PnPProvisioningTemplate" PowerShell API contain property keys which cause the "Apply-PnPProvisioningTemplate" PowerShell API provisioning process to fail with the following error message:
Apply-PnPProvisioningTemplate : Input string was not in a correct format
Since the pages fail to provision then the Navigation also fails because the navigation relies on these pages being successfully provisioned.
The problematic pnp:File property keys are:
AccessPolicy BSN _ListSchemaVersion _Dirty _Parsable _StubFile _VirusStatus _VirusVendorID _CheckinComment
I remove these property keys from each of the pnp:Files properties within the template (via the Read-PnPProvisioningTemplate PowerShell API) and the provisioning process successfully completes without an error.
Please let me know why these property keys are problematic and please let me know if there is way to exclude these property keys when invoking the Get-PnPProvisioningTemplate for the site pages found within the "Pages" library.
We fixed this with commit: https://github.com/pnp/PnP-Sites-Core/commit/81ae1a1cae02e007afe5d9f01b71cd8647f0af32
The fix will be available in the July 2020 release.
Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:
Apply-SPOProvisioningTemplate
orGet-SPOProvisioningTemplate
? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/officedev/PnP-Sites-Core/issues.Reporting an Issue or Missing Feature
I am use the following PowerShell command to acquire the site information which contains the pnp:Navigation tags within the XML template:
Get-PnPProvisioningTemplate -IncludeAllClientSidePages -Out $siteTemplateFile
I then use the following, prior to invoked the Get-PnPProvisioningTemplate, so that we Disable NoScript (since scripting is necessary for Navigation) on the tenant site. This is to ensure that we can provision the navigation settings.
Set-PnPTenantSite -Url $siteCollection -NoScriptSite:$false
And then I run the following to provision the site using the XML site template acquired from the Get-PnPProvisioningTemplate
Apply-PnPProvisioningTemplate -Web $web -Path $templateFile -OverwriteSystemPropertyBagValues -ClearNavigation -IgnoreDuplicateDataRowErrors
Here is the pnp:Navigation settings from the template file