doc/administration/operations/migrate_to_subdomain.md
{{< details >}}
{{< /details >}}
You can migrate GitLab from a relative URL configuration to a subdomain deployment.
The downtime during migration depends on your deployment architecture and load balancer configuration:
[!warning] GitLab must be configured with the actual URL it will use. You cannot configure GitLab for one URL and use a load balancer to present a different URL to users because GitLab generates absolute URLs internally for API responses, emails, and UI elements.
To migrate from a relative URL to a subdomain:
Update your GitLab configuration to disable the relative URL configuration based on your installation type.
{{< tabs >}}
{{< tab title="Linux package (Omnibus)" >}}
Edit /etc/gitlab/gitlab.rb and update external_url to use the new subdomain:
external_url "https://gitlab.example.com"
{{< /tab >}}
{{< tab title="Helm chart (Kubernetes)" >}}
Update the global.hosts configuration to use your new subdomain.
{{< /tab >}}
{{< tab title="Self-compiled (source)" >}}
Follow Disable relative URL in GitLab.
{{< /tab >}}
{{< /tabs >}}
To apply the new subdomain configuration, follow the upgrade process for upgrading a GitLab instance applicable to your installation type.
Changing the URL changes all remote URLs, so you must manually edit them in any local repository that points to your GitLab instance. Any local repositories cloned while using the relative URL have remote URLs pointing to the old path, and users must manually update these.
If you must preserve existing links during a transition period, configure your load balancer to redirect legacy relative URLs to the new subdomain.
After migrating GitLab from a relative URL to a subdomain, configure your load balancer to redirect old relative URLs to the new subdomain:
/gitlab/).