Export and Import Subsite in SharePoint 2013 using PowerShell

Export-Import subsite using PowerShell in SharePoint 2013

How to export SharePoint subsite? Export subsite SharePoint 2013 PowerShell, Unlike SharePoint 2013, you’ll have to create a subsite first and then import. Export-SPWeb cmdlet used to export a subsite, list, or document library.

Open SharePoint 2013 Management Shell and run this command. Change Site URL and Path values accordingly.

Export-SPWeb "http://sharepoint.company.com/sites/Sales/US/" ` 
         -Path "C:\sales-us.cmp" -IncludeVersions All -includeusersecurity

To export a site, list, or document library by using Central Administration:

You can also export a Subsite from SharePoint 2010/2013/2016 Central Administration via “Export a site or list”  capability. Go to SharePoint Central Administration >> Backup and Restore >> Click on the “Export a site or list” link under the “Granular Backup” group.

Export subsite sharepoint 2013 powershell

Important: Both the source and destination sites should be using same template!

Import subsite in SharePoint 2013 using PowerShell

Import-SPWeb PowerShell cmdlet used to import a sub site from backup.

Import-SPWeb "http://sharepoint.company.com/sites/Sales/US/" ` 
        -Path "C:\sales-us.cmp"  -includeusersecurity -UpdateVersions overwrite 

With these cmdlets, we can Export and Import a particular subsite, list, or document library. You can also use Export-SPWeb & Import-SPWeb cmdlets to copy the list with data between SharePoint Sites/Web Apps/or between different environments. For E.g. Copy a SharePoint list from Dev to a staging server.

Please note, export-import is not the same as backup-restore. Certain artifacts will not be copied during export-import. Such as:

  • Workflow association-data
  • Audit logs
  • Recycle bin items
  • Created By, Modified By details, etc.

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply