3

I have to move one repository from Gitlab server to Gerrit server along with the history, branches and tags etc.

Could you please suggest me the ways to do it.

user4948798
  • 1,924
  • 4
  • 43
  • 89
  • It's just Git. You should be able to find plenty of information about how to mirror a repo in the internet. If you have a specific problem with that, please post another question later. – StephenKing Aug 19 '17 at 06:17

2 Answers2

2

1) Create the repository in Gerrit using the UI (or ask the Gerrit admin to do that)

2) Clone the Gitlab repository using the "--bare" option

git clone --bare GITLAB-URL

3) Add the Gerrit remote

cd REPO-NAME
git remote add gerrit GERRIT-URL

4) Push all commits, branches and tags to Gerrit

git push --all gerrit
git push --tags gerrit

5) Remove the temp repository

cd ..
rm -rf REPO-NAME
  • Dear Marcelo, Thank you very much for your kind support on time, I have successfully migrated all the repos from Gitlab to Local Git/Gerrit successfully. – user4948798 Aug 24 '17 at 10:08
1

Whenever I need to move a repo (with its full history), I recommend git bundle: it creates only one file, which is easier to move/send/copy around.

You can then clone your repo directly from the bundle file.

That being said, as described in "Restoring a Gitlab Bundle", the gitlab-rake gitlab:backup:create command does bundles for you (except they are tar files)
See more at "Backing up and restoring GitLab".

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250