I have a server running docker with btrfs storage driver. How can I migrate it to use a different storage driver? I would like to use overlay2.
I've tried to migrate using the instructions here:
stop docker
rename /var/lib/docker to /var/lib/docker.bak
add {"storage-driver": "overlay2"} to /etc/docker/daemon.json
copy /var/lib/docker.bak to /var/lib/docker (to "get rid" of any btrfs snapshots)
start docker
But after this migration, no containers are present anymore.
I suppose because the directory still has data in /var/lib/docker/btrfs
, and not in /var/lib/docker/overlay2
(they have different "layout", renaming btrfs to overlay2 won't do).
How do I migrate from one storage driver to another, so that any containers which were starting automatically are still present and start automatically?