Symlink backup folder to mounted volume

AI-generated summary

helmi is having trouble using a mounted volume for backups in Discourse, encountering server errors when trying to read or create backup files after symlinking and copying ownership. bartv advises configuring the mounted volumes directly in the app.yml file, providing an example that maps /mnt/discourse-data/backups on the host to /shared/backups in the container, which should resolve the issue by ensuring proper volume mounting instead of relying on symlinks.

Hey there,

I’m trying to use a mounted volume for my backups but I can’t seem to get it right. I tried mounting the volume into place (/var/discourse/shared/standalone/backups/default) and tried symlinking the default folder to a different mount folder. I copied the ownership of files and folder over as much as I could see but all I get is a server error in the admin backup section. It can’t seem to read the existing backup files that I copied over and also can’t create new ones there.

Any idea what may go wrong here?

thanks,
Helmi

You need to set this up in the volumes section of your app.yml. Here’s my configuration:

## The Docker container is stateless; all data is stored in /shared
volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log
  - volume:
      host: /mnt/discourse-data/tombstone
      guest: /shared/uploads/tombstone
  - volume:
      host: /mnt/discourse-data/optimized
      guest: /shared/uploads/default/optimized
  - volume:
      host: /mnt/discourse-data/backups
      guest: /shared/backups