SharePoint Document Issues

How to Clone or Copy a SharePoint Site for Testing

Huma Ashraf ChHuma Ashraf Ch Oct 29, 2026 868 views

Question details

The user needs to clone a live modern SharePoint site to create a separate testing environment.

How to Clone or Copy a SharePoint Site for Testing
Product
SharePoint Online
Device & OS
not provided
Scenario
Creating a safe test environment for upcoming intranet changes without affecting the live production site.
Observed behavior
The standard 'Save site as template' operation fails or is hidden because modern SharePoint sites block this action when unsupported apps are present.
Before you start

Ensure you have SharePoint Administrator privileges, and install the SharePoint Online Management Shell before attempting to run these administrative scripts.

Solution 1Recommended

Enable Custom Scripts via PowerShell to Save Site as Template

Temporarily override SharePoint's security settings using PowerShell to allow saving the site as a template even with unsupported apps.

Modern SharePoint Online intentionally restricts saving sites as templates when unsupported apps are installed. By using the SharePoint Online Management Shell to temporarily allow custom scripts, administrators can bypass this block, generate the necessary template, and clone the site for external testing.

1
Open SharePoint Online Management Shell

Launch the SharePoint Online Management Shell application on your computer as an administrator.

2
Connect to your SharePoint Admin Center

Run the command 'Connect-SPOService -Url https://yourdomain-admin.sharepoint.com' and log in with your global or SharePoint admin credentials.

3
Enable Custom Scripts

Execute the command 'Set-SPOSite <SiteURL> -DenyAddAndCustomizePages 0' (replacing <SiteURL> with the URL of the site you want to clone).

4
Navigate to Site Settings

Open your live SharePoint intranet site in a web browser. Click the Gear icon (Settings) > Site Information > View all site settings.

5
Save Site as Template

Under the 'Site Actions' category, click on 'Save site as template'. Fill in the file name, template name, and choose whether to include content, then click OK.

Enable Custom Scripts via PowerShell to Save Site as Template
Security and Governance Notice: Review your organization's security and support policies before enabling custom scripts. Once the template is successfully generated, it is highly recommended to run 'Set-SPOSite <SiteURL> -DenyAddAndCustomizePages 1' to re-secure the site.
Free Microsoft Office alternative

A Lightweight Alternative for Handling SharePoint Documents

While managing complex SharePoint architectures requires administrative tools, editing the actual documents stored in your intranet shouldn't be difficult. WPS Office provides a free, highly compatible alternative to Microsoft Office that easily handles your everyday document management needs without straining your system resources.

  1. 1. Download and Install: Visit the official WPS Office website to download the free installer and follow the setup wizard.
  2. 2. Open Exported SharePoint Files: Launch WPS Office and open the Word, Excel, or PowerPoint documents downloaded from your SharePoint site.
  3. 3. Edit and Save: Edit your documents seamlessly with full formatting preserved, then save them back to your local drive or directly sync them to your cloud storage.
Fully compatible with Microsoft Word, Excel, and PowerPoint file formats (.docx, .xlsx, .pptx).Lightweight installation that runs fast and smoothly on older or budget devices.A familiar user interface that requires zero learning curve for switching users.Built-in advanced PDF editing capabilities available completely for free.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my modern SharePoint site fail to save as a template?

Modern SharePoint sites often contain newer web parts and apps that are not supported by the classic template engine. When SharePoint detects these unsupported apps, it disables or fails the 'Save site as template' feature to prevent data corruption.

Can I use individual page templates instead of cloning the whole site?

While you can save individual pages as templates within the site's Pages library, this only duplicates page layouts. It does not replicate the backend lists, document libraries, or site structure needed to accurately test upcoming tenant-wide changes.

How do I revert the custom script setting after saving the template?

To restore the default security restriction, open the SharePoint Online Management Shell again and run the command 'Set-SPOSite <SiteURL> -DenyAddAndCustomizePages 1'. This will disable custom scripts and protect your live site.