Upgrading to TFS 2008 was hard work

by: Per Bjurström

So, finally we upgraded to Team Foundation Server 2008 on the demo day of sprint 8, about 20 minutes into the upgrade I received this error:

TfsDb.exe upgrade /server:"XXX" /property:"TFS_SERVICE_ACCOUNT=XXX;TFS_REPORTING_ACCOUNT=XXX;LCID=1033;VSTF_AS_INSTANCE=XXX;VSTF_AS_DATABASE=TFSWarehouse;VSTF_AS_ACCOUNT=" /showui:131402' returned non-zero value: 100.

After some googling I found that the common knowledge(even from MS) is that you should hit Retry up to 4 times and so I did but the problem did not go away. Next step was to look at the log file which is located in the temp folder and called VSMsiLogXXX.txt:

SQL Error #1
SQL Message: The login already has an account under a different user name.
SQL LineNumber: 1
SQL Source: .Net SqlClient Data Provider
SQL Procedure:
SQL Error #2
SQL Message: User or role 'XXX' does not exist in this database.
SQL LineNumber: 75
SQL Source: .Net SqlClient Data Provider
SQL Procedure: sp_addrolemember

System.Data.SqlClient.SqlException: The login already has an account under a different user name.
User or role 'XXX' does not exist in this database.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.TeamFoundation.DatabaseInstaller.DataDeployer.ExecuteSql(SqlConnection sqlConnection, String batch)
   at Microsoft.TeamFoundation.DatabaseInstaller.DataDeployer.ExecuteSql(String connectionString, String batch)
   at Microsoft.TeamFoundation.DatabaseInstaller.DataDeployer.AddAccount(String account, String role)
   at Microsoft.TeamFoundation.DatabaseInstaller.Installer.RunDbActions(InstallerMode mode, String server, Boolean preview)
   at Microsoft.TeamFoundation.DatabaseInstaller.Installer.RunSteps(InstallerMode mode, String server, IPropertyCollection properties, Boolean preview)
   at Microsoft.TeamFoundation.DatabaseInstaller.Installer.Upgrade(String server, IPropertyCollection properties, Boolean preview)
   at Microsoft.TeamFoundation.DatabaseInstaller.CommandLine.Commands.CommandUpgrade.OnRun()
   at Microsoft.TeamFoundation.DatabaseInstaller.CommandLine.Commands.InstallerCommand.Run()
   at Microsoft.TeamFoundation.DatabaseInstaller.CommandLine.CommandLine.RunCommand(String args)

After some poking around in the database I found out that the TFSService account was mapped to the DBO user in the TfsWarehouse database and guessing that the upgrade did not like that, so I executed the following query to change the owner to the setup user instead:

EXEC sp_changedbowner 'XXXX\TFSSetup'

And, after pressing Retry again the installer went through. Thank god!

But, only to find out that Sharepoint could not be upgraded to version 3 due to the fact that the Scrum for Team System v1.2 for some unreason uninstalled itself from Sharepoint even though there were sites there using it. The Sharepoint prescan.exe tool could not load these sites using the sharepoint API and that's a requirement for the upgrade. By the way, I found this ammusing text in the Sharepoint docs:

“Upgrade is a detailed and complicated operation. Even in relatively basic environments, there may be customizations that do not lend themselves to a smooth and simple upgrade. These customizations, and many other variables, are outside of the control of the upgrade process and may cause the in-place upgrade to fail.”

No kidding. So, I ended up deleting the Scrum document libraries because that was the only solution I found. The process templates for Scrum for Team System 1.2 cannot be upgraded and cannot run side by side so uninstalling them was the only solution, for the v2 version they will support upgrades going forward.

Have a nice weekend!

15 February 2008

Tags:


Comments

  1. I had pretty much the same experience when upgrading to TFS 2008. Not the same error messages, but the solution "Just hit retry a couple of times", to my surprise, actually worked..!
  2. I tried after multiple restore and still was receiving the same error. I did changed the owner as indicated here and it worked. Wish I found this two days earlier.
Post a comment    
User verification Image for user verification  
EPiTrace logger