0

I have a modern communication site collection which I used as the development site collection >> and this site contains 3 lists >> the lists refer to each other using lookup fields.

Now I want to create a copy of the communication site collection to act as the production site. So is there an automated way to do this job?

I only need to copy the site and its lists without the data.

2 Answers 2

0

Please following steps:

1.First, please enable Custom Script in SharePoint Online

Connect-SPOService -Url https://tenant-admin.sharepoint.com
Set-SPOSite -Identity https://tenant.sharepoint.com/sites/sitename -DenyAddAndCustomizePages 0

2.Create a site template using PnP Site Provisioning

You can use Get-PnPProvisioningTemplate to create a site template using PnP Site Provisioning.

Get-PnPProvisioningTemplate -Out C:\template\template.pnp -PersistBrandingFiles 
New-PnPTenantSite -Url 'https://tenantURL/sites/sitename' -Title 'New Site Collection' -Owner 'melqassas@tenanturl'
Connect-PnPOnline 'https://tenantURL/sites/sitename'
Apply-PnPProvisioningTemplate -Path C:\template\template.pnp

Reference:

0

You can use PnP provisioning engine for such activities in SharePoint online.

You can generate & use site template for your requirements.

The easiest way to create a custom provisioning template is to create a fresh new site collection in SharePoint Online, configure your artifacts (site columns, content types, lists, pages, etc.), and save the result as a provisioning template.

Source: Introducing the PnP provisioning engine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.