Forum Discussion
Provision sub site using PnP Site provisioning schema?
if you are using PowerShell then after you connect to your site collection you can specify the web that you want to provision your template to.
Apply-SPOProvisioninTemplate -web subweburl -Path c:\temp\template.xml
- nitinkumar kakuldeDec 30, 2016Copper Contributor
I did all try using the sub site structure migration using your mentioned commands for our project. Its only migrate the Site collection level structure not sub site level structure.
What I observe is subsite level structure migration shows things to be done in PowerShell log trace but actually nothing get created in the targeted subsite.
- Martin SegelfeldtSep 29, 2016Copper Contributor
Then i need to call Apply-SPOProvisioninTemplate multiple times and split this up in multiple xml files.
Example
Apply-SPOProvisioninTemplate -web subweburl1 -Path c:\temp\template1.xml
Apply-SPOProvisioninTemplate -web subweburl2 -Path c:\temp\template2.xml
Apply-SPOProvisioninTemplate -web subweburl3 -Path c:\temp\template3.xml
Apply-SPOProvisioninTemplate -web subweburl4 -Path c:\temp\template4.xml
What i would like to do is
Apply-SPOProvisioninTemplate -web rootsite -Path c:\temp\rootsite.xml
And rootsite.xml contains something like
<SubSites>
<SubSite url="subweburl1">
//Stuff here :)
</SubSite>
<SubSite url="subweburl2">
//Stuff here :)
</SubSite>
<SubSite url="subweburl3">
//Stuff here :)
</SubSite>
<SubSite url="subweburl4">
//Stuff here :)
</SubSite>
</SubSites>
- nitinkumar kakuldeDec 30, 2016Copper Contributor
Not deploy or not working subsite to subsite migration of the Site structure.
- nitinkumar kakuldeJan 02, 2017Copper Contributor
I have tried all the way for migrating sub site CT from one tenant to another tenant. CT which are created at subsite levels and columns which are taken in the CT which are from the site collection levels not getting exported even. Import is failed too.
We have migrated SC level all CT and site structure and then migrated sub site level structure where CT, Site columns are missing from the exported xml file.
- Sep 29, 2016
that would be a nice idea but that's not how the PnP Provisioing engine works.
I created an addtional xml structure that lists out all the sites I want to deploy. Then a powerShewll script reads this xml and provisions all the sites by calling the Apply-SPOProvisioningTemplate multiple times.