5

we want to restore one of the deleted subsite from backup using thrid party software. The problem we are facing is, Sharepoint got upgraded after the subsite was deleted and if we try to restore it now, it says unmatched version. that means, the subsite is lower version than what currently being run.

How do i solve this issue?

SharePointMan
  • 3,364
  • 5
  • 33
  • 51

2 Answers2

6

we have site collection backup, which is created with Backup-SPSite cmdlet:

Backup-SPSite http://example1.com -Path C:\Backup\example1.bak

We copied it on local environment and want to restore it with

Restore-SPSite http://example2.com -Path C:\Backup\example1.bak –Confirm:$false

(Here I intentionally used different urls for source and target sites in order to show that it is possible to restore site collection to the different url). If we have lower Sharepoint version on the local environment we will get unclear nativehr exception, which won’t say anything. But if we will make our logging verbose and check Sharepoint logs, we will find the following error:

Could not deserialize site from C:\Backup\example1.bak. Microsoft.SharePoint.SPException: Schema version of backup 15.0.4505.1005 does not match current schema version 15.0.4420.1017.

(Exact version number is not important. For this post it is only important that source version 15.0.4505.1005 is higher than target version 15.0.4420.1017).

What to do in this case? Mount-SPContentDatabase also won’t work because of the same reason, i.e. content database backup also won’t work. In this case we can either update our environment (and you should consider this option as basic) or go by non-standard way.

For non-standard way we will need hex editor. At first I thought that site collection backup is regular .cab file, so it will be possible to uncompress it, edit text files inside it and compress back (I described this trick in this post: Retain object identity during export and import of subsites in Sharepoint into different site collection hierarchy location), but this is not the case with site collection backups made with mentioned cmdlets. They look like regular binary files. So we will need some hex editor for modifying it. I used HxD hexeditor, but you can use any other as well.

If we will open backup file in it and will try to find the version, which we got from error message from the log, we will find that it is located in the beginning of the file: enter image description here

Now save it and run Restore-SPSite again. This time restore should work. Hope that this trick will help someone. But remember that it is hack and use it carefully.

Debugger
  • 1,722
  • 15
  • 42
  • I dont think this is supported . It may void SharePoint licence – SharePointMan Apr 05 '17 at 14:11
  • I don't understand why, just download and install the Hx Editor tool, then find the current build version of your farm, then open the existing backup with the hxd editor and change it to the current version. Then restore the updated one. It will work. (Use PowerShell for Restoration) – Debugger Apr 05 '17 at 14:17
  • It's not about Sharepoint licence – Debugger Apr 05 '17 at 14:17
  • Your not touching nothing of the SharePoint Core, so your licence will remain untouch. I use the same method – Marco Apr 05 '17 at 14:40
  • I believe what SharepointExpert meant to say is that this isn't supported and you may run into issues and have hard time getting official support from Microsoft by doing this. In my opinion, however, the worst that can happen is that the restored site doesn't work and if you delete it, you're back to square one. – Jussi Palo Apr 06 '17 at 06:34
3

Long but working route would be to setup new SP instance (single server installation will do just fine) with old patch level, restore site there, then migrate it to final location using 3rd party migration tool.

Jussi Palo
  • 8,196
  • 1
  • 20
  • 36