Forum Discussion
chiragcanada2020
Nov 23, 2021Copper Contributor
How to copy existing SharePoint Online Prod site with contents same to same for DEV site?
Hello,
I have a requirement to mimic exactly as is as the SharePoint online Prod site with contents and permissions and create a new DEV site. How can I achieve that? Please help to get some pointers or scripts. This is in SharePoint online.
Thanks,
Chirag
You can use PnP Powershell to create a site template which you can apply to the DEV site.
https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
Code:
# connect to the prod site Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/prod" # get the template Get-PnPSiteTemplate -Out "PnP-Provisioning-File.xml" # connect to the dev site Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/dev" # apply the template Invoke-PnPSiteTemplate -Path "PnP-Provisioning-File.xml"
2 Replies
- Maggan WåhlinIron Contributor
You can use PnP Powershell to create a site template which you can apply to the DEV site.
https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine
Code:
# connect to the prod site Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/prod" # get the template Get-PnPSiteTemplate -Out "PnP-Provisioning-File.xml" # connect to the dev site Connect-PnPOnline -Url "https://yourtenant.sharepoint.com/sites/dev" # apply the template Invoke-PnPSiteTemplate -Path "PnP-Provisioning-File.xml"- chiragcanada2020Copper ContributorThanks