SOLVED

How to copy existing SharePoint Online Prod site with contents same to same for DEV site?

Copper Contributor

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 

2 Replies
best response confirmed by chiragcanada2020 (Copper Contributor)
Solution

@chiragcanada2020 

 

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-e...

 

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"
1 best response

Accepted Solutions
best response confirmed by chiragcanada2020 (Copper Contributor)
Solution

@chiragcanada2020 

 

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-e...

 

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"

View solution in original post