My scenerio was this, I mounted a SharePoint 2013 content database to my new SharePoint 2013 SP1 environment thinking that it would upgrade the database to be the latest version and render correctly in SharePoint 2013 SP1.
I placed it on a temporary web application because I wanted to test it out first and ensure everything worked fine and in fact, everything looked like it was fine.
I then wanted to back it up and restore it to my host named site collection on my main web application within a specific content database using the following PowerShell command:
restore-spsite ‘http://<MYHNSCURL>’ -HostHeaderWebApplication ‘http://<MYWEBAPPURL>’ -DatabaseServer ‘MYDBSERVERALIAS’ -DatabaseName ‘MYCONTENTDBNAME’ -path ‘c:<MYBACKUPSC.SC’ -force
and I got an error like this in PowerShell:
restore-spsite : <nativehr>0x80070003</nativehr><nativestack></nativestack> At line:1 char:1 + restore-spsite ‘http://tciconnect-dev.tci.internal.toyota.ca/sites/ICCS’ -HostHe … + ~~ + CategoryInfo : InvalidData: (Microsoft.Share…dletRestoreSite: SPCmdletRestoreSite) [Restore-SPSite], DirectoryNotFoundException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRestoreS ite….
After a little bit of time playing around, I figured out that Mount-SPContentDatabase did not indeed upgrade the content database to the SP 2013 SP1 version, it left it as is which I guess wasn’t compatible with my other web application I was trying to restore to. So in order to fix this, I just had to manually run the Upgrade-SPContentDatabase command first and then back up and restore the site collection with the same command as above: