Move discourse to another partition

How can I move my discourse to home partition? Right now all discourse data is in root partition and its growing fast. I am getting close to no space in my root partition.

df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/cl-root   50G   30G   21G  59% /
devtmpfs             7.7G     0  7.7G   0% /dev
tmpfs                7.7G     0  7.7G   0% /dev/shm
tmpfs                7.7G  731M  7.0G  10% /run
tmpfs                7.7G     0  7.7G   0% /sys/fs/cgroup
/dev/sda2           1016M  176M  840M  18% /boot
/dev/sda1            200M  9.5M  191M   5% /boot/efi
/dev/mapper/cl-home  221G   86G  136G  39% /home
tmpfs                1.6G     0  1.6G   0% /run/user/0
overlay               50G   30G   21G  59% /var/lib/docker/overlay/569939c5551cf2b821429584916dcaec83a644384abcd4c35b6423d58471fa92/merged
shm                   64M  4.0K   64M   1% /var/lib/docker/containers/97dbcf0e733dde1cf80748fbde49bb770587c23e675c4610f9ceca12c6aecd56/shm

The easiest way is to make sure Docker is stopped, move the offending folder(s) and create symlinks so they still appear in the original locations.

Make sure that whatever you do to /var/lib/docker/ and /var/discourse, they stay on a volume with good performance characteristics, or you’ll be in for a bad time :slight_smile:

6 Likes

Could even just move /var/discourse/shared. The image itself doesn’t grow too much, while the uploads & database will.

5 Likes