Monday, May 25, 2009

VSS => TFS Migration

Now that I have the TFS installed to play with, my next task is to come up with the process to transfer existing projects from Visual Source Save. Since the current VSS database is fairly huge, and we do not want to transfer the whole thing at once, I came up with the following process:


  • Select project(s) to be transferred from VSS database

  • Back up project(s) and restore them to the new VSS database

  • Fix the issues in the new VSS database with the Analyze tool

  • Run the VSSConverter tool in analyse mode

  • Get the TFS ready for migration

  • Prepare the migration settings file

  • Run the VSSConverter tool in migration mode

  • Verify the results of the migration

This may look rather lengthy and complex, but it makes sure that the current VSS database remains untouched, which is quite important for obvious reasons.

Here is how I migrated a small project from VSS to TFS in a few more detail:

Select project(s) to be transferred from VSS database

Let's say we want to transfer MySmallProject which is located in $/MyMiscProjects/MySmallProject in a large VSS database.

Back up project(s) and restore them to the new VSS database

Microsoft has two utilities for backing up and restoring VSS projects, SSARC and SSRESTOR. Their parameters are described in detail here:

SSARCSSRESTOR

They usually can be found in the SourceSafe folder (i.e. C:\Program Files\Microsoft Visual SourceSafe)

First, I create a new VSS database (VSSTransfer) where I'm the admin. Next, I need to have admin rights in the initial VSS database and, of course, to know where it is located. Then I can run the SSARC command like that:

ssarc -d- -i -yadmin,password -s\\PathToVSSDB\MyHugeVSSDB CodeProject.ssa "$/MyMiscProjects/MySmallProject"

This backs up the MySmallProject with default parameters, without deleting files from the old database "MyHugeVSSDB", into the CodeProject.ssa archive file.

Next, I restore the project into the new empty database I created.

ssrestor "-p$/MySmallProject" -sC:\VSSTransfer -yadmin,password CodeProject.ssa "$/MyMiscProjects/MySmallProject"

Fix the issues in the new VSS database with the Analyze tool

This is just running the Analyze tool with the -F parameter to fix possible issues in the VSS.

Run the VSSConverter tool in analyse mode

The VSSConverter is a Microsoft tool that comes with the TFS and allows migrating data from VSS database into the TFS database. More info here:

VSSConverter Command-Line Utility for Source Control Migration

To run the VSSConverter, a settings file has to be prepared first. Here is the sample:














(if we need to transfer multiple projects, there can be multiple 'Project' elements under 'ProjectMap')

Now I save the file as settings.xml and run the VSSConverter tool (which is located in drive:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE ):

VSSConverter analyze settings.xml

(An important note, though - the VSSConverter should be the one that comes with TFS SP1. I tried to use the tool from the original TFS install and got troubles with history - it was not migrated at all).

Two files will be created, Analysis.xml and UserMap.xml

Get the TFS ready for migration

First of all, create the target project, i.e. MyTFSSmallProject. Then, look at the UserMap.xml. It lists all VSS users who performed action in the database. It looks like this:


xmlns:xsd="http://www.w3.org/2001/XMLSchema">




To map users properly, we need to add them to TFS. If the user no longer exists, he can be mapped to any user - TFS admin or his team leader, for example. So the UserMap.xml will end up looking like this:


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">




Prepare the migration settings file

Modify the settings.xml file to specify the SQL Server that is going to be used for the migration process and Team Foundation Server, the users map file and the destination project on the TFS as follows and save it as migration_settings.xml. The SQL server does not have to be the one where TFS database are located, and the user performing the migration need to have CREATE DATABASE permission in the SQL Server.


















Run the VSSConverter tool in migration mode

Run the VSSConverter tool in migration mode as follows:

VSSConverter Migrate migration_setting.xml

A report file called VSSMigrationReport.xml will be created if the migration process runs successfully. A log file called VSSConverter.log will contain information messages about the migration process.

Verify the results of the migration

Log in to TFS, go to the project's Source Control Explorer, check the files, history etc. Get the latest version, build it. Have fun.

Friday, May 15, 2009

TFS Disaster Resolved

Okay, so today the TFS was finally installed. Unfortunately, I cannot tell for sure what the exact thing that fixed it was, because we changed more than one thing. Firstly, the reporting services were uninstalled completely from the data tier. Secondly, we found some information on slipstreaming the SP1 for TFS 2008 and applied it to the installation package.

Creating a TFS 2008 with SP1 Slipstreamed ISO image

And lastly, we ran the installation from the beginning ... again. I personally think that removing the reporting services from the data tier did it. We'll need to have reporting services on the data tier later, we'll see if installing them back will break TFS or not. But for now, this weight is off my shoulders.

by . Also posted on my website

Thursday, May 14, 2009

TFS/IIS Disaster Update

I got a response from the Microsoft support person, who have told me earlier that he was able to reporoduce our error.

So, according to what he told me, he looked up some internal documentation and found out that the particular configuration that we are trying to use (Windows Server 2003 on application tier, Windows Server 2008 on data tier) may not have been properly tested. So far, the recommendation is to install reporting services on the application tier. (Later, he said, we will be able to move them to the data tier).

