Monday, January 23, 2012

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

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...

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 '' 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 '' 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

Monday, January 9, 2012

SharePoint 2010 Application Event ID 8031

Just few days ago, I posted Remove Search Service Application in SharePoint 2010 using stsadm, over the weekend; I noticed my Application Event log is filled with SharePoint Foundation Error - Event ID 8031, it shows up every 15 minutes… with a big question mark, I turned to internet search engine; some suggested apply the October Cumulative updates for SharePoint 2010 which we already did last year, other suggest rebuild the SharePoint! OMG!

Since everything in the SharePoint appear to be running fine... There is no compelling reason for a server rebuild. Then I found this article from Von Ingo. it helps me get rid of this event. However, I had to arm-wrestling with the DBA to gain access to the SQL Server.

Basically, here is the summary of what you need to do.
  1. Copy the long ID from  the event log
  2. Search the ID in SharePoint Config DB
  3. Retrieve the Column ID
  4. Then run stsadm -o deleteconfigurationobject command
  5. Done!
Here are the details
  1. Copy the long ID from the event 8031, just like the blue highlight in the image above
  2. Logon to SQL Server and lunch SQL Management Studio 
  3. Navigate to SharePoint_Config database, create a new SQL Query, and enter the following statement
    • SELECT ID, Properties FROM [Objects] WHERE [Name] LIKE '%24ca5db5-9a2f-4a3d-9e52-38ab5a1a7ab0_735388cb-9769-4d37-b212-0b17a5db02f8%'
  4. Note the id was copied from the screen above.
  5. The query result returned with one record found. (screen below) 
    • Feel free to look into the XML contents if you are interested.
  6. Then I copy the column id from the above image (highlighted in purple)
  7. Go back to the Web server and run the following stsadm.
    • STSADM -o deleteconfigurationobject -id C8D9F11F-D129-41D7-9248-D54DE43059D2
  8. The operation completed successfully, 
You should stop receiving the Event ID 8031 every 15 minutes. You pretty much need to repeat this work every time after you remove a SharePoint Search Application from your farm.

Hope this help!

Updated 31st Oct 2012
* As pointed out by my reader, "Accessing the Config DB directly from SQL is not supported by Microsoft". Perhaps you should check with Microsoft Support before you update the Config DB manually.

Friday, January 6, 2012

Remove Search Service Application in SharePoint 2010

I have a problematic Search Service Application(SSA) in the SP 2010 farm after patching the SP1, the SSA is always in starting mode or stopping mode when I click never complete the task successfully... and I can't delete the SSA in Central Admin neither... So I turned to Powershell and the good old stsadm.

Here are the steps

Run cmdlet to get SSA id (the guid)

Then run 
Stsadm -o deleteconfigurationobject -id  <GUID>

Then you should see the SSA gone away successfully.

To re-setup the search for SharePoint 2010, you can follow the script to Russ Maxwell

You can also use PowerShell to setup Sharepoint 2010 Search Crawl Schedules. Just follow
Powershell Script to set up Sharepoint 2010 Search Crawl Schedules - from PointBeyond.

Hope this help!

Updated 09 Jan 2012:
After the SSA is removed, the you will see Event ID 8031 appears in your Event Log, check out next post SharePoint 2010 Application Event ID 8031 for a fix.