I've been moving a lot of git projects around lately and although I've mostly been moving from Gerrit (due to department fiat, Gerrit's a fine choice IMO) this should work the same and is relatively easy. Moving the Gerrit history, however will be more difficult.
Here's how to move a repo:
- Clone the project from the current source.
- Create the new gerrit project.
In your local clone of the project you want to move, add the new project location as a new remote:
git remote add NewGerrit ssh://NewGerritServer:29418/NewProject
push to the new remote. To push the full history do:
git push --all NewGerrit
You can also set it to automatically track the new repo by adding a -u flag:
git push --all -u NewGerrit
Migrating the Gerrit database stuff is a much bigger job and honestly I'd suggest you simply forgo it unless absolutely necessary. You can get an idea of what's involved by accessing the database directly through Gerrit's own (terrible) query language, GSQL. It's a lot like mysql except more temperamental and lacking a lot of features.
ssh -p 24981 HOSTNAME gerrit gsql
This will give you a gsql prompt. Try this:
gerrit> SHOW TABLES;
The caps, at least in the version of Gerrit I have access to, are important. (Mine is admittedly outdated.) This will show you around 29 tables and your project history is spread throughout them.
According to this posting from Shawn Pearce (Gerrit project lead) you would need to copy the database to a new db server then manually remove all other projects using SQL. You could then dump the remaining data and import it to the other Gerrit server. NOTE THE CAVEAT: there could be a collision of change_id values. He does suggest a work around for this however:
You could find out the max change_id of the incoming set, go manually bump the destination server's change_id_seq to reserve sufficient id space, then bump all of the old change_ids by some base value so they are in a unique space in the destination... and finally load the rows to the destination.
So it can be done. It is a pain in the hind quarters.