Import a list or document library (SharePoint Foundation 2010)
Published: May 12, 2010
Although you can use either Windows PowerShell or Central Administration to export a site, list, or document library, you can use only Windows PowerShell to import a site, list, or document library. For information about how to export lists or libraries, see Export a site, list, or document library (SharePoint Foundation 2010).
You can use importing as a method of restoring the items, or as a method of moving or copying the items from one farm to another farm. You can import a site, list, or document library from a backup of the current farm, from a backup of another farm, or from a read-only content database. To import from a read-only content database, you must first attach the read-only database. For more information, see Attach and restore a read-only content database (SharePoint Foundation 2010).
You cannot import a site, list or document library exported from one version of Microsoft SharePoint Foundation to another version of SharePoint Foundation.
Import a site, list or document library
You can use Windows PowerShell to manually import a site, list, or document library or as part of a script that can be run at regular intervals.
To import a site, list or document library by using Windows PowerShell
Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
On the Start menu, click All Programs.
Click Microsoft SharePoint 2010 Products.
Click SharePoint 2010 Management Shell.
At the Windows PowerShell command prompt (that is, PS C:\>), type the following command, and then press ENTER:
Import-SPWeb -Identity <Site URL> -Path <Export file name> [-Force] [-NoFileCompression] [-Verbose]
The site or subsite that you are importing must have a template that matches the template of the site specified by
You can also use the
Get-SPWebcmdlet and pass the ID to
Import-SPWebby using the Windows PowerShell pipeline. The value of the
Pathparameter specifies the path and file name of the file from which to import the list or library. To include the user security settings with the list or document library, use the
IncludeUserSecurityparameter. To overwrite the list or library that you specified, use the
Forceparameter. You can use the
UpdateVersionsparameter to specify how versioning conflicts will be handled. To view the progress of the operation, use the
NoFileCompressionparameter lets you specify that no file compression is performed during the import process. Using this parameter can lower resource usage up to 30% during the export and import process. If you are importing a site, list, or document library that you exported from Central Administration, or if you exported a site, list, or document library by using Windows PowerShell and you did not use the
NoFileCompressionparameter in the
Export-SPWebcmdlet, you cannot use this parameter in the
There is no facility in the
Import-SPWebcmdlet import a subset of the items in the export file. Therefore, the import operation will import everything from the file.
For more information, see Import-SPWeb.
We recommend that you use Windows PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.
May 12, 2010