Monday 18 December 2017

SVN to GIT Migration

In this post, I will be describing about how to migrate projects from SVN to GIT. You can follow below steps to migrate your projects into GIT from SVN.

Prerequisites 
You need following softwars to be available on your local machine before proceeding further:
  • Java runtime, version 6 or newer
  • Git, with git-svn included, version 1.7.7.5 or newer
  • Subversion, version 1.6.17 or newer.
Instructions 
Step-1: First download svn-migration-scripts.jar from Atlassian’s bitbucket account.

Step-2: You need to verify required software on your local machine. Execute below command to do the same:

java -jar svn-migration-scripts.jar verify

If you are moving your projects from SVN to GIT, you must want to maintain SVN history in GIT too. But it must be possible where committer names in SVN and GIT are different. For this you need to map committer's names with GIT committer email.

Step-3: Extract SVN committer’s names and store in text file. Execute below command to do same: 
java -jar svn-migration-scripts.jar authors <SVN-URL> > svn-committer.txt 
Step-4: Map every SVN committer’s information with their respective mail id's on GIT. 
For example, while extracting we got below file:

NarendraV = NarendraV < NarendraV@mycompany.com>
AbcX = AbcX <AbcX@mycompany.com>


Now change this file like below. Here, we need to ensure that given email id is configured in GIT. 

NarendraV = NarendraV <NarendraV@abc.com>
AbcX = AbcX AbcX@abc.com

Step-5: Execute below command for converting SVN project to GIT in local:

git svn clone --trunk=/trunk --branches=/branches --branches=/bugfixes --tags=/tags --prefix=origin/ --authors-file= svn-committer.txt <svn-repository-url> <git-repository-name>

Ensure to replace <svn-repository-url> with your SVN repository URL and <git-repository-name> with repository name in GIT.

Step-4: Now create remote repository using BitBucket and push your local SVN to GIT converted project (done in step#5). 

First add remote repository to your local:

git remote add <GIT-Repository>

Now push project to remote repository using below command:

git push <remote-name> <remote-branch>

Example: git push origin develop

If you would like to get more detail, you can refer this link.

Challenges Faced
Here I would like to list out some challenges that we faced during SVN to GIT migration.
  • SVN branch did not follow the branch/trunk/tag standard structure
  • Restructuring/Refactoring projects in GIT. Please refer this link to get detail. 
  • Empty sub-folder migration from SVN to GIT
Hope this post helps you in SVN to GIT migration.

12 comments:

  1. I’m just always astounded concerning the remarkable things served by you. Some four facts on this page are undeniably the most effective I’ve had.
    Data science Course Training in Chennai | No.1 Data Science Training in Chennai
    RPA Course Training in Chennai | No.1 RPA Training in Chennai

    ReplyDelete
  2. Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating
    Python Training in Chennai | Python Training Institute in Chennai

    ReplyDelete
  3. Dial +(1)-888-846-5560 for <a href="https://www.routernumbersupport.com/apple-airport-support/><b>apple airport router technical support</b></a> from expert technicians available 24*7.

    ReplyDelete
  4. Dial +(1)-888-846-5560 for <a href="https://www.routernumbersupport.com/apple-airport-support/><b>apple airport router technical support</b></a> from expert technicians available 24*7.

    ReplyDelete
  5. Dial +(1)-888-846-5560 for apple airport router technical support from expert technicians available 24*7.

    ReplyDelete
  6. Dial +1-888-846-5560 Opera Browser Support Number whenever you need help with opera browser problems.We provide instant help for opera users.

    ReplyDelete
  7. I am bookmarking this page, in the future I might try to write a book to go along with my blog, but I will see. Looking forward for more post with useful tips and ideas. Waxing Edmonton

    ReplyDelete
  8. It’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read.
    Datascience Course in Chennai | Datascience Training in Chennai

    ReplyDelete
  9. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

    AWS Online Training
    AWS Certification Training
    AWS Certification Course Online
    AWS Online Course

    ReplyDelete

  10. Good Post! Thank you so much for sharing this pretty post.
    DevOps Training
    DevOps Online Training

    ReplyDelete