I have postgresql database that is installed on my macOS system drive via homebrew. The system drive is not so big and database is becoming bigger and bigger. I would like to move it to my big data drive if possible. I've found a manual for Ubuntu but it seems it does not fit my case. Because it says that postgresql.conf located in other directory than database itself. But homebrew's DB located at /usr/local/var/postgres with postgresql.conf in it. So I guess I can't just move /usr/local/var/postgres directory to another place because postgresql.conf will be inaccessible.
1 Answer
You could use ln to map in a directory from an external drive.
4 Comments
Duccio A
could you provide more detail? I am not sure what you mean with use ln. Thank you.
Keith John Hutchison
I had a similar issue with iTunes. My iTunes Library was using a large proportion of my internal drive. I created a folder called iTunes on an external drive. I shut down iTunes. I copied over all the files. I deleted the local iTunes library. I then used ln to map in the directory. ln -s /Volumes/csmu-2tb-001/iTunes/ ~/Music/iTunes . When I restarted iTunes it still found the Music where files it expected the files to be even though the files were now on the external drive. By using ln the new location still works with the old path.
dmitry1100
In my case I moved directory /usr/local/var/postgres to my data volume /Volumes/data/postgres and linked it in var with the following command: ln -s /Volumes/data/postgres /usr/local/var/postgres
mikey555
if you're using this method, make sure your external drive's format is compatible with symlinks (a.k.a. soft links). my drive is exFAT formatted is not compatible.