Migration to metadata database when using gitlab docker images

:hugs: Please help fill in this template with all the details to help others help you more efficiently. Use formatting blocks for code, config, logs and ensure to remove sensitive data.

Problem to solve

Since upgrading gitlab to 18.x to 19.x force using database for docker registry metadata, I wish to to migrate but the documentation focus on linux package perspective and self compile gitlab instances.

In my scenario, I already have integrated in official docker image a postgres database and docker registry with default settings that I just activate with:

GITLAB_OMNIBUS_CONFIG |

external_url ‘xxxxxxxxxxxxxxxx’
registry_external_url ‘xxxxx’
registry[‘enable’] = true
registry[‘registry_http_addr’] = “xxxxxx”
registry_nginx[‘enable’] = false

And when I try to follow as much as possible the guide to migrate to metadata database, I enconter problem with registry[‘storage’] part because until now I didn’t need to add this and I think the guide should tell what is the minimal way to migrate in self hosted docker version of gitlab because following the guide force us to enter config that we didn’t need in first place but not following the guide is risky too if we want to migrate properly…

Steps to reproduce

A self hosted instance of gitlab through official docker images 18.11.3-ee, add some docker images to registry then following the guide to migrate to docker registry metadata database

Configuration

GITLAB_OMNIBUS_CONFIG |

external_url ‘xxxxxxxxxxxxxxxx’
registry_external_url ‘xxxxx’
registry[‘enable’] = true
registry[‘registry_http_addr’] = “xxxxxx”
registry_nginx[‘enable’] = false

Versions

Please add an x whether options apply, and add the version information.

  • Self-managed
  • GitLab.com SaaS
  • Dedicated

Versions

  • GitLab (Web: /help or self-managed system information sudo gitlab-rake gitlab:env:info)

System information
System:
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 3.3.10
Gem Version: 3.7.1
Bundler Version:2.7.1
Rake Version: 13.0.6
Redis Version: 7.2.11
Sidekiq Version:7.3.9
Go Version: unknown

GitLab information
Version: 18.11.3-ee
Revision: daa4145c833
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: PostgreSQL
DB Version: 17.8
URL: xxxxxxx
HTTP Clone URL: xxxxxxxx
SSH Clone URL: xxxxxxx
Elasticsearch: no
Geo: no
Using LDAP: no
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version: 14.49.0
Repository storages:

  • default: unix:/var/opt/gitlab/gitaly/gitaly.socket
    GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell

Gitaly

  • default Address: unix:/var/opt/gitlab/gitaly/gitaly.socket
  • default Version: 18.11.3
  • default Git Version: 2.53.ge417bf2

Helpful resources

  1. Check the FAQ for helpful documentation, issues/bugs/feature proposals, and troubleshooting tips.
  2. Before opening a new topic, make sure to search for keywords in the forum search
  3. Check the GitLab project for existing issues. If you encounter a bug, please create a bug report issue.
  4. Review existing troubleshooting docs.

Thanks for taking the time to be thorough in your request, it really helps! :blush:

If you’re running GitLab via the official Docker image, the migration docs can be confusing because they assume a package-based installation. I’d first verify your current registry storage backend and explicitly set registry['storage'] to match it before migrating. The process should work with Docker, but the documentation could do a better job covering this deployment scenario and the minimum required configuration.

Thank you for your quick answer, my problem is since I used docker version, my gitlab.rb lines are for the most of them commented out. And the other file I found (/opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml), don’t seem to have this famous registry[‘storage’] setting

 ## Container Registry
  registry:
    enabled: true
    host: xxxxxxx
    port: xxxx
    api_url: xxxxxx

so most of the settings i know is from gitlab_omnibus_config env variable I gave earlier

I think i found something in /var/opt/gitlab/registry/config.yml

version: 0.1
log:
  level: info
  formatter: text
  fields:
    service: registry
    environment: production
storage: {"filesystem":{"rootdirectory":"/var/opt/gitlab/gitlab-rails/shared/registry"},"cache":{"blobdescriptor":"inmemory"},"delete":{"enabled":true}}

From theses informations is it possible to have a dedicated procedure to make the migration ?