logo
search
SharePoint Document Issues

Does Applying a SharePoint Provisioning Template Delete Documents?

Huma Ashraf ChHuma Ashraf Ch Oct 8, 2026 868 views

Question details

The user wants to know if applying a provisioning template using Invoke-PnPSiteTemplate in PnP PowerShell will automatically delete existing documents in a SharePoint site library.

Does Applying a SharePoint Provisioning Template Delete Documents?
Product
Microsoft SharePoint
Device & OS
not provided
Scenario
Applying a PnP PowerShell provisioning template to an existing live SharePoint site.
Observed behavior
The user is looking for confirmation on the safety of their existing document library contents during a template provisioning process.
Before you start

Before applying any provisioning template to a live site, manually back up the destination SharePoint site and review the XML template for any explicit document or list deletion operations.

Solution 1Recommended

Safely Test and Apply SharePoint Provisioning Templates

Verify the template's behavior in a non-production sandbox environment to ensure existing documents are not affected before applying it to your production site.

Applying a PnP PowerShell provisioning template with the Invoke-PnPSiteTemplate command generally updates configured site elements but does not delete existing document library contents automatically. However, variations in template configurations and PnP PowerShell versions can cause unexpected changes.

1
Review the Template Configuration

Open your provisioning template XML file in a code editor. Search through the <pnp:Lists> and <pnp:Files> sections to ensure there are no instructions that overwrite or remove existing document libraries.

2
Prepare a Sandbox Environment

Navigate to your SharePoint admin center and create a new, non-production test site that mimics the structure and content of your live destination site.

3
Run a Test Deployment

Open PnP PowerShell, connect to your test site using 'Connect-PnPOnline', and execute the 'Invoke-PnPSiteTemplate -Path yourtemplate.xml' command.

4
Verify Document Integrity

After the script completes, open the document libraries in your test site via the SharePoint web interface to confirm that all pre-existing documents remain intact and accessible.

Safely Test and Apply SharePoint Provisioning Templates
Community Verification: Because PnP PowerShell receives frequent updates, it is highly recommended to check the Microsoft Q&A forums or the Microsoft 365 PnP community for any known bugs related to your specific module version.
Free Microsoft Office alternative

Manage Your SharePoint Documents Offline with WPS Office

While SharePoint and PnP PowerShell handle online site configuration, you still need a reliable local software suite to open and edit your downloaded files. WPS Office is a lightweight, highly compatible alternative to Microsoft Office that allows you to manage Word, Excel, and PowerPoint files effortlessly and for free.

  1. 1. Download the Installer: Visit the official WPS Office website and click the free download button for your operating system.
  2. 2. Install WPS Office: Run the setup file and follow the quick on-screen instructions to install the suite on your computer.
  3. 3. Edit Your Documents: Launch WPS Office and open your SharePoint-downloaded documents to begin editing them securely offline.
Seamlessly open, edit, and save Microsoft Office formats like .docx, .xlsx, and .pptx downloaded from SharePoint.Lightweight installation with a familiar tabbed interface, ensuring zero learning curve for Office users.Built-in PDF editing and conversion tools for comprehensive document management.
microsoft office alternative - wps office

Frequently Asked Questions

Can I reverse a SharePoint provisioning template once it is applied?

No, applying a provisioning template via PnP PowerShell cannot be automatically reversed. You would need to manually revert the changes made by the template or restore the site from a previous backup.

Does Invoke-PnPSiteTemplate overwrite existing lists and libraries?

It typically updates existing lists by adding missing columns, content types, or views. However, if the template enforces a strict schema that conflicts with the existing list, it might modify existing settings, which is why testing is crucial.

Where can I find help for specific PnP PowerShell template errors?

The best resources for troubleshooting PnP PowerShell errors are the official Microsoft Q&A platform, the PnP PowerShell GitHub repository, and the broader Microsoft 365 developer community.