Adding solution to source control - tfs

I want to add solution to source control(tfs I am using vs 2015).I selected the option add solution to source control, then one dialog opened, in that dialog there is no option to create a new folder directly under collection, it is always adding to the existing project(folder).How can i create a new folder/project directly under the collection.

The structure TFVC uses for source control is as follows:
Team Project Collection (created by your TFS admin)
$/TeamProject1
$/TeamProject2
etc
You can't add source code directly under a Team Project Collection -- it has to be created in a Team Project. And you can't just create a "folder" that represents a new Team Project. You have to create a Team Project either via the web UI (if you're using TFS 2015 Update 2 or later) or via Visual Studio. The version of Visual Studio used to create a Team Project needs to match up with your version of TFS, as well.
Typically, guidance for Team Projects is to create a single team project for each portfolio of related applications, since each Team Project is isolated from other Team Projects in terms of things like source code, build, release, and work item management. You can use the concept of Teams within a Team Project to create separate backlogs and the like for individual applications.
Some further reading:
Why you should use one Team Project: http://geekswithblogs.net/Optikal/archive/2013/09/05/153944.aspx
Creating a team project: https://learn.microsoft.com/en-us/vsts/accounts/create-team-project

Related

TFS 2017 move TFS source code repository to new instance of TFS

We installed the free version of TFS 2017 and created a new project. We now have source code with history. The PM decided they wanted to switch from Agile to Scrum so a lot of commands were run to try to do this. These commands came from a blog found on the internet. The supervisor then decided that it should NOT have been switched to scrum and said we needed to switch back to Agile. So similar commands were run to try to do that. Now the Project Management portion of our project is broken. We can't run queries and the work items are corrupted. I want to try to just install a new instance of free TFS 2017 and copy/move the source code (TFS, NOT GIT) to the new instance and start over with the PM stuff. Can we do this or is it a lost cause.
Actually we do not suggest OPs to do the process template change in a single team project. Take a look at this MS documentation (here) ...
You can change the process a team project uses from a system process
or inherited process to an inherited process. You can only change team
projects to use another process that inherits from the same system
process. That is, you can change an Agile-based team project to any
process you created from the Agile system process as well as to the
Agile process. Whereas, you can't change a Scrum-based team project to
an Agile-derived inherited process.
There is no need to set up a totally new TFS instance, you could simply create a new team project based on Agile and then move your source code and workitems to that new team project.
Since you are not care about the history info about your original team project, it's more easier to achieve this, simply remove your old workspace mapping and map to the new team project.
To move workitems you can export them to Excel, create a new Excel connection to , that is connected to the new team project, and then copy the workitems and pushing them from the new Excel file into the new project.
If you insist on moving the code to new TFS server, you just need to back up your local code and directly check in them as pending changes in the newly created team project on new TFS server.
More details please refer the answer from Andrew Clear in this similar question: Visual Studio Team Services: How to migrate from Agile to Scrum process template
If you want to only move Source code from one Team Project Collection to another Team Project Collection, one of the crude workarounds is the following, when you are ONLY requiring SRC code moves.
Create a workspace and check out all SRC from the source Team Project in the source TPC.
Create a new Team Project in the new TFS instance.
Remove the binding files from the SRC dumped out in (1), or better yet just move it on the disk to a new directory and remove all SRC binding files.
Then add the source (from the above step 3) into the new Team Project you created in the target TPC you created in (2) above (or it could also be into an existing Team Project you already had in the target TPC).
Once again this is ONLY if you don’t care about the other things such as WITs and Reports from the older Team Project, and you only care about the Source Code.
In addition, you can use the following tool Timely Migration.

Can a TFS Product Backlog Item be moved to a new project?

I have a PBI in TFS under ProjectA with an iteration and area value filled in. Is it possible to move this PBI to ProjectB without creating a new PBI?
I am not seeing a way in the Visual Studio UI to do this. If I try to manually type in the area path of ProjectB, Visual Studio says that the path cannot be found.
I am using Team Foundation Server 2013 and Visual Studio Ultimate 2013.
No. Work items cannot be moved between team projects.
The reason is simple: The process template of the team project defines the work items. Team projects can have different templates. What if you tried to move a work item from a team project using a Scrum template to one using a CMMI template?
I would go a little deeper and say that if you need this feature then you should not have two Team Projects in the first place.
http://nakedalm.com/one-team-project/
The term that I use is:
"If you have artifacts that interact, with artifacts defined as people, code, or work items, then they should be in a single Team Project"
http://nakedalm.com/creating-nested-teams-visual-studio-alm/
Using a single Team Project can give you many more capabilities at the backlog/ work tracking perspective. Like the nested teams described above.
EDIT: This does not work for TFS2017 and forwards.
Yes, see http://www.codeproject.com/Tips/1018002/Yes-You-Can-Move-TFS-WorkItems-Between-Projects for a downloadable utility, source and a more detailed explaination.
It is a backdoor, SQL Manager approach, not supported by Microsoft, but it works for me. Here is the SQL:
UPDATE [Tfs_xxx].[dbo].[WorkItemsAre] SET AreaID=#AreaID,IterationID=#IterationID WHERE ID=#WorkItemID
UPDATE [Tfs_xxx].[dbo].[WorkItemsLatest] SET AreaID=#AreaID,IterationID=#IterationID WHERE ID=#WorkItemID
UPDATE [Tfs_xxx].[dbo].[WorkItemsWere] SET AreaID=#AreaID,IterationID=#IterationID WHERE ID=#WorkItemID
With the Tfs_xxx being replaced with Tfs_<your collection database name>.
Essentially, the project is inherited from the Area and the Iteration. Changing these from the current project to the target project causes the workitem to "move" to the target project. Additional rough edges are that the assignment pool or the workflow states might not align and have to be edited mannually in the UI to get the workitem back in the flow of the target project.
See my related answer.
Though not applicable to TFS on-premise, one can now do this with Azure Boards in Azure DevOps.

Create a project in a subfolder in Visual Studio Online (TFS)

Is there any way to create a project in a subfolder in Visual Studio Online using TFVC?
As of now, a TFS Team Project Collection is a flat collection of Team Projects. You cannot organize them in a hierarchy. So you could only depict the hierarchy by naming the Team Projects accordingly.
In a Team Project Source Control tree, you can place many Visual Studio projects and organize them in a folder hierarchy. You can set permissions on specific folders in Version Control if you need to secure some of the projects (though this is not as easy and straightforward as in separate Team Projects).
So maybe it is an alternative to place the projects in a single Team Project and create the hierarchy in source control and areas/iterations. Precondition is are that the projects share the same process; it's also good if they want to share work items or code at least once in a while.
If you want to separate them strictly, you need to create separate Team Projects and do without the hierarchy.

Steps for changing process template for an existing project in TFS 2010

I have an TFS server installation that through time has gone through upgrades from TFS 2005 to TFS 2008 and then to TFS 2010.
During the lifetime of the installation a lot of projects have been created and different project templates have been used. MSF Agile 4.0, 4.1, 4.2 and 5.0. and a few MSF CMMI ones.
What I would like to do is "replace" the project template used for all these projects to use a new one common one: Microsoft Visual Studio Scrum 1.0.
I am aware that TFS project templates are used as templates for creating new projects and cannot modify the tfs projects definitions after creation.
Uptil now only the version control and build server part of TFS have been used and there are no existing work item types.
Additionally all projects and build scripts are depending on the source code paths stay the same.
As I see it I have the following options:
Create new TFS projects using the correct project template and then move/branch the source code to the new project.
All code is moved to a temporary team project.
The old project is deleted
New project with the original name and correct process template is created
Code is moved to the new team project
Temporary team project is deleted
All the build definitions needs to be to recreated which is not an option.
The source code move/branch will "mess up" the versioning history
By messing up the versioning history I mean that when you move source code it will behind the scenes do a delete + source rename on the original location and the history will still be located in the old project. This will make searching in the history difficult and if I actually delete the old project I will loose all the history before the source code move.
This is really not an option for me since there is years of code change history that is needed to for supporting the different applications being built.
Use the TFS migration tools to migrate to another TFS project
This has the same downsides as the first solution
Replace/import work item types, install new reports, create new SharePoint sites
For each tfs project
Delete existing work item definitions using "witadmin deletewitd"
Import each work item definition from the new process template using "witadmin importwitd"
Import work item categories using "witadmin importcategories"
Delete old reports in project folder in report server
Upload the report definitions from the new process template
Modify data sources used for the reports using the report manager to point to the correct shared data sources (TfsReportDS and TfsOlapReportsDS)
Modify the report parameter ExplicitProject default value to "" (empty string) and disable prompt user option.
Export the documents in the old SharePoint site using stsadm
Delete the old SharePoint site
Recreate the sharepoint site using the TFS2010 Agile Dashboard site template
Activate site feature "Team Foundation Server Scrum dashboard"
In TFS Project Settings -> Project Portal Settings: Enable "team project portal" and ensure the url is correct. Enable "reports and dashboards refer to data for this team project"
And finally..
Process the Warehouse
Process the Analysis Database
Even though that this involves a lot of small steps this looks more appealing because
this option will not force me to move the source code and my existing build definitions will be intact.
My question:
Are there other ways to achieve the replacement of work item types that I haven't mentioned?
And/or am I missing any steps in last solution?
Given that you aren't using any existing work item types, your final proposal looks like the best option.
After deleting the old reports and exporting the SharePoint documents (you could also use Windows Explorer instead of stsadm), there are actually two commands in 'tfpt' that will help you. This will reduce it from 14 steps down to 5 or 6 steps.
tfpt addprojectreports Add or overwrite reports for an existing team project
tfpt addprojectportal Add or move portal for an existing team project
tfpt addprojectreports /collection:http://yourtfs:8080/tfs/YourCollection /teamproject:"Your Team Project" /processtemplate:"Microsoft Visual Studio Scrum 1.0" /verbose
tfpt addprojectreports /collection:http://yourtfs:8080/tfs/YourCollection /teamproject:"Your Team Project" /processtemplate:"Microsoft Visual Studio Scrum 1.0" /verbose
Your first option is IMHO your best shot.
You can branch the sources from the old team project to the new team project. With TFS 2010 you can see the history also from the branched location. So you don't loose functionality in here.
The Build is just an msbuild file which is stored in source control. The only thing you have to do is actually copy the build definitions. You can do that either manually, or you can create a little app that does that for you.

View History in TFS

We have created a New Team Project in TFS 2008. We want to merge 7 different team projects with this New Team Project and finally delete the old 7 projects.
A existing project is branched with a new team project. After this,we are not able to view the history of source project in the target (new) project view history. Please let us know, how to propagate the complete history from source project to target project.
I am new to this...I don't know whether I have stated the issue correctly or not...
I would recommend using the Rename feature to place the code under the same team project, rather than branching.
There is no UI for branch/merge history built into TFS 2005/2008. You have to use the command line (tf merges) or 3rd party tools (e.g. Attrice Sidekicks).

Resources