branching team project - tfs

I have the following at Source Control Explorer
TFSServer/teamCollection
+ teamproject
Is is possible to branch /teamproject to /teamproject-dev? The output should be
TFSServer/teamCollection/
+ teamproject-dev
I tried and it gave me error:
TF10175: The team project folder $/teamproject-dev does not exist. Contact your Team Foundation Server Administrator and ask that it be created.

Top level folders in source control are reserved for team projects. If you create a new "teamproject-dev" project you could branch the code from the existing "teamproject" into the new -dev project via the wizard.
Alternatively set up a proper branching structure inside teamproject. Read the TFS Branching Guide for more information.

Yes, you can convert team project into branch.
The above error is saying that you don't have access to create branch. First you create branch by getting help from TFS admin then try what you mentioned that should work fine.

Related

How do I branch?

https://learn.microsoft.com/en-us/azure/devops/repos/tfvc/branching-strategies-with-tfvc?view=azure-devops
I have a brand new project in Azure DevOps. There's nothing in it yet, but I want to set up the branches to model the Servicing, Hotfix, Release isolation strategy from the link above.
To do this, I need a branch, and a branch of a branch.
When I right click my project and say "Branch", it prompts for a Target.
This is where everything I try does not work.
First thing I tried was to use $/Master/HotFix. This returns an error "The target item $/Master/HotFix cannot be under the source item $/Master.
Then, I tried just $/Master-HotFix and get an error "Source control must branch into an existing team project. Master-HotFix is not a team project"
So, I went to Azure DevOps and I created a new project called Master-HotFix. I mapped it in Visual Studio, and tried again. This time, I got the error "Unsupported pending change attempted on team project folder $/Master-HotFix. Use the Project Creation Wizard in Team Explorer to create a project.
Surely making a branch isn't this difficult? What am I missing?
According to your description, seems you get promoted a kind of below dialog
I have a brand new project in Azure DevOps. There's nothing in it yet
You are trying to branch a Team Project rather than a folder containing your code.
You should first have your code in a folder, say "Master", under the "$/TeamProject/" folder. You can then branch "$/TeamProject/Master" to "$/TeamProject/Master/child".
If you have dumped all of your code into the root of your team project then you will need to move it into a folder first, then branch that folder.
warning: You can create a new team project that is a branch of this one, giving you "$/Master". However this method is a terrible idea and will lead to pain and suffering
For more details please refer our official tutorial:
Convert a Folder to a Branch
Branch a folder or file
In order to branch in TFVC you first need to create you master/MAIN branch as a folder. Then you check that folder in. After you can convert it to a branch from the branch menu. After that you'll be able to branch off that master/MAIN branch and create the structure you are trying to do.
Cheers,
ET

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.

TFS in Visual Studio Online

I used before free TFS from Visual Studio Online. I worked fine, I added some projects to TFS and did check-in and check-out without problem. But now it just stop working. When I try to check-in new projects, I get the following error:
The following issues were encountered during check in: TF10169:
Unsupported pending change attempted on team project folder $/Code.
Use the Project Creation Wizard in Team Explorer to create a project
or the Team Project deletion tool to delete one.
What is Project Creation Wizard? How I can run it? And what is happened with my account? I see the message:
Your account is an Early Adopter account. In 31 days your account will
revert to a standard account.
Maybe that's why it's not working anymore?
You cannot create or delete folders at the top-level of the source tree. (Eg, $/Code).
The top level of the source tree is reserved for Team Projects, which must be created and deleting specially. If you want to delete $/Code, you will need to undo your pending change that deletes it and instead delete it using the Project Creation Wizard or the TfsDeleteProject command.

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.

How to change soure control from TFS?

I have a solution say it Myproject in vs2010. I have create a solution folder on TFS say it $/Myproject and checked in all source code files.
Now I have created another folder on TFS say it $/Myproject2 and I want to the solution Myproject in VS 2010 to connect to $/Myporject2.
I guess I should disconnect from TFS and then connect to $/Myproject2 and check in all codes, but not sure how.
So I try to go to workspace->Edit Wokrspace, and change the Source Control Folder in the list. Is it right?
Thanks.
Map your workspace to $/ and you'll be able to access both $/Myproject and $/Myproject2
However, I don't recommend having one team project be able to reference another team project. If you're going to have these types of dependencies, I would have a layout more like this:
$/MySolution
MyProject
Project.csproj
MyProject2
Project2.csproj
Where "MySolution" is the master product you are trying to build.

Resources