Migrating my old git server (on Ubuntu 18.04 LTS) to a new one (on Ubuntu 20.04 LTS), I switched to gitolite3 to manage server authentication. This post explains how.
First, gitolite3 was installed using:
sudo apt install gitolite3(with administrator's key left blank) and configured with:
sudo dpkg-reconfigure gitolite3where:
System user name for gitolite: gituser Repository path: /var/lib/gitolite3Finally, I copied my public key into
/var/lib/gitolite3/.ssh/authorized_keysto give me access to admin SSH authentication to my git server.
Once done, I simply hard copied all bare repository on my old server in the directory
/var/lib/gitolite3/repositories of the new server (except for the repository
gitolite-admin for which I kept the one installed by gitolite configuration). I also made sure that all copied repositories have the proper owner on the new server:
sudo chown gituser:gituser -R *(from within
Then I ran:
su gituser gitolite compile gitolite setup --hooks-only gitolite trigger POST_COMPILE
The last step of the installation was made from my local computer. I first configured the domain name
gitolite.mydomain.org to point to my new git server (with the proper addition in
/etc/hosts and locally cloned the new admin
git clone email@example.com:gitolite-adminIn this directory, I then edited the file
conf/gitolite.confto add all repositories and user rights and I added in
keydirthe corresponding users' keys. Then I pushed that to my new server.
The last step simply consists in asking all users to edit the file
.git/config in their repositories to replace the old server URL by