Configure a backup schedule for Git version control with VSTS - tfs

I found articles on GIT back up and restore but I did not find any on Microsoft TFS Scheduled backup for GIT version control.
This document describes on how TFS's traditional versioning can be scheduled for automatic back up. Configure a backup schedule and plan for Team Foundation Server
However, I did not find any link where I can read that "GIT repository is also included in schedule". I am not a TFS expert and I do not have access to TFS server to verify in person. So any help is appreciated.

The tutorial you are refer which is Scheduled Backups tool. It' a build-in tool on the Scheduled Backups page in the TFS Administration console.
It' the whole database back up not only referring to source control, but also work items, pull requests, builds, test plans or anything else that the service offers.
As a limitation, you need both an administrator for TFS and a member of the SQL Server System Administrators group.
And no need to to verify in person, it's under SQL server, when you want to use the backup, just restore the database.
If you are actually using the online VSTS . For now there is no build-in tool and got a uservoice:
Provide a backup service for Visual Studio Team Services
https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services/suggestions/5339461-provide-a-backup-service-for-visual-studio-team-se
However if you just want a git repository(source code) back up, you could use some 3rd-party tool to achieve this:
We use the VSO Rest API to query our VSO account and get all the data
we need. Since in VSO you can only have one Team Project Collection,
we retrieve all the team projects of the default collection. Each of
these team projects can have multiple repositories that need to be
backed up. A folder is created for each team project and saved to a
location on disk that can be configured in the app.config. When the
team project folder is created, the task loops over each repository in
the team project and creates folders for each repository.
Source Link
You can also fork it on GitHub here. Certainly, you should also be able to use this for on-premise TFS also use the API, just need to change some part.

TFS is implemented the way to keep Git repositories in the SQL Server database, too. Thus, when you follow the instructions from the article you reference, the source code will also be included in the backup, no difference whether it is TFVC or Git.

Related

Maintaining Two Different Source Control Servers

We have been hired by a client who would like us to check in code to their Azure Devops Team Foundation Version Control server.
We have our own small team of developers that will work on this project and commit changes to our own TFVC server first. Once all check-ins are approved, we would then like to commit all of our changes to our client's TFVC server. We have been given a single login to their TFS system, so we would like to check in our code into their system using the single login that was provided to us. The client does not need to know the history of all of our own developer's work, we would like them to see our check in as a single author. We don't want to migrate, as this will be a common task for us.
What's the most straightforward way we could do this?
It is not possible to sync code on 2 different TFS server. Since you work in one workspace (command line and GUI) at a time. And a workspace cannot span servers.
The only workaround here is manually copy/past your code directly through windows file system. Finally check in code to your client's TFVC server.
The better solution is to convince your clients to use Git repositories instead of TFVC. There is a lot to win here! And you could migrate your sources with git-tfs with all history.

Move code from TFVC on TFS 2010 to TFVC on Azure DevOps Server

I have some projects on TFVC source control on TFS 2010. I want just to migrate the source code from TFS 2010 to TFVC on Azure DevOps Server.
I don't want to process an upgrade of the entire collection to a newest version. I Just want to transfer my code with history.
I tried Git-TFS. I cloned my repository on TFS 2010, but I don't know how I can update the remote URL for TFVC repos and push on Azure DevOps Server.
Any ideas how I can do it? Or other tools that I can use?.
In the case I decide to migrate without history how can I do it?
Thanks.
git-tfs is a two-way bridge between TFS (Team Foundation Server) and git, similar to git-svn. It fetches TFS commits into a git repository, and lets you push your updates back to TFS.
If you want to move code from TFVC on TFS2010 to TFVC on Azure DevOps 2019 and keep history.
You have to do the upgrade process of entire project collection.
In the case I decide to migrate without history how can I do it
You could just create corresponding new team projects and workspaces. Pull down your source code from your TFS2010 workspaces/projects. Copy and paste source code files/folders in new workspace. Then check in them back to Azure DevOps Server 2019.
We advise you keep preview TFVC repository of 2010 online but read-only to view history.
Same with Azure DevOps Service, hope this helps.
Disclaimer: I'm the last maintainer of the git-tfs tool (even if I no more work on it)
Git-tfs could be used to migrate from TFVC to git (with history and branches if your history is not too complex).
But in no way it could be used to push this history to another empty TFVC project.
So don't expect something from here.
Fun fact (not so fun for you) :
To prevent regression developing git-tfs, I created a TFVC project on Codeplex used to run smoke tests in a Continuous Integration job.
When Microsoft decided to close Codeplex, I contacted a guy working in the source control team inside Microsoft to help me migrate from Codeplex to Azure Devops (at the time called VSTS) which is the problem you try to solve.
I don't know if they put a lot of effort into this but no one was able give me a solution. The only thing they think about was to use git-tfs, that I confirm you is not able to do it!
That could give you an idea of the problem you're trying to solve...
Ps: that also show that TFVC is not an enough flexible source control and their is a much higher added value to migrate to git (like nearly everyone is doing it...)

