Provision SharePoint sites from a template, for dummies #314
-
Hi! I have read everything linked here: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-remote-provisioning but that does not really help me either.. I feel like I have followed every link on the microsoft docs, and here on GitHub, but at the end I always end up in the same place. And nowhere (that I can find) seems to describe this step by step on a beginners level. I started to follow this article too, https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/provisioning-console-application-sample but as a front-end developer I'm not very comfortable with .NET , but if this is the best solution to use then I will learn what I have to to make it work. Can anyone point me in the right direction please? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! Yes, Get-PnPProvisioningTemplate has been renamed since 1.0 of the new PnP PowerShell: it's now called Get-PnPSiteTemplate. Same functionality, same parameters. The flow is relatively simple (but you might have to tweak the resulting templates a bit to your liking) Connect-PnPOnline -Url [templatesite]
Get-PnPSiteTemplate -Out mytemplate.xml
Connect-PnPOnline -Url [targetsite]
Invoke-PnPSiteTemplate mytemplate.xml This is over simplified as there might be things you want to include, like branding files which are by default not exported. Specify The branding files will be stored in the same folder as you have locally, optionally in a SiteAssets folder it will create. So it's smart to execute the cmdlets in an empty folder. Alternatively, do not specify a XML file to create but use the .pnp extension. If you do that we will create a PnP Provisioning Package file. It's effectively a zip file (e.g. rename .pnp to .zip and you can open it to see it's contents). If you use a .pnp extension we will store all the branding assets in the created file. This allows you to easier manage the template by moving it around, mailing it etc without you need to share the xml file -and- the assets folders etc. |
Beta Was this translation helpful? Give feedback.
Hi!
Yes, Get-PnPProvisioningTemplate has been renamed since 1.0 of the new PnP PowerShell: it's now called Get-PnPSiteTemplate. Same functionality, same parameters.
The flow is relatively simple (but you might have to tweak the resulting templates a bit to your liking)
This is over simplified as there might be things you want to include, like branding files which are by default not exported. Specify
-PersistBrandingFiles
onGet-PnPSiteTemplate
for that so the engine will include things like logos, etc.The branding files will be stored in …