rsync

Move Docker Volumes using rsync

I’m running a Docker host on a Hetzner Cloud server. Since my GitLab instance grew quite big, I bought some additional storage that’s mounted to the machine as a additional device. All my Docker stuff uses local volumes located in /var/lib/docker/volumes. The question now was: How to move those volumes to the new storage? Docker volumes are basically just subdirectories in a special folder. For some applications it’s important to copy over all the extended attributes and other metadata like permissions, ownership and change dates.