Sep 29 2016 03:37 AM
I am trying to provision a site hierarchy using the PnP site provisioning engine and an .xml file.
One thing I am having a bit of a problem with is how do I provision sub sites? I want to provision the following example of a site structure
//Martin
Sep 29 2016 04:20 AM
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
Sep 29 2016 05:21 AM - edited Sep 29 2016 05:21 AM
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>
Sep 29 2016 05:24 AM
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.
Sep 30 2016 05:04 AM
Dec 29 2016 11:57 PM
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.
Dec 29 2016 11:59 PM
Not deploy or not working subsite to subsite migration of the Site structure.
Jan 01 2017 11:36 PM
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 01:03 AM
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.
Nov 28 2017 10:03 AM
There is a flag to allow for ContentTypes to be provisioned to sub webs (-ProvisionContentTypesToSubWebs). Is that feature depreciated?
Nov 28 2017 12:32 PM