docker-gitlab icon indicating copy to clipboard operation
docker-gitlab copied to clipboard

how to replace old domain name with new domain name ?

Open ChainCoderX opened this issue 3 years ago • 3 comments

hello everyone

I have to change the domain name, but right now I can do not know how to do it. I tried a few times, but failed,Could you please give me an example.

thanks.

ChainCoderX avatar Jan 18 '22 11:01 ChainCoderX

Hi @wade-liwei , you need to start container with setting GITLAB_HOST environment variable like : docker run --name gitlab --env 'GITLAB_HOST=gitlab.example.com' sameersbn/gitlab:latest


If you need more help, could you please provide more detail? We don't know how you have set up your environment (docker-compose or Kubernetes are commonly used). One of most easiest way to show us your environment is to provide your configuration file (docker-compose.yml for docker-compose, gitlab-rc.yml for Kubernetes).

Please note that we have no interest in how many times you've tried. We only interest in what exactly you've tried (e.g. modified GITLAB_HOST variable in docker-compose.yml from "GITLAB_HOST: gitlab-before.example.com" to "GITLAB_HOST: gitlab-after.example.com" , ran docker-compose stop gitlab, docker-compose rm gitlab then ran docker-compose up -d gitlab).

Best,

kkimurak avatar Jan 18 '22 11:01 kkimurak

Hi @kkimurak

Thank you help me.

  1. we run gitlab with docker-compose;
  2. I just tried your introduction, but failed. (modified GITLAB_HOST variable in docker-compose.yml from "GITLAB_HOST: gitlab-before.example.com" to "GITLAB_HOST: gitlab-after.example.com" , ran docker-compose stop gitlab, docker-compose rm gitlab then ran docker-compose up -d gitlab)

My ENV:

  1. resolved old domain name to the old machine IP.
  2. imported the code backup file from old machine into the new machine.
  3. resolved new domain name to the new machine IP.
  4. access the new domain name, redirected to the old domain name.
  5. right now, I resolve the old domain name to new machine IP, but I just want to only use new domain name.

there are NGINX before gitlab on the old and new machine.

docker-compose.yml on the new machine

- GITLAB_HTTPS=true
- SSL_SELF_SIGNED=false
- GITLAB_HOST=localhost      # default(localhost) or the new domain name, I always  get the same result.

ChainCoderX avatar Jan 19 '22 02:01 ChainCoderX

Hello, sorry for being late. Thank you for your report. I understand a little about what you want to do. On new machines, I think it's okay to set GITLAB_HOST to the new domain name. I have never experienced such a situation, but what is the setting of "NGINX before gitlab"? I personally suspect that if a redirect happens, it's here.

kkimurak avatar Jan 28 '22 15:01 kkimurak