If you're using Beta 3 Refresh, you may be wondering what you can do now to make the server upgrade to RTM as painless as possible. Here are a few things that will help.
-
If you customize work item types, don’t create work item field reference names that have more than 70 characters, or that begin with a number.
-
If it’s not too late, deploy Team Foundation Server on the hardware you’re going to use at RTM.
-
If you are going to deploy to new hardware, go ahead and install Team Foundation Server on the new hardware and try it out just to make sure you don't have configuration issues. You can uninstall Team Foundation prior to upgrading.
-
Keep track of the customizations you’re making to the process templates; you’ll need to do these again before you’ll be able to create new projects with your custom process templates.
I’ve included the specification below so that you can get a better idea of what the upgrade will be like and let us know if you feel like we haven’t covered your scenario. Keep in mind that this isn’t final, but the actual upgrade will be similar to what’s described here.
Allen Clark
Program Manager, Team Foundation Server
Design Goals
When V1 ships, customers must be able to upgrade their data without support from Microsoft.
-
Upgrading to RTM will not be effortless, but the work required must be reasonable.
-
Customers should not get into a server-down state unexpectedly.
-
Minimize the impact on the Setup team.
Scenarios
The section describes a few key upgrade scenarios.
Single Server
Sid is a senior developer on a small team that adopted Team Foundation at Beta 3 and upgraded to Beta 3 Refresh. He installed TFS on a server in his office and helped the other developers and the project manager get started. He has just received the RTM CDs, and he promptly begins to install this new version of TFS (the atdt single server installation). His only option is to uninstall the previous version, so he does that and runs setup again. Setup blocks on two conditions
- He is still using the evaluation version of SQL Server 2005 that was used with Beta 3 Refresh.
- The database schema versions don’t match. Here, setup directs Sid to the MS download center for instructions on upgrading his server.
He installs the non-evaluation version of SQL Server, downloads the upgrade package, and follows the upgrade instructions, which are outlined below.
- Download any custom process templates from Team Foundation onto disk.
- Save a copy of each custom report external to the Reporting Services database. (Ideally, these should be checked in to source control).
- Extract the work item changed event data so that they can be recreated after the upgrade. A SQL statement will be provided in the detailed upgrade instructions that can be executed using SQL Server Management Studio
- Uninstall Team Foundation application and data tiers.
- Run TfsUpgrade.exe on the application tier.
- Install Team Foundation application and data tiers, and at least one client.
- Smoke test the installation using the instructions in the upgrade download package.
Several team members are aware that Sid is upgrading Team Foundation, so they go ahead and install the RTM client. During the time that the upgrade is running, some of these team members attempt to connect to Team Foundation. While Sid is performing steps 4-6, the clients fail to connect because Team Foundation is not installed on the servers. The team members with RTM clients are able to connect during Sid’s smoke tests. At the end of the upgrade process, TfsUpgrade.exe returns the databases to an accessible state and the clients are able to use the upgraded system.
Others on the team were already connected using the Beta 3 Refresh client. When they attempt to check in code, update work items, or otherwise work with Team Foundation, they are unable to do so because the Beta 3 Refresh client doesn’t work with the RTM server.
When Sid completes the final smoke test, he lets his team know that they should install the RTM client.
Dual Server Reinstall with Custom Process Template
Barb manages Team Foundation servers for an international corporation. When RTM ships, she has multiple servers in production at 3 locations. Although she considered traveling to each site to perform the upgrades, she has decided to execute the upgrades remotely. She has the CD in a drive on a machine that all three sites can access. She has notified her users that Team Foundation will be offline and that they’ll need to upgrade their client to RTM when it comes back online. She follows the instructions – she downloads the upgrade tool, uninstalls TFS, backs up her databases, installs and smoke tests the installation, upgrades the databases, and smoke tests the upgraded installation.
Barb has four custom process templates in use at all three locations. They contain custom work item types, work item instances, custom reports, and a customized portal template. Before upgrading, she downloads the custom process templates. She has some custom reports that are not included in a process template. Most of those are saved in source control, so she doesn’t have to do anything to save them locally. She scans the existing projects and finds a few reports that are not in source control, so she downloads those from Reporting Services and adds them to source control prior to the upgrade.
After the upgrade, Barb loads the custom reports in the Report Designer and modifies them to work on RTM. She uploads the reports to each project that uses them using rs.exe.
Next, Barb upgrades her custom process templates. Since she started with the MSF for Agile Software Development process template as her starting point, she downloads the RTM version and uses that to create her custom process template for RTM. She refers back to the Beta 3 Refresh version she saved prior to upgrading. She compares the work item types from the RTM work item types to hers and modifies her work item types so that the only changes between them and the RTM Agile work item types are her customizations. Barb adds the custom work item types, reports, and portal template to her new process template and uploads it. She creates test projects to make sure that the new process templates work properly. They don’t, so she debugs the problem, fixes the process templates and tries again. After she’s worked out the kinks in the new process template, she deletes the test projects.
Move to New Server
Takeya is an IT development manager working at a Japanese company with very specific rules about Beta software. Because of these rules, he deployed Beta 3 Refresh in a private domain instead of the corporate domain. Also, because the company doesn’t allow any trusts between the corporate and private domains, users used separate accounts in the private domain for accessing Team Foundation. Takeya is installing Team Foundation on new servers in the corporate domain.
Takeya begins by upgrading his Beta 3 Refresh databases on the existing servers, and verifies that the upgraded systems function properly. Having successfully upgraded, he is ready to migrate his TFS installation into the corporate domain.
He installs the prerequisites on the new servers in the corporate domain, then restores his backups of the upgraded databases, and installs Team Foundation.
The new server has a different name from the old server, so he uses TfsAdminUtil.exe ActivateAT to restamp the registration data to the new servers. It’s also running under a different service account – an account set up in the corporate domain.
Because he changed domains, he runs TfsAdminUtil.exe ChangeAccount. This will update each user account from the old domain to the use the account of the same name in the current domain if it exists. For example PRIVATE\nabuko is replaced by CORP\nabuko.
Takeya checks that basic functionality works and notifies his team that they should install the RTM client.
Retry
Ed manages the Team Foundation Server for a medium IT development team. He follows the instructions for upgrading to RTM. However, during the upgrade process, there is a network failure, so the upgrade fails. The upgraded databases are left in the state they had reached when the network failure occurred.
He can see in the output from TfsUpgrade.exe, and from the logs, that the failure was due to a network failure and he is aware that his network has intermittent problems. He runs TfsUpgrade.exe again, choosing to upgrade, and the upgrade picks up where it left off. The upgrade runs to completion, so he completes the upgrade instructions and sends notification to the team that they can connect with the RTM client.
Support and Recovery
Brenda leads a small IT development team. She installed Team Foundation Server Beta 3 Refresh and has just received the RTM CDs. She follows the upgrade instructions, but the upgrade fails because of an unhandled data inconsistency. She attempts to run TfsUpgrade.exe again, but it fails in the same way. She reports the problem to PSS. PSS looks at the problem and escalates it to the product team, who requests backups. She takes backups of the databases and posts them to an FTP site established by support. She restores her Beta 3 Refresh backups, installs Beta 3 Refresh Team Foundation, verifies basic functionality, and sends email to her team that the Team System was not upgraded, but that it is back up.
The Upgrade QA team copies Sarah’s backups to a server where they can be maintained (the support FTP site only retains files for 96 hours). The development team fixes the problem and a new version of TfsUpgrade.exe is prepared & verified by QA. This new version is sent to Sarah, and posted to the MS download site.
Sarah takes the new version of TfsUpgrade.exe and attempts to upgrade again. She runs into another unhandled data inconsistency. Again, she contacts support. In this case, the problem is something that’s already been encountered, and there’s a new version of TfsUpgrade.exe that fixes the issue recently posted to the MS download site. Sarah takes the new version of TfsUpgrade.exe and uses that to successfully upgrade her databases. She finishes the upgrade steps and notifies her team that they can begin connecting with the RTM client.
Design
TfsUpgrade.exe is a command line tool that allows the user to upgrade his databases from Beta 3 Refresh to RTM. It upgrades the data and schema, including the schema version for each database. It does not update the stored procedures of the operational stores. The stored procedures are updated by Setup. Other utilities are provided for specific operations.
Upgrade Download Contents
The upgrade download will contain the upgrade utility, instructions, and supporting utilities.
Upgrade Instructions.doc The upgrade instructions.
Smoke Test Instructions.doc The instructions for smoke testing the upgrade.
TfsUpgrade.exe The upgrade utility.
TfsChangeReferenceName.exe Utility to change the reference name of work item field.
TfsBindDocument.exe Utility to rebind an mpp file or list in an xls to the server.
UploadAgileReports.rss Sample script to upload Agile reports.
UploadCMMIReports.rss Sample script to upload CMMI reports.
Components
There are two components – the command line utility and the scripts that perform the upgrades.
Command Line Utility
TfsUpgrade.exe is the command line utility that is used to upgrade the databases. It blocks access to the databases, calls the scripts to perform the necessary upgrades, then deletes the reports for the existing projects from Reporting Services.
- Block access to the role used by the application tiers
- Call the scripts
- Delete the reports for each Team Project from Reporting Services.
Step 1 ensures that clients can’t access the databases until Team Foundation is installed again. (This is a safeguard to prevent access when the customer fails to uninstall Team Foundation before running the upgrade.)
TfsUpgrade.exe handles errors that occur in the scripts, logs them, raises Watson errors and outputs the specific information about the error.
Usage: TfsUpgrade [–s <data tier server>]
When TfsUpgrade is run on the data tier, the data tier server name can be omitted.
Scripts
The components that perform the actual upgrades are referred to as the scripts. Typically, these are SQL statements or batches, but they may be .exe’s as well. Each script performs a specific task. For example, a script might insert a column and some default values in a table. There are five groups of scripts, roughly associated with the databases. Some of the changes these scripts will perform are listed here. There are also two databases – TfsWarehouse and TfsActivityLogging – that are dropped and recreated by setup.
Integration Services – TfsIntegration
As a result, reference names created before RTM may be invalid. Rather than attempt to automatically rename the fields, TfsUpgrade.exe will simply fail and indicate which fields are invalid, and why. For example,
The following field reference names have more than 70 characters:
Long.Reference.Name.1….
Long.Reference.Name.2…
…
Please use TfsChangeReferenceName.exe to rename the field and try again.
TfsChangeFieldReferenceName.exe will be provided in the upgrade download.
Usage: TfsChangeReferenceName.exe [–s <data tier server>] <old name> <new name>
If run on the data tier server, the server does not have to be specified.
Build – TfsBuild
Add schema version to the database.
Test Results – TfsBuild (the test results portion)
Because test results are only loaded if the correspond .trx files are present in the drop location, results will not get reloaded if the .trx files have been deleted.
Activity Logging – TfsActivityLogging
Activity Logging is dropped by TfsUpgrade.exe and recreated by setup. The historical logging information is not maintained.
Reporting Warehouse – TfsWarehouse
The reporting warehouse is dropped by TfsUpgrade.exe. Setup will recreate the database, and the first time the warehouse adapters run, they will update the tables and cubes using the RTM schema definition and then load the data.
Figure 1 - Upgraded Data
The scripts are coded to be resilient to errors and unexpected data conditions, and to handle errors and raise them in the way that the TfsUpgrade.exe command line utility expects. The command line utility will log the errors.
The scripts must also be written in a way that they can be called repeatedly. This allows a user to correct errors (like network connectivity problems) and rerun the upgrade utility, skipping over work that has already been done. For example, if there is a power failure during the third script, then the first two scripts should detect that they are not necessary and do nothing, and the third script should be able to complete the partially completed script. To be more specific, if the third script creates a column in a table, then calculates values and inserts them in the table, it should be able to deal with the fact that the column may already exist, and that some of the values have already been calculated.
The command line utility also deletes the warehouse relational and OLAP databases and the activity logging databases. During setup, these databases will be recreated and when setup is completed, the warehouse will be repopulated.
Decision Flow
Each script determines, based on the schema version of the database on which it operations, what action to take, as shown in Figure 2 – Upgrade Decision Flow. If the database doesn’t exist, then the script does nothing. If the database exists and is current, again the script does nothing. If the database exists and is an unsupported version, then the script returns an error indicating that the database is an unsupported version. The error includes the schema version if it’s known.
If the database is a supported version (Beta 3 Refresh), then the script upgrades the database. After the database is fully upgraded, the schema version is updated.

Figure 2 – Upgrade Decision Flow
For Setup, the decision is flow is simpler, as seen in Figure 3 - Setup Decision Flow. If none of the Team Foundation databases exist, then Setup continues. If they do exist, but are at the current schema version, then Setup continues. If one of the databases exists, but is not at the expected schema version, then Setup blocks and indicates that the databases must be upgraded.
Figure 3 - Setup Decision Flow
Schema Versions
Each database maintains a schema version used to determine whether the application tier can work with the database, and whether an upgrade is necessary. In most cases, the schema version is literally a version stored in the database, but TfsBuild and TfsIntegration don’t have this in Beta 3 Refresh. Those databases will some other indicator to determine whether a pre-RTM database is Beta 3 Refresh or some other version. The schema version will be added to both in RTM.
The RTM (and RC) version of each application tier will check the schema version and refuse to start if it’s not a compatible version. This prevents users from accessing Beta 3 Refresh databases that have been restored from backups after the RTM or RC application tier has been installed.
We hope that the RC and RTM versions are compatible. If not, then the RTM version will be prevented from connecting to RC databases in the same way it is prevented from connecting to Beta 3 Refresh databases.
Setup Interaction
Setup will call a stored procedure that will indicate whether the databases need to be updated. If they do need to be updated, Setup will direct users to the download center to obtain TfsUpgrade.exe and instructions for upgrading the databases.
After the databases are upgraded, the data tier setup installs the updated stored procedures in the operational store databases. The activity logging database and the warehouse are recreated.
Manual Upgrade Steps
Some of the data is not upgraded automatically. Each of those is described here, along with the mechanism for upgrading them manually.
Work Item Queries
In Beta 3 Refresh and earlier versions, work item tracking used account names instead of friendly names for fields like Assigned To. The RTM version uses friendly names. Queries that use those fields and are set to an account name will return empty result sets. This will not be updated by the upgrade utility. Instead, users will have to manually update these queries.
Work Item Changed Event Subscriptions
Work Item Changed event subscriptions store account names in Beta 3 Refresh. These will not work in RTM, so they’ll be deleted. The subscriptions can be created manually using the data extracted from the subscriptions table prior to upgrading.
Reports
The data warehouse changed significantly between Beta 3 Refresh and RTM, and so the reports that were created for Beta 3 Refresh will not work against the RTM warehouse. As a result, those reports must be deleted and replaced by new reports. For stock reports, the new version of the reports are taken from the new process template, and then uploaded to the server. To make this less cumbersome, a sample Reporting Services script will be provided that uploads the Agile reports into a project – UploadAgileReports.rss - and another for the CMMI reports – UploadCMMIReports.rss. The user will modify the script to specify the server and project and use rs.exe <script> to upload his reports in each project.
Rs.exe is delivered with SQL Server 2005 Reporting Services.
Custom reports will have to be modified to use the new warehouse schema. They can be uploaded with a modified version of the reporting services scripts, or they can be deployed to the server directly from the Reports project.
Documents
Excel lists and MS Project files bound to Team Foundation work items will continue to work after the upgrade, with the exception of those that are bound to work item queries that are broken. (See Work Item Queries, above).
If Team Foundation is moved to a new server, then the existing documents must be updated using TfsBindDocument.exe.
Project Portals
The Team Project portals are not upgraded. They can be modified manually to reflect changes made in the site templates between Beta 3 Refresh and RTM.
Process Templates
The old process templates that are delivered in the box – the two MSF process templates - will be replaced by the new version during setup. If these have been customized and saved by the same name, they should be downloaded prior to upgrading.
The process templates will be manually updated. The approach will depend on the extent of customization. For example, a process template that has a few changes to MSF for Agile Software Development would best be handled by starting with MSF for Agile Software Development and making those changes again.
Variables
This section is intended to highlight variables that should be accounted for in the test plan.
Version
The following table describes which upgrade paths are supported. Upgrading from Beta 3 to Beta 3 Refresh involved no data upgrades. We hope that upgrading from RC to RTM will be the same, but there is a possibility that we'll have to take a change that forces us to upgrade the database schema or manipulate the data.
B3 to B3R Yes (reinstall)
B3R to RC Yes
B3R to RTM Yes
RC RTM Yes (should be a reinstall)
B2 to any No (blocked)
CTP to any No (blocked)
Configuration
- Single server vs. Dual server
- Domain vs. Workgroup
- Team Foundation Workgroup vs. Team Foundation (full)
- Changing configurations
SQL Server
- Standard Edition: warehouse will not have perspectives.
- Enterprise Edition: warehouse will have perspectives.
- Standard Edition to Enterprise Edition: Should add perspectives
- Enterprise Edition to Standard Edition: Should remove perspectives
- Developer Edition (pri 3): Should be the same as Enterprise Edition
Other
- Changing servers: see the scenarios for details
- Changing domains: see the scenarios for details
- Users accessing the system during upgrade: blocked during upgrade
- Locale: the upgrade may take place on servers that are not US-English