Issues with TFS Aggregator implementation

We used TFS Aggregator to automatic update the User Story's state according to its sons state changes and also to automatic Update User Story's state of other project (if they are related).
Also important to mention that we hire an external freelance to help us doing it. When we tested it on his environment - it worked well. But when deploy it in
our environment - there's no change, the new functionality doesn't work.
what you recommend us to check ?
what can be the reasons for this integration problem?
What actions should we take?
Your advises are more than welcome!
First, try to follow the steps of installation on this website to install the plugin: https://github.com/tfsaggregator/tfsaggregator/wiki/Install
If it still doesn't work. Here is the troubleshooting page you can refer to: TFS Aggregator Troubleshooting:
You are using the right version of this server side plugin for the
right server. You can get multiple releases of this plugin at website
https://github.com/tfsaggregator/tfsaggregator
You have updated a work item that triggers a rule. (The TFS
Aggregation only works once a work item that has aggregation rules on
it is updated. This may change in a future version.)
If the rule navigates between work items, work items have a proper
Link (e.g. Parent-Child).
You copied the DLLs and the Policies file to the plugins location on
all TFS Application Tier Servers (Usually at: :\Program
Files\Microsoft Team Foundation Server {version}\Application Tier\Web
Services\bin\Plugins)
You have valid names for source and destination fields in
TFSAggregator2.ServerPlugin.policies.
When you saved the file you saved it as UTF-8 encoding (in Notepad++
it is called “utf-8 without BOM”).
You have given permission to the user running the plugin, e.g. add
the "TFS Service Account" to the Project Collection Administrators
TFS Group.
You may have to do this from the commandline using tfssecurity
/collection:http://server:8080/tfs/DefaultCollection /g+ "Project
Collection administrators" "LOCAL SERVICE" if your service account is
either LocalService, NetworkService or any other Windows Well-known
identity, since they are no longer shown in the permission UI.
When using the Impersonation option, make sure the user executing the
plugin (generally the TFS Service account) has the "Make requests on
behalf of others" permission at the server level
If you upgraded your TFS from 2013.x to 2015.* and from 2015rtm to
2015.1 and did not uninstall the TFS Aggregator before doing this TFS upgrade the aggregator does not work. Remove the TFS Aggregator from
the TFS 2013 Program Files folder or run the uninstall of the TFS
Aggegrator (backup your policies!). Then re-install the TFS
Aggegrator setup or install manually for TFS 2015 as described here.
Every TFS version has its "own" assembly for the aggregator so it is
important to use the right version against the right TFS.

Can I utilize two different versions of TFS to manage source code?

