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
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.
- Jan 03, 2017
That is expected behaviour.To get the content types and fields you will bneed to export the root site within your site collection and then apply that to the rootsite of the site collection where you want these contenttypes to appear.
- 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.