Nov 07 2016 12:55 PM - edited Nov 07 2016 12:57 PM
I am trying to use the provisioning engine from console app. My template is a site collection with few sub sites. When I export my xml I am only seeing the information for the site collection and not seeing the subsites. Is there a limitation or is there a way to include subsites as part of the template? Thank you so much for your help.
Thanks,
Vijay
Nov 07 2016 10:31 PM
Nov 08 2016 01:24 AM
Solution
I agree with @Deleted. The reason why you would need to keep your root site is that site columns and content types should live within the root site. Therefore you will find quite often tthat when you update the subsite's template you will also need to reapply the root site as columns/content types could have chnaged.
Nov 08 2016 06:38 AM
Thank you so much that is what I thought but want to make sure the approach is correct and also not missing information that is already out there.
Thanks,
Vijay
@Pieter Veenstra wrote:
I agree with @Deleted. The reason why you would need to keep your root site is that site columns and content types should live within the root site. Therefore you will find quite often tthat when you update the subsite's template you will also need to reapply the root site as columns/content types could have chnaged.
Dec 29 2016 10:48 PM
Hi Team,
I am able to migrate the site structure of Site collection to another site collection of other teanant in SharePOint online but same is not working for sub site to sub site misite structure migration using below PnP Get and Apply provisiontemplate command
Connect-SPOnline -Url https://domainName.sharepoint.com/Sites/TT1/SubSite -Credential DEV #(Get-Credential)
Apply-SPOProvisioningTemplate -Path .\RetailerExtranetQARootSiteStructureToTSW_2.xml
In PowerShell it shows logs that lists and CT created but actually its not create anything at subsite level.
Site collection level migration working perfect by executinge below command
Connect-SPOnline -Url https://domainName.sharepoint.com/Sites/TT1 -Credential DEV #(Get-Credential)
Apply-SPOProvisioningTemplate -Path .\SiteCollectionLevelStructure.xml
Your help would be appreciated. Please let me know as soon as possible where is the problem.
Jan 03 2017 02:28 AM
First you need to get template from the Site collection level and then appy the same temaplte to the another site collection or any new tenant. Once it done create sub sites by using below script from the command prompt.
# Reports subsite
Add-Type -Path "C:\Users\navya\Desktop\Retailer Scripts\dlls\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Users\navya\Desktop\Retailer Scripts\dlls\Microsoft.SharePoint.Client.Runtime.dll"
$siteUrl = “https://domainname.sharepoint.com/sites/Subsite”
$username = "admin@domainname.onmicrosoft.com"
$password = Read-Host -Prompt "Password" -AsSecureString
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
$ctx.Credentials = $credentials
$webCreationInformation = New-Object Microsoft.SharePoint.Client.WebCreationInformation
$webCreationInformation.Url = "Subsite" //you decide what are sub sites you have and execute by changing this information
$webCreationInformation.Title = "Subsite" //you decide what are sub sites you have and execute by changing this information
$webCreationInformation.WebTemplate = "BLANKINTERNET#2" //You decide what should be your base tempate
$newWeb = $ctx.Web.Webs.Add($webCreationInformation)
$ctx.Load($newWeb)
$ctx.ExecuteQuery()
Write-Host "Title" $newWeb.Title
Now once you create sub sites at targeted tenant, you have to again use get pnp provision temlate and apply provision temaplte by using powershell from tenant to tenant sub site structure migration.
This is how I observed that PnP provision works and we did very successfully work here
Thanks,
Nitinkumar
Nov 08 2016 01:24 AM
Solution
I agree with @Deleted. The reason why you would need to keep your root site is that site columns and content types should live within the root site. Therefore you will find quite often tthat when you update the subsite's template you will also need to reapply the root site as columns/content types could have chnaged.