Sunday, October 16, 2016

Restore Site collection backup from Lower to Higher SharePoint CU version 2013 and vice versa

Recently I had faced an issue where QA and test were on May 16 CU where as Prod was on March 15 CU. With SharePoint 2013, it does not allows to restore site collection backups if both source and destination farms have different SharePoint version like in above case and we will get error when use Restore-SPSite command.

There are two way to solve this issue....

1) Database copy approach 

This approach is pretty simple. you need to take backup of database having site collection you want to restore and restore database in destination SQL server. Mount database with desired web application and upgrade database using powershell.

2) Hack site collection backup file

  • Backup your site collection from Source farm using Backup-SPSite command.
  • Download HXD editor for editing backup file which is in hexadecimal format.
  • Post installing HXD, Run it.
  • Open site collection backup file in above tool
  • Site collection backup file should look something like below...
  • image
  • If we 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
  • best things about backup file version is that version is stored only once and that too at beginning of file.
  • change source version to the target in the hex editor now.
  • image
  • If you unsure about target SharePoint version, you can get from central admin-->Upgrade and Migration-->Check product and patch installation status
  • Or you can take site collection backup of any blank site in destination farm and open with HXD to get SP version number.
  • Once source SP version is replaced with destination SP version save the backup file in HXD.
  • Run the Restore-SPSite command again and site collection would be restored without any issues.

No comments:

Post a Comment