I am not familiar with TFS, however the scenario that I will be coming across is that I will have a branch of source code stored in Visual Studio Team Services (was TFS Online) and locally I will be running TFS 2008.
Would there be any issues pulling the code from Team Services and merging with TFS 2008?
You won't be able to bind the code (solution and projects) to 2 different TFS servers. If you're using the online version of TFS what reason would you have of also trying to store the code in a local repository?
You definitely won't be able to merge the code between the different servers. TFS is a centralized version control system and merge operations need to be handled and tracked by the server.
You could theoretically Manage the code in one of the TFS servers (i.e. have the solution bound to TFS online) and manually manage the code in the other server. However TFS 2008 only supports local workspaces which means that it will make files read only if they are not explicitly checked out. This will cause you no end of pain.
Even if you did it the other way round (made the local TFS server the "master") you will almost certainly create yourself a load of problems as TFS simply isn't designed to be used this way
Also TFS 2008 is pretty ancient and unsupported.
EDIT:
The typical TFS workflow is.
Create a development branch on the server.
"Get" the code to a local folder on your dev machine (called a workspace).
"Check out" the files you need to modify from your branch or "Add" new files as needed.
You should regularly "check in" files to your branch to make sure your changes are saved on the server.
When your changes are complete then "merge" the code from the development branch back to the Main branch.
The code is stored and versioned on the server, but your changes are made on your local machine. To interact with the server you use the Team Explorer plugin in Visual Studio. Modern version of Visual Studio have Team Explorer built in.
If you're using the online version of TFS then you'll want to use Visual Studio 2012 or above.
If you're planning on Forking the code and do not plan on committing your changes back to the server, then you're probably better off using something like Git. You could use Git-tf or Git-TFS to pull changes from TFS and then that would make merging a lot easier and you could use your local Git Repo to manage your own changes

Where can I get large sample TFS repositories?

I'm building a tool to integrate with TFS and it needs to properly parse TFS logs (from the tf.exe history command) and checkout different revisions (again using tf.exe). It works great on the test TFS server I have, but I want to test it on a broad range of large repositories to make sure my parsing works properly.
I'd hoped to use Codeplex to get access to TFS repositories, but it seems you only get TFS access to Codeplex projects if you're a project member.
Are there any collections of open source code hosted on public TFS servers? Are there any other publicly available servers I could use for testing?
I would suggest using svn2tfs and choose any relatively active project on SourceForge. There are plenty of projects on SF to choose from that use SVN and not CVS. You might even get a bonus out of it and help the svn2tfs project work out any kinks.
Since you mention tf history command, I assume you want to collect/parse logs on the project's (and its files) history of checkins.
So in addition to large repository, you also need a good amount of history, am I right? If yes, then here's your set of problems:
Most projects on codeplex use Mercurial, not TFS. So even if you get access, you cannot use TFS with them.
As you mentioned, they require you to a be a member for you to access the source.
Even if you get access or find a public server (unlikely), you still would need good amount of history.
If I'm correct in my assumptions so far, here's the easiest (bit tedious though) way out:
Go to any large projects's such as Nuget or Wix
revisions
Download any old revision (go back as far as you want the history for). You can download zipped src files without being a member.
In your test server, checkin the code (src) to create the baseline.
Download the next revision.
Checkout files in your server and overwrite them with the newer revision's files.
While checkin, use the history.txt (sample) to create checkin comments
Repeat this process few times.
Voila!! You now have a large repository with lot of history!
Hope this helps.
Have you tried some of the larger projects on Codeplex?
http://www.codeplex.com
If you only need read access you should be able to play around with the various repositories.
I don't have a huge amount of tfs experience, but I would assume there are migration tools that let you ingest code repositories from other products (e.g svn or hit).
If so, you might want to find a svn/git repo for a sizable foss project, and try importing that.
"I'd hoped to use Codeplex to get access to TFS repositories, but it seems you only get TFS access to Codeplex projects if you're a project member."
This solution appears to be the general consensus amoung SO'rs. I've read some of the Codeplex TFS connection problem threads (you linked to below) and I hope the comments in this thread resolves the issue:
Connecting to Codeplex TFS as a Coordinator or Developer.
I'm wondering if you can use git-tfs project to import an existing Git project into TFS.
Download and install git-tfs
Create a new TFS project
Clone the TFS project to a Git project using git-tfs ("git tfs clone http://tfs:8080/tfs/DefaultCollection $/some_project")
Import a existing Git project of your choice into your fresh new Git project (I don't know the command but I think it's possible).
Use git-tfs to checkin to TFS Server ("git tfs checkintool")
=> Do it makes sense ? And works ?
For more information:
http://lostechies.com/jimmybogard/2011/09/20/git-workflows-with-git-tfs/

Resources