SVN repository migration, replication and debugging how-to

Recently, I was involved in the migration of the infrastructure for one of the large clients of the company I work. Apart from the regular tasks, I was entrusted with one of the important migration activities., the SCM.

We use both Subversion and GIT based on use case and practicality. At the end, I had migrated around 23 repositories, most of them being Subversion. And, migrating and replicating subversion has its own quirks and is not very straightforward.

The following links helped me a lot to figure my way around the replication, migration and debugging issues around it.

http://dynamicproxy.livejournal.com/58569.html

http://stackoverflow.com/questions/2219455/subversion-is-there-anything-faster-than-svnsync

http://serverfault.com/questions/175437/subversion-cant-move-permission-denied

http://serverfault.com/questions/248495/svn-error-rep-repository-uuid-xxx-doesnt-match-expected-xx

http://gregoire.org/2008/09/03/fun-with-svnsync-and-googlecode/

migrating a subversion repository to a pure git repository

Easy Peasy it is …

1. A users list in the below format:

rk = Rajesh Kanna <rk@gmail.com>

mk = Mahesh Kanna <mk@gmail.com>

You can also use the fetch-svn-authors.sh script to generate a users list.

2. Run the following commands now.

mkdir my_app_tmp

cd my_app_tmp

git svn init http://svn.company.net/app/trunk/ –no-metadata

git config svn.authorsfile ~/root/users.txt

git svn fetch

All the commands above are self explanatory if you have worked with git a while. Also, the no-metadata is preceded with two hyphens.

3.  Now get a clean git repo from the git-svn repo.

git clone my_app_tmp my_app

Note: You can also give –bare switch if you want to host it via gitosis, apache + smart-http, etc.

And thats it, you are done.

Import a GIT repository into Subversion

Link: Import a Git repo into Subversion

There are many posts on how to go from subversion to Git, but I couldn’t find a single one on how to go from Git to subversion.

a crash course on git svn.

Link: a crash course on git svn.

Stats

  • 142,057 Hits and counting...

Archives

Follow

Get every new post delivered to your Inbox.