aarelovich
aarelovich

Reputation: 5566

Restoring gitolite backup not working

I've recently had to reinstall de SO on our server. It uses a Debian OS. I've reinstalled the gitolite3 package. During the installation it asks me for a admin key. I used the exact same stanza that was found in the admin.pub in the keydir of the gitolite-admin backup that I had.

So then I start a test. I clone the gitolite-admin repo on another place in my computer. No problems there. I make a minor modification and push it. Still all is working. So now I copy one of my backup called aes.git into the /var/lib/gitolite3 folder. use this command to make sure permissions are right:

chown -R gitolite3:gitolite3 dea.git/

And I try to clone it (and, yes, I have RW+ permissions on that repo). I get this:

git clone gitolite3@pc00:dea.git
Cloning into 'dea'...
FATAL: R any dea admin DENIED by fallthru
(or you mis-spelled the reponame)
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Tried it for another repo and it is the same thing. Can anyone tell me what might be going on?

Upvotes: 3

Views: 1061

Answers (2)

Scott Deagan
Scott Deagan

Reputation: 443

I know this is a very old post, but still use gitolite3, and here's what I do to restore gitolite3 from a backup:

  • Install gitolite3: sudo apt install gitolite3
  • Remove default installed directory: sudo rm -rf /var/lib/gitolite3
  • Copy the backup to /var/lib/gitolite3: sudo cp -a gitolite3 /var/lib/
  • Change permissions: sudo chown -R gitolite3:gitolite3 /var/lib/gitolite3
  • Switch to the gitolite3 user: sudo su gitolite3
  • Run: gitolite setup

That's it, you're gitolite3 backup should now be restored. Test with:

Upvotes: 0

aarelovich
aarelovich

Reputation: 5566

Well, I've solved it. However I'm not entirely sure what was wrong. My theory is that it was the cp command I used when copying the files. I think it did not completely overwrote the .git folder as I expected.

What I did now is this: Clean install. 1) Cloned the new gitolite-admin repo and copy and pasted the information of the old conf file into the new one. 2) Copy and pasted all keys into the new keydir. Pushed changes (this created all repositories).

Then in the server i used cp with the switches -af (I had not used the f before):

 cp -af /home/gitolite_old/repositories/*.git ./

Obviously, I was standing the in the new repo directory. Then I did:

chown -R gitolite3:gitolite3 *

Then it started working. At least the first few tests. Will see what happens with repos I had no access to.

Hope this helps someone....

UPDATE

Other users of the system started using it with no problems. The reinstalation was completely transparent to them. This worked.

Upvotes: 2

Related Questions