Home » powershell » Exporting and Importing a Site, Library, or List using PowerShell

Exporting and Importing a Site, Library, or List using PowerShell

The SharePoint 2010 Central Administration UI is not the only way to export a site, library, or list. SharePoint 2010 provides PowerShell cmdlets to export or even to import them back whenever required. You can even script out these operations to run manually or schedule them with the Windows Task Scheduler to make it run on a scheduled basis.

Let’s explore these cmdlets in detail.

The Export-SPWeb command is used to export a site, library, or list.

The Import-SPWeb command is used to import them back.

The general syntax of these commands are:

Export-SPWeb [-Identity]
-Path<filename-&-location> [-Force] [–IncludeUserSecurity][-ItemUrl ]

Examples:
//Export site collection
Export-SPWeb -Identity http://site -Path E:\ Backup\sitename.cmp –Verbose
//Export Site Pages From particular site
Export-SPWeb -Identity http://site -Path E:\ Backup\sitename.cmp -ItemURL “Site Pages” –Force
//Export site with single backup file
Export-SPWeb http://site -Path E:\Backup\sitename.cmp -CompressionSize 1000 -Force –Verbose

Import Syntax:
Import-SPWeb [-Identity]
-Path<filename-&-location> [-Force] [–IncludeUserSecurity][-Confirm]

Examples:
//Export site collection
Import-SPWeb -Identity http://site -Path E:\ Backup\sitename.cmp –Force –Verbose
//Export Site Pages From particular site
Import-SPWeb -Identity http://site -Path E:\ Backup\sitename.cmp -ItemURL “Site Pages” –Force

Share

Tags: , , , , , , , , , , , , , , , ,

Comments are closed.