SharePoint 2007 to 2010 upgrade issue with navigation

SharePoint 2007 to 2010 upgrade issue with navigation header image

Upgrading a SharePoint 2007 to a SharePoint 2010 environment and all options you have is something that is handled quite well on the web, personally i love this post on how to do it, but there are several other posts out there making it pretty easy. However I ran into a ‘small’ bug upgrading. I have a SharePoint farm containing some info, and a Dutch language pack, thus I recreated the same environment as a SharePoint 2010 containing a Dutch language pack, and using a database upgrade. And as you can see in the picture below, there are no errors,and adding the content DB went well as expected.

However, the results when looking at in the browser where kind of sad:

Foutmelding menu

After a long search on the web someone mentioned turning off and on the Publication Infrastructure for SharePoint, turning it of resolved the issue, but turning it on again instantly returned it. So I found myself struggling with the issue for another day not being able to find the exact bug, but nice fix. Apparently the Menu control expects a /paginas library that contains the pages, but it isn’t there, so it throws an error, since I didn’t want to change my farm to much I created a small PowerShell scripts that would fix the error. The result is a working site:

Werkeend menu

Script 1 – Creating Libraries

[Void][System.Reflection.Assembly]::LoadWithPartialName
  ("Microsoft.SharePoint")
[Void][System.Reflection.Assembly]::LoadWithPartialName
  ("Microsoft.SharePoint.Publishing")
function CheckaWeb($rootweb)
{
  #Step 1 Check For Lists
  $list = $rootweb.Lists[$from];
   if($list -ne $null) {createList $rootweb $list}

   #Check for subwebs
   if($rootweb.Webs -ne $null)
   {
     # Recursive Call To SubWeb
     foreach($web in $rootweb.Webs)
     {
        CheckAWeb $web
     }
   }
 }


 function createList ($web, $list)
 {
   Write-Host -ForegroundColor Green
           " Found a web containing a PageList on url" $web.Url

   $web.Lists.Add("Paginas",
             "Automatisch gegenereerde bibliotheek voor
              SharePoint 2010 upgrade", 101)
 }

 Write-Host ""
 Write-Host -ForegroundColor Green
     "Fix Dutch SharePoint 2010 Upgrade Script v1.0 - Albert-Jan Schot "
 Write-Host -ForegroundColor Green
     "contact appie@tamtam.nl"
 Write-Host ""

 $site=new-object Microsoft.SharePoint.SPSite('http://restore.sp2010.dev')
 $from = "Pagina's"

 Write-Host -f Blue ""

 CheckaWeb $site.Rootweb $true

 Write-Host ""
 Write-Host -f Blue "Done checkin webs"
 Write-Host ""
Loading comments…