Three of the 6 development teams using TFS are moving to a different network and domain. There is no on-line connection between the old (source) and new (target) networks.
The objective was for the teams to come in Monday morning, bring up their development machine on the new network and have everything as it had been on the old network.
- Clone the data tier and move the data tier to the new network. This failed because the procedures for moving the hardware to a new environment did not work.
- Use the TFS Integration Tools. We had experience with the tools, and after a couple of tries with the 1st approach we decided we wanted a totally new and clean installation of TFS on the new network. However, I found that the tools do not support the migration of test cases and labels. This was unacceptable unless there was no other possible way to do the move.
I looked into doing a collection move and my initial tests were successful. This approach:
- Allows you to setup a totally new and clean TFS target instance
- Brings much more over than the Integration Tools
Don’t attempt this unless you know what you’re doing and have experience with SQL Server and administering all the components of TFS (i.e. SharePoint integration, reporting services, analysis cub processing, source control, work items, etc.…)
The first thing you need to do is install and configure TFS in the new environment. I also suggest moving a small “test” collection first before moving the production collection.
NOTE: My machine names in the source and target environment were identical. This may have helped in some cases simplify the updates to the TFS console in the target environment after attaching the cloned collection.
Be sure to reference the Microsoft procedure as well as the following steps:
- Note down all the team project team members and which security group they belong to
- Apply the latest SPs and updates to all the machines in both networks. Make sure SQL Server is the same version and TFS is the same version in both environments (see TFS console and SQL Server Management Studio)
- Export all your SSRS report definitions (RDL) files. Since we had only 3 team projects to move that used SSRS reporting, I used a PowerShell Script to export the RDL files and then manually uploaded and configured them on the target environment. There is a tool that might be able to automate this, but I was not familiar with it and initial automation attempts were not successful.
- On the source environment:
- Do a full TFS backup
- Stop the warehouse jobs
- Stop the transaction backup job (mine runs every 15 minutes)
- Remove all team project team members from all team project security groups. I’m not sure if this is needed, but I wanted to keep as much data as possible out of the collection that would be invalid in the target environment.
- Detach the collection using the TFS console
- Clone the collection database
- Stop all SQL Server services except the data engine
- Take the collection database offline
- Copy the .MDF and the .LDF files of the collection database
- Bring the collection database back online
- Start all the SQL Server services you stopped
- Attach back the collection (using the TFS console)
- Add back all team project team members to the correct group (using the TFS Power Tools Team Members feature in the Team Explorer makes this really easy)
- Start the warehouse jobs
- Start the transaction backup job
- Verify TFS operations using the TFS Best Practices Analyzer. I also used Grant Holliday’s TFS Administrative Reports Pack to help ensure that cube processing was working correctly.
- On the target environment:
- Copy the database .MDF and .LDF files to the appropriate folders on the database machine
- Attach them to SQL Server to bring the collection database online
- Attach the collection using the TFS console (* see problem below)
- Set the web application on the TFS console SharePoint view to the correct one for the new environment. This will automatically create the collection site for the TFS collection you attached
- Manually create the SharePoint site for each team project in the collection (for team projects that use SharePoint). Create these under the collection site that was created in the prior step.
- Run IISRESET /NOFORCE on the SharePoint machine
- Update the Team Portal settings for each team project from Team Explorer, Team Project Settings
- Make sure all the team project and collection parameters on the TFS console are correct for the new environment
- Update all collection level security groups to ensure members is correct
- All all team members to the team projects security groups
- Rebuild the warehouse from the TFS console
- Import, configure and verify the SSRS reports. Note: I had to configure the data sources for each report even thought the data source name had not changed.
- Process the analysis cube manually
- Setup your backups
- Verify TFS operations using the TFS Best Practices Analyzer and the TFS Administrative Reports Pack reports
Other things I had to do in my specific situation
- Deleted all the build workspaces. This was required to avoid TFS from thinking there was a workspace mapping conflict since the build machines names were the same on the source and target environments
- I remapped the user workspaces to the new owner, changed the computer name portion of the workspace name to match the new name of the users computers (their computer names did change) and provided scripts for them to change the computer name for their workspace.
- I provided scripts for them to replace their shelve-sets to have the correct owner name
- I swapped out the display name in the assigned-to field for all work items with the correct display name (the account IDs were the same in both environments but the display name was not: first last vs. last, first)
- Dropped in a custom assembly we use for setting builds to never be deleted based on build quality
The only glitch I had was that the collection failed to attach. the error message:
“TF246091: The team project collection cannot be attached because its version ID is higher than the ID for the configuration database. The collection has the following version: Tfs2010.SP1.KB2564498.P#5. The Team Foundation Server is at the following version: TFS2010.SP1.KB2580221.P#4.”
This baffled me at first because from the TFS console and from SQL Server Management studio, the versions of TFS were shown to be the same and the version of SQL Server were shown to be the same.
However, after some digging I found a blog post saying how the TFS version could be inconsistent between the application and the database machine. The resolution was to run:
TFSConfig Updates /Reapply on the application machine.
After doing this, the attach worked fine.