Export (0) Print
Expand All

Import-SPWeb

 

Applies to: SharePoint Server 2013 Enterprise, SharePoint Foundation 2013

Topic Last Modified: 2014-03-03

Imports a web, list, or library.

Import-SPWeb [-Identity] <SPWebPipeBind> -Path <String> [-ActivateSolutions <SwitchParameter>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-HaltOnError <SwitchParameter>] [-HaltOnWarning <SwitchParameter>] [-IncludeUserCustomAction <None | All>] [-IncludeUserSecurity <SwitchParameter>] [-NoFileCompression <SwitchParameter>] [-NoLogFile <SwitchParameter>] [-UpdateVersions <Append | Overwrite | Ignore>] [-WhatIf [<SwitchParameter>]]

The Import-SPWeb cmdlet imports a web, list, or library. The capability to import from a library is a new feature in SharePoint 2010 Products.

 

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebPipeBind

Specifies the URL or GUID of the Web to import into.

The type must be a valid URL, GUID, or object; for example, a valid URL, in the form http://server_name, or a GUID, in the form, 1234-4567-5678a.

Path

Required

System.String

Specifies the name of the import file.

If the NoFileCompression parameter is used, a directory must be specified; otherwise, any file format is valid.

ActivateSolutions

Optional

System.Management.Automation.SwitchParameter

Specifies whether user solutions are activated during import.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

NoteNote:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Forcefully overwrites the export package if it already exists.

The type must be either of the following values

-True

-False

The default value is False.

HaltOnError

Optional

System.Management.Automation.SwitchParameter

Stops the import process when an error occurs.

HaltOnWarning

Optional

System.Management.Automation.SwitchParameter

Stops the import process when a warning occurs.

IncludeUserCustomAction

Optional

Microsoft.SharePoint.Deployment.SPIncludeUserCustomAction

Specifies whether User Custom Actions are included during import.

IncludeUserSecurity

Optional

System.Management.Automation.SwitchParameter

Preserves the user security settings except for SPLists that have broken inheritance and item level permissions set.

NoFileCompression

Optional

System.Management.Automation.SwitchParameter

Either enables or disables file compression in the import package. The import package is stored in the folder specified by the Path parameter or Identity parameter. We recommend that you use this parameter for performance reasons. If compression is enabled, the import process can increase by approximately 30 percent.

NoLogFile

Optional

System.Management.Automation.SwitchParameter

Suppresses the generation of an import log file. If this parameter is absent, the Import-SPWeb cmdlet will generate an export log file in the same location as the export package. The log file uses Unified Logging Service (ULS).

We recommend that you use this parameter. However, for performance reasons, you might not want to generate a log file.

UpdateVersions

Optional

Microsoft.SharePoint.Deployment.SPUpdateVersions

Indicates how to resolve situations where a file version to be imported to a site already exists in that site. The type must be any one of the following:

Add to add the file as a new version.

Overwrite to overwrite the current file and all of its versions (delete then insert)

Ignore to ignore the file if it exists on the destination. The new file will not be added.

The default value is Add.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

---------------------EXAMPLE----------------------

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

This example imports the contents of export.cmp into a site at http://site, overwriting the versioned content on the site with the contents of the export.cmp file.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft