Monday, January 23, 2012

SharePoint 2010 Post SP1 - DB Restore - The backup file should be restored to a server with version '4.0.145.0'

We applied SP2010 SP1 in both production and development environments between Christmas and New Year break, the SP1 ran very smooth, it took care of everything auto-magically... after that we ran the SharePoint 2010 Products Configuration Wizard in both farm, and things seem perfectly fine, the backup still working fine, I did not pay much attention to it since...

Problem
But last week, I  tried to restore a content database using powershell in one of development environment by executing the following cmdlet :
Restore-SPSite -Identity http://SP2010-DEV -Path E:\Backups\Site-80\SP2010.Bak -Force

Then I got a content database version error.

"Restore-SPSite : Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '4.0.145.0' or later.
At line:1 char:15"

I was pretty sure we had the same patch to both DEV and PROD farms, I also went through exercise of comparing each services version installed in both environments, everything seem the same, but restore failed...

I followed number of suggestions that work for other (listed below), but it was no luck for my case...
Here were failed attempts (but works for others - may be you)

First attempted (Failed for me but might work for you)Upgrade-SPContentDatabase Method

  • Executed the Get-SPContentDatabase, to retrieve the database ID 
  • Then run the Upgrade-SPContentDatabase -Identity (database ID)
  • Later tried the Backup-SPSite and Restore-SPSite cmdlet...
But, during the restore I received the same error message

Second attempted (Failed for me but might work for you) - Use the old STSADM command for backup and restore.
  • STSADM.EXE -o backup -url http://server/site -filename backup.dat
  • STSADM.EXE -o restore -url http://server/site -filename backup.dat -overwrite
But, during the restore I still received the same error message

Third attempted (Failed for me but might work for you) - Restore back to the PROD at different web application
  • Restored the fresh backup from the PROD and restore back to the same server but in a different web application and port, using the Backup-SPSite and Restore-SPSite. 
But during restore I still received the same error message again! Holy moly, my heart sank!... I could not restore the same backup that I just created on the same environment!? it was complaining version different in the same prod farm...

So what is this haunting message "The backup file should be restored to a server with version '4.0.145.0' or later."!!??

After further searching again... I realized the problem is on the PROD farm, it is still out of sync... The SharePoint 2010 Products Configuration Wizard in the Central Admin did not correct the version issue... Using the (get-spserver $env:computername).NeedsUpgrade cmdlet it still returned "True".

Last attempted (Works for me!)
Than I found this technet article Restore pre-SP1 backups to an SP1 farm I need to run the following command on the production (SOURCE farm)

psconfig -cmd upgrade -inplace b2b -wait -force

The command completed successfully,

Then I re-checked the system again(get-spserver $env:computername).NeedsUpgrade cmdlet, this time it returned "False". I tried the same cmdlet in both PROD and DEV... After that, I re-created new backup again and was able to restore the backup in the development environment successfully.

This is rather uncommon situation, or may be I trusted the SharePoint 2010 Products Configuration Wizard in the Central Admin will do the job, But it did not... so I lost a weekend on this issue... but I am glad the psconfig cmdlet finally straight everything up. If you are parceling with same issue, hopefully this article may help you...

Good luck!

Some suggested the following cmdlet will work too, I have not tried it yet,
PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures

1 comment: