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:
- Stop gitlab (
gitlab-ctl stop) - archive
/var/opt/gitlab/postgresqlusing tar - save
/var/opt/gitlab/postgresqlpermissions - unarchive to new directory
/home/git/gitlab/postgresql - Apply the above saved permissions
- make required changes in gitlab.rb
- run:
sudo gitlab-ctl reconfigure - change
gitlab-psqluser home directory to new one/home/git/gitlab/postgresql - 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