Minimal Setups

Gitlab Change BaseURL in Database

Change URL

After a migration changing the base url in the configuration is not enough. It must also be changed in the database.

  • Adjust the variable external_url in the file /etc/gitlab/gitlab.rb and run gitlab-ctl reconfigure
  • Adjust the canonical URL in the database:
    gitlab-rails console
    ApplicationSetting.current.update!(home_page_url: 'https://neue-url.example.com')
    ApplicationSetting.current.update!(after_sign_out_path: 'https://neue-url.example.com')
    
  • Reading out a value from the ApplicationSetting via the gitlab-rails console is done using
    ApplicationSetting.current.home_page_url
    
  • Clear the internal cache:
    gitlab-rake cache:clear