TFS2010: How to make Beta1 SharePoint sites work after upgrading to Beta2

Grant Holliday’s blog

Senior Service Engineer, Microsoft Visual Studio Team Foundation Service

TFS2010: How to make Beta1 SharePoint sites work after upgrading to Beta2

  • Comments 0

Just like my last blog post on uploading the beta2 process templates to an upgraded beta1 server, I’ll admit that the audience for this blog post is also small. However, we hit this after upgrading our VSTS Pioneer Dogfood TFS server from Beta1 to an early Beta2 build last weekend.

I’m fortunate to share an office with another Australian (Hi Phil!) who happens to be on the ‘Process’ team that builds all the TFS SharePoint templates & dashboards, so we were able to diagnose & fix this issue quickly this morning.

Note: These steps will only allow you to get access to the content that existed when it was a Beta1 server – most of the dashboards will be broken because of warehouse schema changes between TFS Beta1 & Beta2.

Symptoms

After you upgrade a TFS2010 Beta1 server to a Beta2 build, you may not be able to access your old SharePoint sites. You’ll receive a SharePoint error page that says “File Not Found”. This can also happen if you take the SharePoint content database from a Beta1 server and attach it to a new Beta2 server. When debugging SharePoint issues, sometimes browsing to /<site>/_layouts/viewlsts.aspx will give you an idea if the site actually exists or if it’s completely broken. In this case, browsing to viewlsts.aspx shows all the document libraries but they all show ‘File Not Found’ when you browse through to them.

SharePoint File Not Found error

Cause

The reason this happens is because between TFS2010 Beta1 and Beta2, the dashboards team were working on SharePoint 2010 compatibility. One of the things they identified is that the existing approach of TFS having it’s own master page didn’t work too well (or look very pretty) when somebody used SharePoint 2010. So they made changes to the TFS templates to use the default SharePoint master page & style everything with a SharePoint theme (i.e. using CSS).

The unfortunate side-effect is that on a clean SharePoint server that only has the Beta2 version of the TFS SharePoint extensions installed, the master page from Beta1 doesn’t exist on disk – therefore SharePoint can’t display any pages that refer to that master page (i.e. most of them).

Resolution

I’m sure there are many other ways to solve this (write an app, write a PowerShell script, etc) but this is the one that we used.

The first thing you need to do is download the “SharePoint Manager 2007” application to edit the properties on each of the sites. http://www.codeplex.com/spm. This must be run on the SharePoint server and it must be run as an Administrator (SharePoint 2007 doesn’t have a separate installable object model and even if it did, connecting to a remote farm isn’t possible).

When you open SharePoint Manager, you’ll need to browse down into Content Service > Web Applications > Default Web Site > Site Collection > Your Beta1 Site Collection URL > Your Beta1 Site Collection Name > Webs > Select a web (see screenshot)

SharePoint Manager 2007

The MasterUrl is the property that you need to change to remove the ‘File Not Found’ error and get access to your site.

Beta1

/sites/<collection>/<site>/_catalogs/masterpage/dashboards.master

Beta2

/sites/<collection>/<site>/_catalogs/masterpage/default.master

There are two other things you need to do if you want your Beta1 sites to look like Beta2 sites.

  1. Clear the AlternateCssUrl property. (In Beta1 it was set to /_layouts/1033/STYLES/Microsoft.VSTS.Process.Dashboards/css/dashboards.css)
  2. Change the theme of the site to the Team Foundation Dashboards (TFSDASHBOARDS) theme. This theme is stored in: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\THEMES\TFSDASHBOARDS

Once again, there are multiple ways to add a new theme & apply it to the site, but this one worked for us. Before you can select the TFSDASHBOARDS theme, you need to add it to the list of available themes.

On a web frontend server, open the following file and add a new <Template> definition: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\1033\SPTHEMES.XML

<Templates>

  <TemplateID>TFSDASHBOARDS</TemplateID>

  <DisplayName>Team Foundation Dashboards</DisplayName>

  <Description>A blue-grey theme for Team Foundation Server Dashboards</Description>

  <Thumbnail>images/thwheat.gif</Thumbnail>

  <Preview>images/thwheat.gif</Preview>

</Templates>

Then restart IIS. (Think these steps are crazy? That’s the official way from the SharePoint docs on MSDN, How to: Customize Themes).

Then you should be able to go to Site Action > Site Settings > Look and Feel > Site theme (/_layouts/themeweb.aspx) and select the ‘Team Foundation Dashboards’ theme.

Changing SharePoint site theme to TFS Dashboards theme 

Hope this helps