Files
minimal-setups/content/snippets/0080-gitlab-change-baseurl.md
Wolfgang Hottgenroth b2249c06e9
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
mdwiki test starts
2025-04-14 22:22:45 +02:00

28 lines
761 B
Markdown

<!--
title: 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
```