Wednesday, February 6, 2013

Migration from gitolite v2 to v3


This is not perfect way to do it !! but nevertheless ...

So if you planing to migrate from gitolite v2 to gitolite v3, by creating new server and moving all repositories as files:

1) remove repo from git/gitolite-admin/conf/gitolite.conf
2) push

3) ssh to git server and tar repository
[rivanov@hydra git]$ cd /home/git/repositories/
sudo tar -cf /export/home/rivanov/testing.tar testing.git

4) create new repo on other git server by means of gitolite (gitolite.conf)

5) ssh to other-git
scp rivanov@git.reveredata.com:/home/rivanov/testing.tar .
tar -xvzf testing.tar
sudo mv testing.git /export/home/git/repositories

5) Files to keep during copy:
hooks - hooks are different so keep them from gitolite v3
gl-conf - here are permissions are stored (it is difference between gitolite v2 and v3)
git-daemon-export-ok - empty file , but let not touch it just in case.


PS:
I tried to do migration by means of "git pull" from one server and "git push" to new server (only one changes of url is required in ".git" folder) - but this approach does not transfer all branches - only master, so you need to do it manually - that is complicated if you have more then 50 repositories in more then 2 branches in each of them.

No comments:

Post a Comment