Skip to content

Relocate packaged Postgres

Description

Changing the data-dir for Postgres requires additional steps for a working setup.

The options in the gitlab.rb file that changed where:

postgresql['data_dir'] = "/export/gitlab/postgresql/data"
postgresql['dir'] = "/export/gitlab/postgresql"
postgresql['home'] = "/export/gitlab/postgresql"

These changes where applied on a new download of the 8.13.6 EE RPM package. The settings where changed after package installation and reconfigure was run after editing.

There were two problems:

  1. The runsvdir process was not getting started so the reconfigure would hang waiting for it to start, we had to start it manually.

  2. Even after relocating postgres directories as above, postgres would fail to start. We discovered that postgres was still attempting to use /var/opt/gitlab/postgresql directory for it’s lock file. We had to manually create that directory before running reconfigure, then postgres would relocate and start fine.

/cc @marin