pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
990 stars 663 forks source link

Import-PnPTermGroupFromXml : The provided template is not valid! #2040

Closed mahesh2005 closed 5 years ago

mahesh2005 commented 5 years ago

I am using the PNP Module in SP 2016 (16.0.4600.1000) on prem environment.

I was able to successfully export my term groups using export-pnptermgroupfromxml command in farm A.

Command used for Exporting: Export-PnPTermGroupToXml -FullTemplate -Out "FolderPath\Output.xml"

When i tried to import the XML file in farm B(same configuration as farm A) using Import-PnPTermGroupFromXml -Path "C:\folder\file.xml i got the following error: Import-PnPTermGroupFromXml : The provided template is not valid!

First few lines of the export file look like this: `<?xml version="1.0"?>

` I tried changing the schema to 2018/05 as suggested in an another post, but that did not resolve this error. ### Which version of the PnP-PowerShell Cmdlets are you using? PnP PowerShell for SharePoint 2016 ### What is the version of the Cmdlet module you are running? Version 3.8.1904.0 ### How did you install the PnP-PowerShell Cmdlets? Installed through the PowerShell Gallery with Install-Module
erwinvanhunen commented 5 years ago

Hi! would you be able to provide with the exact cmdlet parameters you used to export and import them?

mahesh2005 commented 5 years ago

@erwinvanhunen I have updated the Issue with the command i used for exporting the term store. Basically i used Export-PnPTermGroupToXml -FullTemplate -Out "FolderPath\Output.xml" and Import-PnPTermGroupFromXml -Path "FolderPath\Output.xml

heinrich-ulbricht commented 5 years ago

The error I get when attaching the debugger is The element 'AdditionalAdministrators' in namespace 'http://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema' has incomplete content. List of possible elements expected: 'User' in namespace 'http://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema'. So this is the same as https://github.com/SharePoint/PnP-Sites-Core/issues/2188

Internally a template is created using the latest schema. The version in the template file is not respected. This is the second instance of such code I come across. (Shouldn't the format of the template be respected and maintained? But this is another topic.)

So fixing the linked issue should fix this error as well.

ghost commented 5 years ago

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.

ghost commented 5 years ago

Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently.

petepuu commented 4 years ago

Hi,

I am getting similar error with Import-PnPTermGroupFromXml in SPO using version 3.19.2003.0. Also tested with FullTemplate and with adding XML declaration element manually in the beginning of file but still same error -> "Import-PnPTermGroupFromXml : Data at the root level is invalid. Line 1, position 1."

image image image