There were a few issues because of the Sharepoint that was not completely removed from the application tier before we started the reinstallation of the TFS, but the most interesting was the "Error 29000.The Team Foundation databases could not be installed. For more information, see the Microsoft Windows Installer (MSI) log."

That was a bit tricky, because both admin and service account for the TFS had all possible permissions on the data tier. Some log file reading and some searching, and I found out that this is the issue with analysis services permissions.

Problem in doing TFS2008 SP1 upgrade

The account should be a member of the “Server Role is used to grant server-wide security privileges to a user” under analysis services->properties->security option should be the TFS Service account. (There is no need to add the TFS Setup account or the TFS Report account here).

Now, the question was ... what error would come up next?

Next one was the Error 28805.The setup program cannot complete the request to the server that is running SQL Server Reporting Services. Verify that SQL Server Reporting Services is installed and running on the Team Foundation app tier and that you have sufficient permissions to access it. For more information, see the setup log.

OK, that was our mistake. The reporting services were removed from the data tier and installed on the app tier, but the databases were never created. Even the SQL Server was not installed yet on the application tier.

With that fixed, we moved forward just to finally hit the wall.

"Error 29112.Team Foundation Report Server Configuration: Either SQL Reporting Services is not properly configured, or the Reporting Services Web site could not be reached. Use the Reporting Services Configuration tool to confirm that SQL Reporting Services is configured properly and that the Reporting Service Web site can be reached, and then run the installation again. For more information, see the Team Foundation Installation Guide."

And what happens here remains a mystery for me so far.

This is what I see in the installation log:

"Setting database connection...

Verifying the configuration of SQL Server Reporting Services...
SQL Server Reporting Services status Name: ReportServerVirtualDirectory Status: Set Severity: 1 Description: A virtual directory is specified for this instance of report server.
SQL Server Reporting Services status Name: ReportManagerVirtualDirectory Status: Set Severity: 1 Description: A virtual directory is specified for this instance of report manager.
SQL Server Reporting Services status Name: WindowsServiceIdentityStatus Status: Set Severity: 1 Description: A Windows service identity is specified for this instance of report server.
SQL Server Reporting Services status Name: WebServiceIdentityStatus Status: Set Severity: 1 Description: A web service identity is specified for this instance of report server.
SQL Server Reporting Services status Name: DatabaseConnection Status: Set Severity: 1 Description: A report server database is specified for this report server.
SQL Server Reporting Services status Name: EmailConfiguration Status: NotSet Severity: 2 Description: E-mail delivery settings are not specified for the report server. E-mail delivery is disabled until these settings are specified.
SQL Server Reporting Services status Name: ReportManagerIdentityStatus Status: Set Severity: 1 Description: A report manager identity must be specified.
SQL Server Reporting Services status Name: SharePointIntegratedStatus Status: NotSet Severity: 2 Description: The report server instance supports SharePoint integration, but it currently runs in native mode. If you want to integrate this report server with a SharePoint product or technology, open the Database Setup page and create or select report server database that can be used with a SharePoint Web application.
SQL Server Reporting Services status Name: IsInitialized Status: OutOfSync Severity: 3 Description: The report server is not initialized.

Verifying SQL Server Reporting Services configuration status failed.

Error: ErrorCheckingReportServerStatus.

Configuring SQL Server Reporting Services failed."

But why? I have no idea. Here is what happens:

I open Reporting Service Configuration Manager, go to "Database Setup" and notice that the "Server Name" is pointing to the data tier, and the "Initialization" shows a grayed cross against it. So I point it to correct server, Press "Connect", "OK", "Apply" and enjoy a lot of green ticks in the "Task Status" and a grayed cross being changed to grayed tick.

Voila! Reporting Services configured properly and initialized. I can go to http://localhost/reports and see the proper "SQL Reporting Services Home Page".

So I switch back to my error and press "Retry". The installer thinks for a while, but then the error is displayed again.

So I start the Reporting Service Configuration Manager again, go to "Database Setup" and notice that the "Server Name" is pointing to the data tier, and the "Initialization" shows a grayed cross against it!

Why does the installed does it to me? I have no idea so far and could not find any good information.

by . Also posted on my website

Small Thing Learned Today

(No, I didn't forget my blog. It's just that not much exciting have been happening to me in regards to development)

Visual Studio 2008 does not show Solution view when there is only one project in the Solution by default. I personally find this feature very annoying. Today I was going through one example from a book, and it involved creating a solution and adding a couple different projects to it. So I created the solution, added a new project to it, did whatever was required and came to the step where I had to add a second project to the solution. And here I am, completely puzzled - not only I don't see the solution in the Solution Explorer, but there is no menu which would 'intuitively' point me to the way to add a second project.

The fix was easy to find, but still - what's the point of having 'solutions' if you're hiding them from the users by default?

Visual Studio 2008 does not show Solution view when there is only one project in the Solution (by default)

The solution is to go to Tools>Options>Projects and Solutions and check "Always Show Solution" (which is unchecked by default).

by . Also posted on my website