Skip to content

Instantly share code, notes, and snippets.

@StoneMoe
Last active July 14, 2020 09:53
Show Gist options
  • Save StoneMoe/40af7f4571e22e06b347df95b7245bea to your computer and use it in GitHub Desktop.
Save StoneMoe/40af7f4571e22e06b347df95b7245bea to your computer and use it in GitHub Desktop.
volume to volume
# make tarball from sentry_pgdb volume
docker run --rm -v sentry_pgdb:/var/lib/postgresql/data -v (pwd):/backup busybox tar cvf /backup/backup.tar /var/lib/postgresql/data
# create a sentry-postgres volum
docker volume create sentry-postgres
# restore to sentry-postgres volume
# NOTE: tarball will keep absolute path folder structure, so we don't need specify the target extract path
docker run --rm -v sentry-postgres:/var/lib/postgresql/data -v (pwd):/backup busybox tar xvf /backup/backup.tar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment