SharePoint 2007 to 2010 Publishing Sites Database attach upgrade gotchas!


Recently I upgraded a SharePoint 2007 content database to SharePoint 2010 using the database attach method, there were a few gotchas.

  1. Navigation not showing – displays – ‘Error’
  2. When rerunning a database attach Upgrade it fails with two errors, in the log the error is Exception: ‘Object reference not set to an instance of an object.’
  3. Page layout urls still point to the old database

Navigation not showing – displays – ‘Error’

This was an easy one, simply restart the application pool and it should go away.

Unfortunately before I figured this out I thought there had been a problem during the content database upgrade so I deleted the upgrade database and restored the 2007 database tried to rerun the upgrade, at which point I kept getting error number 2.

When rerunning a database attach Upgrade it fails with two errors, in the log the error is Exception: ‘Object reference not set to an instance of an object.’

The was also easily rectified, this happens when you try to rerun an upgrade from within the same command window as previous upgrade, close your powershell window and restart it.

Page layout urls still point to the old database

As part of the upgrade I was moving the site to a new domain, this may also be the case if you are moving a content database to another environment, say your test or development environments.

I had to download the lapontie PowerShell extensions and run the following to remove the wrong url and change it to a relative path.

Get-SPWebApplication "http://<newwebapp>" | Repair-SPPageLayoutUrl -RegexSearchString "(?:http://)" -RegexReplaceString "/"

Advertisements

About SharePoint Surfer

A SharePoint professional working in local council, experiencing the pointy end of SharePoint.

Posted on March 6, 2012, in SharePoint, upgrade and tagged , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: