Monthly Archives: April 2014

SharePoint Error – Database is too old and upgrade is required

I was recently working on a SharePoint Migration Project where we migrated from a SharePoint 2010 farm to a shiny new SharePoint 2013 SP1 farm. Some of the sites were to stay in “2010 Site Collection Mode” until the site owner was ready to upgrade and others were upgraded to 2013 right away. Below is a screenshot or Central Admin showing the database upgrade status for 3 content databases:

  1. The top database was completely upgraded to 2013. Looks beautimus!
  2. The middle database has some sites upgraded and others in 2010 mode…Looks OK..
  3. The bottom database SHOULD have some site collection in 2010 mode and others in 2013 mode just like the middle database. Something looks off here right? Running the Upgrade-SPContentDatabase cmdlet did nothing and PSConfig did nothing.

CADBTooOldError

Looking at the eventvwr Application Log shows some interesting new errors:

eventvwrdbtooolderror

Nothing has changed in the farm from a SharePoint Server perspective…I was able to run the Get-SPContentDatabase command on each content database in this state and get back the appropriate webapp object for each. When clicking the content database anywhere in Central Admin I would get the error “Object Reference not set to an Instance of an Object” and this was causing other errors in the environment:

  1. Alerts were not working
  2. Issues with editing files/check-in and check-out
  3. Not able to select any site collection in Central Admin

Users could still get to the site collections…The experience just wasn’t optimal. I took a look through ULS, Eventvwr, and SQL Logs and couldn’t find anything besides a larger stack trace for the Object Reference Error and not much else.

Something happened between this content database and the SharePoint server causing the database to be in this funky state. PowerShell to the rescue!
The Fix: Running the Dismount-SPContentDatabse and Mount-SPContentDatabase fixed the issue.

For example:

SharePoint – Query User Information List in SQL

NOTE: DIRECTLY querying any SharePoint SQL database is NOT SUPPORTED (Except the Logging Database). If testing the query below I’d recommend backing up and restoring the content database to a different SQL Server (Non SharePoint and Non Production) and running through this.

Now that we got the disclaimer out of the way, here is the background –  I was working with Microsoft on a support issue which involved user accounts not showing up in the User Information List correctly. Here’s a SQL script that Microsoft provided that helps query this information in SQL.

Replace the sitecollectionurl with the site collection URL and ADAccount with the samAccountName in question. This will return quite a bit of information about that user in the specified site collection.

SharePoint – Publishing Site Collection Features Enabled and then Disabled. Save Site As Template is gone!

I ran into an issue recently where we enabled the SharePoint Server Publishing Site/Site Collection features and then disabled them at a later time. Microsoft doesn’t allow Publishing sites to be saved as a template per: http://support.microsoft.com/kb/2492356

When you disable the site collection/site feature it SHOULD bring back the Save Site as Template option, but in my case it did not. I tried enabling and disabling the feature a few times, but no such luck. PowerShell to the rescue!

Run the following script to bring back the Save Site as Template Option (Make sure you have already disabled the Publishing site collection feature):