I have am restoring a gitlab backup on a new server (same version which is 8.0.5). Goal is to upgrade to 13.x, but I needed to move to a new EC2 instance so hence the same version.
Went from source install to omnibus
Backup restored just fine
Check shows nothing wrong
DB is now postgresql (was mysql) and looks ok.
When I login, the tail output shows the following
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/users/sign_in" for 127.0.0.1 at 2021-05-19 23:59:46 +0000
Processing by SessionsController#new as HTML
Completed 500 Internal Server Error in 47ms (ActiveRecord: 7.0ms)
NoMethodError (undefined method `namespace' for nil:NilClass):
app/models/project_services/gitlab_issue_tracker_service.rb:35:in `project_url'
app/models/project.rb:374:in `default_issue_tracker'
app/controllers/application_controller.rb:195:in `add_gon_variables'
==> /var/log/gitlab/nginx/gitlab_access.log <==
10.124.52.33 - - [19/May/2021:23:59:47 +0000] "GET /users/sign_in HTTP/1.1" 500 415 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36"
10.124.52.33 - - [19/May/2021:23:59:47 +0000] "GET /favicon.ico HTTP/1.1" 200 5430 "http://10.232.134.84/users/sign_in" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36
Hi @cwainwright
you cannot restore without the secrets file. You need to adjust to the JSON format. The secrets file is essential to preserve your database encryption key.
You can also check doc for steps how to convert Source to Omnibus.
$ sudo gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...
GitLab Shell version >= 2.6.5 ? ... OK (2.6.5)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
hooks directories in repos are links: ... can't check, you have no projects
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/var/opt/gitlab/git-data/repositories: OK
/var/opt/gitlab/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.8.21
Send ping to redis server: PONG
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ... can't check, you have no projects
Redis version >= 2.4.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.1.6)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 1.7.10 ? ... yes (2.4.3)
Active users: 0
Checking GitLab ... Finished
I paste the db_key_base into “gitlab_rails”, but after reconfigure, it gets removed. It is like it wants to remain in “gitlab_ci”. Same for the value of db_key_base under “gitlab_ci”, keeps reverting to some other value.
If I cat the contents of /var/opt/gitlab/gitlab-rails/etc/secret I see the values for db_key_base and secret_key_base are tye same as the value for db_key_base under “gitlab_ci”.
So the value of db_key_base I put under “gitlab_ci” gets stored in /var/opt/gitlab/gitlab-rails/etc/secrets.yml (I pasted the wrong file earlier) after the reconfigure and I see this change reported during execution.
The value of /var/opt/gitlab/gitlab-rails/etc/secret has my secret_token which is correct.
So for some strange reason my DB was empty, it was previously populated before I applied the secret. Maybe I accidentally ran a db:reset in the wrong window.
So I reset the DB and restored from latest backup.
My secrets.json is correct, yet I get the original namespace error.
I suggest to narrow down the root cause of the issue. Don’t do the mysql->postgres and source->omnibus at the same time. Do one first and if it’s working do the other one. I would personally start with source->omnibus.
Doing both at the same time makes troubleshooting unnecessary complicated.
I thought I had to switch to PostgreSQL with omnibus.
In that case I’ll stick with MySQL first. I don’t see any documentation for omnibus and MySQL? Do I just mirror the settings from database.yml into gitlab.rb?
I just need to find a guide to migrate MySQL to PostgreSQL in omnibus. Though according to the documents I can wait until I’m running 12.x
If that doesn’t work I can stay with source installations.