Import a list or document library in SharePoint Server 2010
Si applica a: SharePoint Foundation 2010, SharePoint Server 2010
Ultima modifica dell'argomento: 2011-11-15
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 in SharePoint Server 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 Server 2010).
Importante
You cannot import a site, list or document library exported from one version of Microsoft SharePoint Server to another version of SharePoint Server.
Import a site, list, or document library in SharePoint
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: vedere 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]
Importante
The site or subsite that you are importing must have a template that matches the template of the site specified by
Identity
.You can also use the
Get-SPWeb
cmdlet and pass the ID toImport-SPWeb
by using the Windows PowerShell pipeline. The value of thePath
parameter 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 theIncludeUserSecurity
parameter. To overwrite the list or library that you specified, use theForce
parameter. You can use theUpdateVersions
parameter to specify how versioning conflicts will be handled. To view the progress of the operation, use theVerbose
parameter.The
NoFileCompression
parameter 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 theNoFileCompression
parameter in theExport-SPWeb
cmdlet, you cannot use this parameter in theImport-SPWeb
cmdlet.Nota
There is no facility in the
Import-SPWeb
cmdlet import a subset of the items within the export file. Therefore, the import operation will import everything from the file.
For more information, see Import-SPWeb.
Nota
Per l'esecuzione di attività amministrative dalla riga di comando è consigliabile utilizzare Windows PowerShell. Lo strumento da riga di comando Stsadm è deprecato, ma è stato incluso per garantire la compatibilità con le versioni precedenti del prodotto.
See Also
Concepts
Export a site, list, or document library in SharePoint Server 2010