Apply-PnPProvisioningTemplate restore data from wrong list

%3CLINGO-SUB%20id%3D%22lingo-sub-888479%22%20slang%3D%22en-US%22%3EApply-PnPProvisioningTemplate%20restore%20data%20from%20wrong%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-888479%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20using%20the%20latest%20release%20of%20PnP%20PowerShell%20for%20SharePoint%20Online.%3CBR%20%2F%3EI'm%20also%20creating%20a%20Provisioning%20Template%20using%20this%20command%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3EGet-PnPProvisioningTemplate%20-Out%20%22C%3A%5Ctemplates%5Cmylist.pnp%22%20-ListsToExtract%20%22ListName%22%20-Connection%20%24sourceConnection%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20command%20creates%20a%20.pnp%20file%20correctly.%3C%2FP%3E%3CP%3EThen%20I'm%20trying%20to%20restore%20template%20to%20another%20SharePoint%20site%20with%20this%20command%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3EApply-PnPProvisioningTemplate%20-Path%20%22C%3A%5Ctemplates%5Cmylist.pnp%22%20-ClearNavigation%20-Connection%20%24targetConnection%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EHere's%20where%20happen%20a%20weird%20thing%3A%20the%20list%20is%20created%20with%20correct%20name%2C%20but%20columns%20and%20data%20in%20it%20are%20from%20another%20list%20(that%20is%20in%20the%20parent%20SharePoint%20site%20and%20that%20was%20not%20extracted%20before).%20So%20at%20the%20and%20the%20command%20fails%20with%20an%20error.%20The%20other%20weird%20thing%20is%20that%20I'm%20not%20using%20commands%20to%20add%20data%20to%20.pnp%20file.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20also%20tried%20creating%20a%20.xml%20file.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20a%20known%20issue%20with%20this%20command%20or%20am%20I%20doing%20something%20wrong%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-888479%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Contributor

I'm using the latest release of PnP PowerShell for SharePoint Online.
I'm also creating a Provisioning Template using this command:

 

Get-PnPProvisioningTemplate -Out "C:\templates\mylist.pnp" -ListsToExtract "ListName" -Connection $sourceConnection

 

This command creates a .pnp file correctly.

Then I'm trying to restore template to another SharePoint site with this command:

 

Apply-PnPProvisioningTemplate -Path "C:\templates\mylist.pnp" -ClearNavigation -Connection $targetConnection

 


Here's where happen a weird thing: the list is created with correct name, but columns and data in it are from another list (that is in the parent SharePoint site and that was not extracted before). So at the and the command fails with an error. The other weird thing is that I'm not using commands to add data to .pnp file.

 

I've also tried creating a .xml file.

 

Is a known issue with this command or am I doing something wrong?

0 Replies