Move TFS from one server to another Server Or Move TFS from older to newer version.
Generally, We take a full backup of the file and restored it in a destination DB after running the Quiesce in TFS. After we try to attach the project collection backup into new TFS server under admin console but we no backup file is displayed under the databases.
Note:- TFSServiceControl quiesce (The following example shows how to stop a deployment of Team Foundation Server)
**TFSServiceControl unquiesce (**The following example shows how to start a deployment of Team Foundation Server.)
Also sometimes we follow the below steps to achieve our goal, which is also incorrect.
- First Approach
- We setup New TFS Server
- Backup the project collection database which we want to move on a new TFS server. Create new project collection with the same name on New TFS server. Delete the new database file from the new SQL server which was created while creating new project collection. And restore the backup file on New SQL server. Now when you try to access the site collection it returned an error as “TF400876: Could not find the partition for host 5165783c-4dbc-44b8-ae12-c1a4f141575b”
- Second Approach
- Stop the project collection on old TFS using TFS Admin console. And take the backup and restore on the new server, but it doesn't work. Also sometimes when we try to start stopped service it returns an error as “TF400783: The host 'Default_Collection' cannot be started. The host is in the process of being serviced. The servicing may have failed and needs to be restarted and completed before the host can be started”
- Then we try to detach the database from TFS Admin console, it returns an error as “ TF401219: The team project collection 'Default_Collection' cannot be detached because its version ID is different than the ID for the configuration database. The collection has the following version: Dev11.M55. The Team Foundation Server is at the following version: Dev12.M78"
So now we know all the above-mentioned steps are not a correct to move the TFS from one server to another server.
To move a project collection from old TFS to a new TFS , we need to follow the below steps.
- Detach the collection in your old TFS Admin Console.
- Backup this collection in your old TFS SQL Server.
- Restore the collection backup to new TFS SQL Server, after restored successfully, and ensure this collection listed in new TFS SQL Server.
- Now when we try to attach the database from new TFS Admin console. The restored database will display under the databases section we need to choose a correct database and click on next button to continue. and ensure can attach successfully without any error.
- After successful attachment of database, project collection will display under team project collection list.
Hope these simple points will help others and avoid to do mistakes as mentioned in this post.