Moving postgresql 9.4 data directory in fedora 22 -


i know how move postgresql database directory in fedora 22 installation. in ubuntu, straightforward using pg_dropcluster , sudo pg_createcluster -d /the/new/location/ 9.4 main, fedora not appear have of sort.

i copied directory /var/lib/pgsql/data new location and, did following:

su - postgres service postgresql stop export pgdata="/the/new/location/" echo $pgdata # gives correct /the/new/location/ service postgresql start psql show data_directory; 

which still results in default /var/lib/pgsql/data...

could please either provide link relevant , up-to-date tutorial or explain how complete move?

note: aware question has been answered other distributions , older versions of fedora , psql, seems lot of files have been moved , none of approaches seem work me.

so turns out method out of date. correct way add file nano /etc/systemd/system/postgresql.service:

.include /lib/systemd/system/postgresql.service [service] environment=pgdata=/the/new/location/ 

i believe requires reboot.

afterwards, 1 still has set selinux correctly before postgresql can start up.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -