none
Cannot import site - Import-SPWeb results in error

    Question

  • I'm trying to import a site that I exported using Export-SPWeb, and it's not working

    Export command - this worked:

    Export-SPWeb https://company.com/path1/oldsite -Path "SiteExport.cmp"

    Import command - this did not work:

    Import-SPWeb https://company.com/path2/newsite -Path "SiteExport.cmp" –UpdateVersions -Overwrite

    My import command resulted in the following error:

    Import-SPWeb : Cannot bind parameter 'UpdateVersions'. Cannot convert value "-Overwrite" to type "Microsoft.SharePoint.Deployment.SPUpdateVersions" due to invalid enumeration values. Specify one of the following enumeration values and try again. The possible enumeration values are "Append, Overwrite, Ignore". At line:1 char:122+ Import-SPWeb https://company.com/path2/newsite -Path "SiteExport.cmp" -UpdateVersions <<<<  -Overwrite    + CategoryInfo          : InvalidArgument: (:) [Import-SPWeb], ParameterBindingException    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.SharePoint.PowerShell.SPCmdletImportWeb

    Any assistance would be great.  Could it be a permissions problem?

    Thursday, July 5, 2012 9:59 PM

Answers

  • I figured it out; it's actually this:

    Import-SPWeb https://company.com/path2/newsite -Path "SiteExport.cmp" –UpdateVersions:Overwrite

    furthermore, PS wanted the full Path rather than just the relative path, so I ended up doing this:

    Import-SPWeb https://company.com/path2/newsite -Path "C:\temp\SiteExport.cmp" –UpdateVersions:Overwrite

    Thursday, July 5, 2012 10:45 PM

All replies

  • The command should be:

    Import-SPWeb https://company.com/path2/newsite -Path "SiteExport.cmp" –UpdateVersions Overwrite

    Overwrite is a parameter of UpdateVersions, not a parameter itself.


    http://sharepoint.nauplius.net

    Thursday, July 5, 2012 10:19 PM
    Moderator
  • I figured it out; it's actually this:

    Import-SPWeb https://company.com/path2/newsite -Path "SiteExport.cmp" –UpdateVersions:Overwrite

    furthermore, PS wanted the full Path rather than just the relative path, so I ended up doing this:

    Import-SPWeb https://company.com/path2/newsite -Path "C:\temp\SiteExport.cmp" –UpdateVersions:Overwrite

    Thursday, July 5, 2012 10:45 PM
  • By the way, I got the incorrect syntax from here:

    http://technet.microsoft.com/en-us/library/ff607613

    Scroll down to the Example:

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

    Thursday, July 5, 2012 10:48 PM
  • Confirmed that TechNet's syntax is wrong, results in error.

    However, your syntax is not working for me either.  Appears to be using Ignore, despite using Overwrite.


    <insert witty comment here>

    Friday, December 7, 2012 2:17 AM
  • After typing get-help import-spweb -examples and finding the incorrect documentation as shown below, I changed the parameter -Updateversions -Overwrite to -Updateversions:Overwrite

    @MSFT - Update your powershell documentation. SharePoint is difficult to maintain.

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

    C:\PS>Import-SPWeb http://site -Path export.cmp -UpdateVersions -Overwrite

    Friday, December 28, 2012 7:38 PM
  • Thanks for figuring this out. I was stuck and couldn't make the import command work. But your command line above worked perfectly. Plus, it didn't break my site! So a definite Win-Win!
    Friday, April 22, 2016 3:26 PM