Created
February 14, 2025 14:45
-
-
Save reidransom/a9d0843ae78f87a08a6f6a1e7bf40904 to your computer and use it in GitHub Desktop.
Here's one way to move docker volumes from host to host which comes in handy for me as I tend to change my workstation often.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Backup/export docker volume to tar archive | |
docker run --rm -v pgdata:/in -v ./:/out ubuntu tar cvf /out/pgdata.tar /in | |
# Restore docker volume from tar archive | |
docker run --rm -v pgdata:/out -v ./:/in ubuntu bash -c "cd /out && tar xvf /in/pgdata.tar" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment