/ #PowerShell 

SharePoint 2007 to 2010 upgrade issue with navigation

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.

addcontentdb

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:

Werkend menu

Script 1 – Creating Libraries

1: [Void][System.Reflection.Assembly]::LoadWithPartialName
2:   ("Microsoft.SharePoint")
3: [Void][System.Reflection.Assembly]::LoadWithPartialName
4:   ("Microsoft.SharePoint.Publishing")
5:
6: function CheckaWeb($rootweb)
7: {
8:   #Step 1 Check For Lists
9:   $list = $rootweb.Lists[$from];
10:   if($list
-ne $null) {createList $rootweb $list}
11:
12:   #Check for subwebs
13:   if($rootweb.Webs
-ne $null)
14:   {
15:     # Recursive Call To SubWeb
16:     foreach($web in $rootweb.Webs)
17:     {
18:        CheckAWeb $web
19:     }
20:   }
21: }
22:
23:
24: function createList ($web, $list)
25: {
26:   Write-Host -ForegroundColor Green
27:           " Found a web containing a PageList on url" $web.Url
28:
29:   $web.Lists.Add("Paginas",
30:             "Automatisch gegenereerde bibliotheek voor 
31:              SharePoint 2010 upgrade", 101) 
32: }
33:
34:
35: Write-Host ""
36: Write-Host -ForegroundColor Green
37:     "Fix Dutch SharePoint 2010 Upgrade Script v1.0 - Albert-Jan Schot "
38: Write-Host -ForegroundColor Green
39:     "contact appie@tamtam.nl"
40: Write-Host ""
41:
42: $site=new-object Microsoft.SharePoint.SPSite('http://restore.sp2010.dev')
43: $from = "Pagina's"
44:
45: Write-Host -f Blue ""
46:
47: CheckaWeb $site.Rootweb $true
48:
49: Write-Host ""
50: Write-Host -f Blue "Done checkin webs"
51: Write-Host ""