How to change the drop folder for historical collections in TFS 2010

Our server that was used for our dropdown locations is removed. I know how to change the current build definition to use the new server, but how do I change the historical records for already completed builds? I want to be able to open past builds and click "Open Drop Folder" and transfer to the new server. We will manually copy the old builds to the new server.

+3


source to share


2 answers


It seemed like the following example:

using System;
using System.Collections.Generic;
using Microsoft.TeamFoundation.Build.Client;
using Microsoft.TeamFoundation.Client;

namespace ChangeDropLocation
{
    class Program
    {
        static void Main()
        {
            TfsTeamProjectCollection teamProjectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://MyServer:8080/tfs/Collection"));
            var buildService = (IBuildServer)teamProjectCollection.GetService(typeof(IBuildServer));

            IBuildDetail buildDetail = buildService.GetBuild(new Uri("vstfs:///Build/Build/1506"));
            buildDetail.DropLocation ="\\somewhere";
            var buildDetails = new List<IBuildDetail>();
            buildDetails.Add(buildDetail);
            buildService.SaveBuilds(buildDetails.ToArray());
        }
    }
}

      




One thing you should take into account is that you probably won't have the privilege to update the assembly information. In my first attempt, although I am a project administrator, I got this:

TF215106: Access Denied. DOMAIN \ username is required. informational permissions to define the assembly myBuildDefinition in the command project MyTeamProject to take action. For more information, contact your Team Foundation Server administrator.

To overcome this, set the rights by right clicking in TeamExplorer "Builds" and then select "Security ...".

+4


source


I don't know of a single tool for this. There might be a PowerShell TFS command, but unfortunately you can - AFTER TAKING A PRECAUTIONARY CHECK - update the SQL Db directly.

The mapping for the forwarding location is stored in the SQL Db collection in tbl_Build.

select [DropLocation], [DropLocationRoot], [LogLocation] from [tbl_Build]



I'm not sure if there are any stock implications. You can check it first.

I believe Microsoft generally recommends not manipulating SQL directly for things like this. You could use the TFS API instead, which is relatively secure.

+2


source







All Articles