I had to restore a gitlab installation and after that I had to recover admin rights.
So I needed to go through gitlab-rails and the console, and it requires a bit of patience before the prompt shows up
root@testgitlab:~# gitlab-rails console production Loading production environment (Rails 4.2.10) irb(main):001:0>
Then I gotta find myself (created a user using the signup page).
user = User.find_by(email: 'firstname.lastname@example.org') => #<User id:13 @mon> puts user.access_level regular => nil
And restore my access level to the server.
user.access_level=:admin => :admin
This might also do the trick..
This is also where I can change the password
user.password = 'secret_pass' user.password_confirmation = 'secret_pass'
And do not forget to commit the user so the changes stick.
irb(main):034:0> user.save! => true
I found the hint for this on Gitlab How to reset your root password