Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
1.2k views
in SharePoint Server by 35 44 53
In SharePoint 2019, I have a subsite under a sitecollection and I need to move it to another farm. What's the best way to backup and restore a subsite with content and permissions in SharePoint 2019 using PowerShell?

1 Answer

1 like 0 dislike
by 151 169 345
selected by
 
Best answer

How to backup a subsite in SharePoint 2019?

In SharePoint 2019, to backup a subsite in PowerShell, you have to use Export-SPWeb as the following:

Export-SPWeb https://site -Path "C:\Temp\export.cmp" -IncludeVersions  -IncludeAlerts -IncludeUserSecurity

The above cmdlet, will backup the SharePoint subsite includes

  • Versions
  • Alerts
  • User Security
  • Child subsites

Note:
The Export-SPWeb doesn't include the below items:

  • Recycle bin items
  • Workflow association-data
  • Audit logs

How to restore a subsite in SharePoint 2019?

In SharePoint 2019, to restore a subsite in PowerShell, you have to use Import-SPWeb as the following:

   Import-SPWeb https://site -Path export.cmp -includeusersecurity -UpdateVersions Overwrite

See also Backup and Restore Site Collection SharePoint 2016

If you don’t ask, the answer is always NO!
...