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?