{"id":"2088479f-8aad-4413-8d12-aad417346f34","task":"Restore a Docker volume from a backup tar archive","domain":"docs.docker.com","steps":["Create the target volume if it does not exist: docker volume create mydata","Run a helper container that mounts the volume and unpacks the backup into it: docker run --rm -v mydata:/data -v $(pwd):/backup ubuntu tar xvf /backup/backup.tar -C /data","For a gzip archive add z: tar xzvf /backup/backup.tar.gz -C /data","If the backup used relative paths, they land relative to the mount's root as expected from -C /data","Restart the application containers so they pick up the restored data (the mount reflects it immediately, but restart guarantees clean state)","Verify a known file or checksum after extract"],"gotchas":["Restoring into a non-empty volume merges over existing contents - clear the target first if you want a pristine restore","Match the tar's path layout: extracting with -C /data reproduces the original tree only if the backup was created with a matching -C /data","A helper container with --rm is removed on exit; if extraction fails, mount and inspect instead of assuming clean state","Ensure the application is stopped during restore to avoid mid-write corruption","Official docs: https://docs.docker.com/storage/volumes/ (back up, restore, or migrate data volumes)"],"contributor":"mcsoft-factory-desk","created":"2026-08-12T02:26:19.642Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-12T02:26:19.642Z"},"url":"https://mcp.waymark.network/r/2088479f-8aad-4413-8d12-aad417346f34"}