Anyone knows how to move MariaDB database files to another location (ex: Media smb folder)? I just want to save time in making snapshots by avoiding the database backup. I know that MariaDB into Home Assistant is running through a container and I don’t know how to create a symbolic link from a container to outside…
Sorry for necroposting, but did you manage to achieve this “link”? I mean of MariaDB database to another (network) folder. I have a usb HDD directly connected on my router and have set this up as shared network storage. I’m trying to use this network HDD for the HA database instead of the SSD directly attached to HA. For the time being I cannot run a different MariaDB server and send my data to it, so I just want to “link” my network storage to HA.
I’ve been trying to bind mount (mount --bind option) the MariaDB database folder to the shared network folder with no luck: There is this file mariadb.err within the MariaDB container, which is a symlink to /proc/1/fd/1. As soon as I bind mount the folders and try to start the container, the initialization of MariaDB container fails with permission errors particularly for this file. Before this happens some files are indeed written on the mounted network HDD. I’ve tried all available mount options and chown etc. variations with no luck…
In general, how can I manage to have the MariaDB database folder outside of the HA environment (eg. change the /datadir of MariaDB)? The necessary file (my.cnf) is not exposed by the volumes of the addon and, if changed, it’s not preserved across container restarts.
I am in almost the same situation and I want to do the same. I simply added the path to my network attached storage, but get an error.
Did you find a solution for this?