In SharePoint 2010, Microsoft introduced a new ability to export and import SharePoint objects. These new operations enable administrators to more easily move content between different site collections. During import and export operations, administrators can control which content will be transferred and how versions will be affected by the move.
Here is a sample for exporting a site:
The syntax to export a list is similar, but the list path, relative to site path, must be passed as -ItemUrl
parameter:
When exporting lists and libraries, associated workflows and alerts will not be exported along with the content. In addition, item-level permissions will not be maintained.
Sometimes a business might ask for a snapshot of SharePoint for archiving or compliance purposes, and now PowerShell comes to the rescue. The cmdlet Export-SPWeb
enables administrators to control versions that will be exported to an export file.
To export content of a document library, use the same code as previously given. By using optional parameter –IncludeVersions
, you can choose to export: LastMajor
, CurrentVersion
, LastMajorAndMinor
, or All
.