Forum Discussion
DanielaH
Apr 09, 2019Brass Contributor
Can PowerShell be used to copy SPO Site (created from a Group)?
Hello all,
I am looking for the best solution to copy a SPO site (belonging to a Group) between sites, and ideally create a template from it.
Since we unfortunately did not set this up as a Standalone Team Site, using the 'Save Site as Template' option is now not available for us in this instance.
Is there a way for PowerShell to do the job?
DanielaH Site "templating" can be done in a couple of ways for modern SharePoint. The first being, using Site Designs and Site Scripts to help provision out some default structures to your new sites that get created. These work as remote provisioning that run *after* a site is created. So imagine, creating a new site and subsequently a process running to apply customizations to the new site.
https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview
However, these are fairly limited in what you are looking for. You'll likely want to leverage Site Designs + PnP Templates to help provision out template sites in your environment. Have a look at this documentation on the architecture and how this would be set up.
https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-pnp-provisioning
Alternatively, you could use PnP PowerShell Provisioning to apply a template to an existing site as well. https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/apply-pnpprovisioningtemplate?view=sharepoint-ps