Backup your Team Services Git Repositories with VSTS Vault: A simple windows service or console application designed to keep a local copy of all your code.
Since January 2016 we’ve moved the source code of more than 30 projects to Git repositories hosted by Visual Studio Team Services.
Moving to the cloud has some downsides and one thing that kept us thinking was the need to be sure that in the event of an internet connection failure or a Team Services outage we would be able to access our code and deploy hot fixes for our applications as part of our data protection plan.
We needed a solution capable of minimizing the RPO (Recovery Point Objetive) and where the backups could be connected to an on-premises Git Server such as GitBlit.
Those are the main reason we could not use VSOBackup and why, inspired by such a great code base, I created a Windows service: VSTS.Vault with the capability of cloning your Git repositories and then pulling for changes every 5 minutes which is the default setting.
Vsts.Vault is a Windows Service and to use it you’ll need to follow these steps:
If you look through the VSTS.Vault code base you’ll see some interesting features:
- Use of MEF as to implement dependency injection
- Use of LibGit2Sharp
- Use of Visual Studio Team Services REST API
- And the use of the Retry Pattern
To finish this post I have to say that We’ve been running the service now for more than a month and connected the resulting repository backups to GitBlit without issues.
Hope it helps…