To convert files from a SoureGear Vault Standard v3.1.9 to Git including all history I went on a journey and in this blog post I will describe the journey steps.

Note: this blog post will probably contain unnecessary steps, but non the less it describes the steps how I successfully converted all files found in a SourceGear Vault Standard v3.1.9 server to Git, including all history.





  • The SourceGear Vault Standard v3.1.9 was installed on a Microsoft Windows 2003 32bit Server.
  • On the server was a Microsoft SQL Server 2005 32 bit installation.
  • During the upgrade I switched to a Windows 10 (64 bit) Hyper-V machine.
  • To prevent “multi user” sql connection problems, make sure you stop the vault service with a iisreset /stop, before installation.
  • All developers should checkin their files on the SourceGear Vault Standard v3.1.9 server.
  • Verify that no files are checked out with the Vault Standard v3.1.9 admin tool.
  • If you are using SQL Server 2005 make sure that the database sgvault is in SQL Server 2005 compatibility modus



Steps on the Microsoft Windows 2003 32bit Server


  • For the conversion, I added the SourceGear Vault Service IIS application pool user, to the local administrator group.
  • Our Vault Service connects to SQL Server by using windows authentication. I added the sgvaultuser, Network Service and the locale user that was executing the setups to the SQL Server sysadmin group for the conversion.



Steps on the Microsoft Windows 10 64bit Hyper-V virutal machine

The following steps were executed on an empty Microsoft Windows 10 (64 bit) Hyper-V virtual machine.

  • Turn the Windows IIS feature on (including all sub features)
  • Install SQL Server 2014 (64 bit)
  • Create databases on SQL Server 2014: sgmaster, sgnotify, sgvault, sgvaultindex
  • Restore the databases on SQL Server 2014 from the SQL Server 2005 backups: sgmaster, sgnotify, sgvault, sgvaultindex
  • Set compatibility modus to SQL Server 2014 for the SQL Server 2014 databases: sgmaster, sgnotify, sgvault, sgvaultindex
  • Execute SQL “login / user” correction script, found at:
  • Install the Vault Client
  • Verify we have a working Vault Standard v9.0.0 installation.


  • Install Git in my case it was v2.6.4 Git for Windows.
  • During installation make sure, you choose: “Run Git and included Unix tools from the Windows Command Prompt”.
  • Intialize Git, set username and email
  • Create a folder “C:\Projects\Git\MyRepo”
  • Create a GIT repository inside “C:\Projects\Git\MyRepo” by executing: git init.
  • Commit one file (e.g. an .ignore file) to the MyRepo master with a initial commit.
  • IMPORTANT, do a GET of all Vault files to this MyRepo folder, making all files writable




  • Build the solution in release modus.

Now the really import part is adjusting the App.config file


The servername, because I am running the vault2git tool on the vault server this is localhost.


The vault user name used to login to the SourceGear Vault.


The vault user password used to login to the SourceGear Vault.


The Vault repository name, to get the files from


This is the part that will be added to each Vault username to create a Git user email from a Vault username.


This folder must be the Git repository root folder.

This folder should contain a “.git” folder, before the vault2git is run.


The path to the git.exe to use.


At first this is a “;” seperated list of conversions.

Each conversion is a “~” seperated key value pair.

The first part of the conversion is the path in the Vault (in this case the root of the vault “$”).

The second part of the conversion is the Git branch (in this case “master”)

In this case only one conversion is done, namely converting all the files from a Vault respository to a Git repository branch called master.


NOW RUN THE vault2git.exe

It should convert all files from vault to git

note that this takes a long time.

In my case 7MB of Vault Source files took 23 minutes to convert!!


Now that we have a locale Git repository containing all Vault Sources and history, we can push this Git respository to a remote Git respository (in our case a Bitbucket service).

  • Create a Git repository in bitbucket.
  • Add users to the Git repository
  • Adjust the client_max_body_size (we set it to 0) in the files:
    • /etc/nginx/nginx.conf (Use sudo vim, else the file will be read-only)
    • /etc/nginx/sites-available/bitbucket-cache
    • This is to allow large commits
  • Adjust postBuffer: git config –global http.postBuffer 1048576000
    • This is to allow large commits (<= 1GB)


Some additional information and Notes


Moving vault databases

Vault upgrade guide

Vault compatibility chart

SQL “login / user” correction script

USE [master]
IF ( NOT EXISTS (SELECT sid FROM syslogins WHERE name = ‘sgvaultuser’) )
— next access should be granted in the vault database
USE [sgvault]
EXEC sp_grantdbaccess N’sgvaultuser’
EXEC sp_addrolemember N’db_owner’, N’sgvaultuser’
— The following is ONLY for Fortress and VaultPro:
USE [sgdragnet]
EXEC sp_grantdbaccess N’sgvaultuser’
EXEC sp_addrolemember N’db_owner’, N’sgvaultuser’
— The following is for Vault 4.x and above or Fortress and VaultPro:
USE [sgmaster]
EXEC sp_grantdbaccess N’sgvaultuser’
EXEC sp_addrolemember N’db_owner’, N’sgvaultuser’



In my case, something went wrong and I had to rollback from 4.0.6 to 3.1.9.

If you have to restore a old database, make sure you first remove all sofware.

Remove alle databases.

Create a new sgvault database.

Restore the backup to this new sgvault database.


  1. Hello Roel,

    Thanks for the blog post. I have few issues while trying this out. Hope you would be able to guide me
    I am accessing the vault server via network. Its not on my local machine. I have changed the setting accordingly in app.config. Currently I am not looking at the Database migration. Only the source code in my vault server.

    How do I adjust references & which vault2git exe to run?

    Khyati Desai
  2. Dag Roel,

    Thanks for posting this, it helped me a lot! I am really thankful for explaining in more detail how the Convertor.Paths should be.
    Still, I do not have it running, I get this error: “Unhandled Exception: System.InvalidOperationException: Sequence contains no elements”
    I traced this back in processor.cs to: currentBranch = msgs.Where(s => s.StartsWith(“*”)).First().Substring(1).Trim();
    When I changed this code to currentBranch = “master”
    then it suddenly works. So, is the code wrong or is my config file wrong, which simply contains this path:

    Any ideas?
    Thanks, André


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.