How to move postgresql database to a different directory

Hello,

I have done a fresh install of gitlab community edition in a Red Hat Enterprise Linux Server release 7.3 (Maipo) box.

I want to move the postrgresql database /var/opt/gitlab/postgresql to a different directory (out of /var/opt/gitlab). That is going to be /home/git/gitlab.

From my understanding, the procedure that I have to use is the following:

  1. Stop gitlab (gitlab-ctl stop)
  2. archive /var/opt/gitlab/postgresql using tar
  3. save /var/opt/gitlab/postgresql permissions
  4. unarchive to new directory /home/git/gitlab/postgresql
  5. Apply the above saved permissions
  6. make required changes in gitlab.rb
  7. run: sudo gitlab-ctl reconfigure
  8. change gitlab-psql user home directory to new one /home/git/gitlab/postgresql
  9. trying start gitlab ...

Also, what parameters do we need to change in gilab.rb? Just those that refer to a directory? In my gitlab community edition gitlab.rb file all postgresql parameters are commented...

I include as a reference gitlab-community issue https://gitlab.com/gitlab-org/gitlab-ce/issues/672. (I have created this issue in this queue as being suggested in that issue).

Thank you,

Konstantinos

Edited by Chris