AFter Restoring Gitlab Backup 2FA keeps on failiing

Problem to solve

Community version
I restored my gitlab backup from below command

gitlab-backup restore BACKUP=1713995059_2024_04_25_15.6.0

When i try to login it takes in password and asks for 2fa when i try my Authenticator code it shows invalid

I tried to disable the 2FA using below command

gitlab-rake gitlab:two_factor:disable_for_all_users

then i am able to login but it again shows me the setup screen for 2FA. When i do that and try to confirm but it still shows incalid code.

I have checked the Time for server and my system its same.

Steps to reproduce

Which troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?


I expect you didn’t restore /etc/gitlab/gitlab-secrets.json, as this is also required when restoring and is most likely the reason for your situation. This should also be restored alongside /etc/gitlab/gitlab.rb.

1 Like