1

I have a strange issue with Export-SPWeb and Import-SPWeb for SharePoint 2013.

I want to export one of my sites, so I type this command:

Export-SPWeb https://test.mywebsite.com/site -Path "export.cmp" -CompressionSize 100

The exported file is 30Mb so I preferred to add the CompressionSize parameter (see here). Anyway, the execution finishes and I can see the file.

Now, I want to import it on another subsite on the same server:

Import-SPWeb https://test.mywebsite.com/another_site/test -Path "export.cmp"

The procedure ends immediately with this error:

Import-SPWeb : The file export.cmp does not exist.
At line:1 char:1
+ Import-SPWeb https://test.mywebsite.com/another_site/test -Path "sisdoc.cmp"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (Microsoft.Share...CmdletImportWeb:
   SPCmdletImportWeb) [Import-SPWeb], SPException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletImportWeB

The "export.cmp" file actually exists (and has all the read/write permissions). What's missing?

  • 1
    You should give the complete path i.e c:\directory\export.cmp – Waqas Sarwar MVP Feb 23 '15 at 16:34
  • 1
    Post it as an answer and I'll give you money :D – TheUnexpected Feb 23 '15 at 17:08
  • i updated it.happy to seeyour issue fixed. – Waqas Sarwar MVP Feb 23 '15 at 17:10
1

From you command what i am reading you are not giving the complete path of the file location. So please do this way:

Import-SPWeb https://test.mywebsite.com/another_site/test -Path "**C:\Directory\export.cmp**"
  • Thanks, by the way this is strange because the Export-SPWeb counterpart does not request an absolute path... – TheUnexpected Feb 23 '15 at 23:15
1

According to the options present in the command line the import may not work. So, add or remove options untill it works:

Import-SPWeb https://test.mywebsite.com/another_site/test -Path "export.cmp"
Import-SPWeb https://test.mywebsite.com/another_site/test -Path "export.cmp" -Force
Import-SPWeb https://test.mywebsite.com/another_site/test -Path "export.cmp" -Force -Verbose
Import-SPWeb https://test.mywebsite.com/another_site/test -Path "export.cmp" -Force -Verbose -NoFileCompression

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.