Uberleet

Linux Systems Articles for better insights

Getting inside the embedded Postgres on Gitlab CE


Gitlab CE has some long-standing bugs that require backend changes. It might be part of their business model. One instance comes to mind when you add an LDAP user and have an existing non-ldap user with the same name or email address, it will break gitlab for them.

This guide will detail how to get into postgres, and in this case how to add the LDAP property to a pre-existing account to properly migrate from standalone to LDAP.

Assume postgres access on gitlab CE

sudo -u gitlab-psql -i bash
/opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d gitlabhq_production

This may also work

sudo -u gitlab-psql /opt/gitlab/embedded/bin/psql -h /var/opt/gitlab/postgresql -d gitlabhq_production