Open jayaddison opened 2 years ago
To add my own input to this:
On my server I have created a symlink from /var/lib/docker/volumes
to a separate partition (actually a detachable volume but whatever)
And so the backup and restore process is trivial.
Backup:
Restore:
Most backup systems ignore docker and access volumes directly where they are mounted on the host so it's not difficult.
Many people just avoid volumes completely and manually mount containers to paths of their choosing.
And in Kubernetes volumes are also the best way to do things, since the platform is responsible for backup and restore.
@RedlineTriad I'm not sure that your backups would work very well if you are using the default sqlite3 database that this grocy deploys with. So the backup isn't as trivial as you put it. Regardless, I am interested in how you set up the detachable volume. I've been testing with setting up a bind mount, but I haven't gotten through all of it yet.
... you could just mount the volume in the compose file to a sane directory like /home/grocy/backend.
volumes:
app_db: /home/grocy/backend
there, sane edits.
Some (potentially important) operations like backup and restore from volumes currently seem challenging with
docker
.It is possible - after stopping an existing container, you can bind-mount a local directory and the previous container's volume into a single-purpose ephemeral container, copy/archive the relevant filesystem contents into the bind-mountpoint, and then keep a copy of that file to perform a backup -- and then at restore-time, use
docker volume create
to create an empty volume and then follow a similar process to uncompress the archive into the appropriate directory to populate it.Generally something more like a filesystem copy operation and/or
export...import
command pair could be easier though: fewer dependencies, more straightforward to explain, less processing and bandwidth overhead, and hopefully more likely to last the test of time.