Giter VIP home page Giter VIP logo

vault2git's Introduction

vault2git

Purpose

	Convert history from Vault repo into Git repo

Building

	1. Download Vault Client API for your version of Vault (you have to use version matching your Vault server);
	   other option is to copy *.dll from Vault client installation
	2. Replace Vault2GitLib/libs/*.dll with your files
	3. Recompile

Setting up (simple way)

	0. Install Git (msysgit is the easiest way); Configure it (email, name etc)
	1. Create empty folder and init Git repo in it. This is your Git repo and Vault working folder.
	2. Place .gitignore into your working folder. The one from vault2git may be a good starting point.
	3. Create initial commit, e.g. git commit --allow-empty --message="initial commit"
	4. Create branches from initial commit
	5. Change .config file to match your setup.
	6. run vault2git.exe.

How it works

	1. vault2git gets changesets from Vault into working folder one by one and commits each into Git. Vault bindings are stripped from
           *.sln, *.csproj, *.vdproj files.
	2. Commit message is taken from Vault. Info about Vault revision and paths are appended to the commit message:
           [git-vault-id] VaultRepo$/VaultPath@VaultRevision/VaultTrxNumber
	3. Dates of the files are not preserved.
	4. Commit dates are preserved
	5. Author names are preserved and company domain (from .config) is appended.
	6. Empty commits are converted too
	7. Git tags are generated from Vault labels. Each label is prefixed with Vault Transaction ID. Duplicates (e.g. coming from Shared
	         folder) are ignored. Use '--ignore-labels' argument to disable this functionality.

Incremental updates

	When ran again, vault2git first checks for [git-vault-id] tag in latest git commit, parses revision number (after @)
	and pulls Vault data above found number only.

Additional actions

	Every 200 git commits, Git garbage collection is executed.

	After processing is complete, finalization executes git update-server-info, which updates data in Git repo for
	dumb server (e.g. read-only http sharing with iis)

Vault labels conversion
	Vault labels support a lot more characters than git tags. For compatibility, all non alphanumeric characters for
	git tags are replaced with "_". Git tag can only be created if the related git commit exists. Vault labels
	comments are added as git tag comments.

Last Updated: 2011-04-06
Author: Andrey Nikiforov
Contributor: Jevgeni Zelenkov ( github.com/jzelenkov )
Location: github.com/AndreyNikiforov/vault2git

vault2git's People

Contributors

andreynikiforov avatar dskantz avatar mkchandler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vault2git's Issues

Fortress

Hi,

It appears that this doesn't work with Vault Professional. Do you have initial ideas about making this work with the Fortress Client? I might be able to help make it work but need a little direction. You can see the stack trace in this ticket in the sourceforge forum at this ticket.

http://kb.sourcegear.com/FortressHelp/viewtopic.php?f=48&t=18723

Best,

-- Rodney

Error when switching to branch

First of all, thanks for making this tool, it's gonna be a big help.

The problem I'm having is when the tool tries to change the working folder for the branch in Vault. The trunk is already set to the working folder so the operation fails.

I may not be understanding how the tool works with branches. My understanding is that it sets the working folder for the trunk, checks in all commits from Vault to whatever I have the trunk set to which is "master". Then it sets the same working folder to the branch (this is where it fails) and checks in all of the branch commits into git on the branch I created which I called just "branch".

here's my config file with sensitive information removed:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="Vault.Server" value=""/>
    <add key="Vault.User" value=""/>
    <add key="Vault.Password" value=""/>
    <add key="Vault.Repo" value="ADN Web Apps"/>
    <add key="Git.DomainName" value=""/>
    <add key="Convertor.WorkingFolder" value="C:\Users\csweeney\Documents\ADN Web Apps\QACTemp"/>
    <add key="Convertor.GitCmd" value="C:\Program Files (x86)\Git\bin\git.exe"/>
    <add key="Convertor.Paths" value="$/QAC/Trunk/~master;$/QAC/Branches/~branch"/>
  </appSettings>
</configuration>

Is SSL supported?

I'm looking into migrating our repo with this tool. I've given it a little work and dug into the source, but I can't seem to get SSL working. Things seem to be getting tied up inside of vaultLogin() in Vault2Git.Lib.Processor just after ServerOperations.Login(); is called.

Is the a specific setting that needs to be changed to enable SSL? I tried changing the URL in this line...

ServerOperations.client.LoginOptions.URL = string.Format("http://{0}/VaultService", this.VaultServer);

...to this, thinking that the HTTPS may trigger the SSL. Our server is also on port 79, which may be throwing it off further.

ServerOperations.client.LoginOptions.URL = string.Format("https://{0}/VaultService", this.VaultServer);

Improve speed of Vault pull

The utility is slow for large numbers of files because EVERY file in each Version is ALWAYS copied from the client-side cache, if its there, otherwise its retrieved from the server.

What is needed is to only get the changeset from the Server.

This creates a program whose speed is dependent on how many files there are in each changeset, not how many files are in the entire Version.

I have modified Vault2Git to do this and it works extremely fast - up to 30 times faster with my large repo, but if a file or folder is deleted in the tip then the file is NOT retrieved. Clearly not useful!

I'm trying to get more info from SourceGear who have been helpful so far, but if you think you can help work this out with me then get in contact ASAP.

The critical issue is how to create a VaultClientFile object for a particular version of a file.

I have found a simple workaround of running the old code if there is a deleted file. But that means that if there is just one delete, rename or move in a changeset then the overhead of copying the entire Version must be incurred.

SourceGear have suggested using ServerOperations.client.ClientInstance.Connection.GetBranchStructure to get the historical branch structure.

I wonder though that what needs to occur is to just manually perform the delete, rename or move. We have the file already due to the process we go through. And the history details provide old name and new name. Worth a try if somebody is up to it and I don't find the time or necessity before I check in my performance improvements.

Format of Converter.Paths Configuration

When specifying the Convertor.Paths Configuration setting, there must not be a / between the final character of the path name and the ~ preceding the branch name.

If a / is present between these two elements, then the workaround for file deletions will not occur successfully.

This surfaces in Processor.cs in line 406 where the "path to be deleted" is calculated.

Unable to run exe file

Hi ..

I replaced my vault client api dll and recompiled this package and created exe file. When I run my exe file I got below error. Any Idea on this and how to fix this. I tried with admin account but same alert window came.

image

No working folder set error

Hi,
I was using the "robe070/vault2git2"July 2013 drop code. following exception we get as error while execute the Vault2Git.exe. Please help me in this regards.

here is config information:
add key="Convertor.Paths" value="$/<PROJECT_NAME>~master;$/<PROJECT_NAME>/Branches/~branch"/>

Error:
Exception $/<PROJECT_NAME> has no working folder set. getting Version 8 from Vault
repo. Waiting 5 secs and retrying...

Unhandled Exception: System.Exception: Cannot get transaction details for 217286

at Vault2Git.Lib.Processor.Pull(IEnumerable`1 git2vaultRepoPath, Int64 limitC
ount) in C:\project\tool\vault2git_app\new\vault2git2-b713dcd09fedf83e61f9431536
47b09c4fd9a470\Vault2GitLib\Processor.cs:line 345
at Vault2Git.CLI.Program.Main(String[] args) in C:\project\tool\vault2git_app
\new\vault2git2-b713dcd09fedf83e61f943153647b09c4fd9a470\Vault2GitCLI\Program.cs
:line 217

Vault2Git crashes if Vault path changed in earlier revisions

I'm not sure if this is a bug that can be fixed in Vault2Git, or a bug in Vault itself. I have a Vault path that looks like this:

$/company/dev/proj1/

But this path has changed thoughout history. For revision 1, the path looked like this instead:

$/proj1/dev/

I configured Vault2Git with the current path (first one I listed), but it quickly fails with a 'System.Exception':

Unhandled Exception: System.Exception: $/company/dev/dev has no working folder set.
at VaultClientIntegrationLib.GetOperations.performGetVersion(String objectPath, Int32 version, String strDestFolder, GetOptions getOptions)
at VaultClientIntegrationLib.GetOperations.ProcessCommandGetVersion(String objectPath, Int32 version, GetOptions getOptions)
at Vault2Git.Lib.Processor.vaultGet(String repoPath, Int64 version, Int64 txId) in D:\git\vault2git\Vault2GitLib\Processor.cs:line 378
at Vault2Git.Lib.Processor.Pull(IEnumerable`1 git2vaultRepoPath, Int64 limitCount) in D:\git\vault2git\Vault2GitLib\Processor.cs:line 139
at Vault2Git.CLI.Program.Main(String[] args) in D:\git\vault2git\Vault2GitCLI\Program.cs:line 140

The path given in the exception makes no sense, I don't think that path has ever existed. I tried a few modifications to the code to attempt to handle this, such as setting the working folder for the path in the exception, as well as setting it to the path that I expect it to be (second one listed). In either case, setting the working folder throws an exception "$/proj1/dev does not exist in the repository", which is correct for the current head of the repo.

Any idea how to fix/workaround this?

How do you configure the path?

It's not very clear in the documentation how to configure the paths. Can you show an example? What paths? why more than one?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.