I have made a backup of a SharePoint Site using Export-SPWeb. I have also added a new Host Named Site Collection and I would like to Import the Site into this newly created Host Named Site Collection.

I have managed to import it into a SubSite of another Site Collection but when I try with the Host Named Site Collection it gives the following error:

Import-SPWeb : Cannot find an SPWeb object with Id or Url : http://demo.[companyname].com. At line:1 char:1 + Import-SPWeb http://demo.[companyname].com -Path C:\Import\Backup\SiteBackup\20160524\F ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ + CategoryInfo : InvalidData: (Microsoft.Share...CmdletImportWeb: SPCmdletImportWeb) [Import-SPWeb], SPCmdletPipeBindException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletImportWe

  • Have you created a site at the location of your host named site collection? If not, create one first then import your web to overwrite it. – Submits May 26 '16 at 10:06
  • God idea, let me try that! Thanks for you assistance – Aadil Ganie May 27 '16 at 8:09
  • Let me know how you get on. – Submits May 27 '16 at 8:23
  • Yup, there is a site there as well. I also tried using a site collection backup but then it says Version String Too Long Or Too Short – Aadil Ganie May 27 '16 at 8:25
  • What account are you running PowerShell as? Make sure the account that's being used has DBOwner permissions to the content database. Try a Get-SPWeb. – Submits May 27 '16 at 8:31

Managed to get it right somehow. Seems when I was trying to restore it using a SiteCollectionBackup it gave an error:

Restore-SPSite: Version String portion was too long or too short.

When it gave that error it also deleted the Host Named Site Collection. So after when i tried to restore again using Import-SPWeb it couldn't find the URL for the HNSC because it has been deleted automatically.

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.