blacklabelops / volumerize

Docker Volume Backups Multiple Backends
https://hub.docker.com/r/blacklabelops/volumerize/
MIT License
558 stars 77 forks source link

Restore not working #44

Closed andheiberg closed 6 years ago

andheiberg commented 6 years ago

Project looks cool and feature rich. However, I'm failing to get it working on a reduced test case to see how it works in practice.

test.zip

If you read the readme I've explained the series of steps taken. I'm sure there's something really obvious I've missed.

Extract of the readme for your ease:

A simple container that just logs the current time to a file time.txt in an attached volume.

We can use this to test that volumerize does indeed work.

Right run the container:

docker-compose up

You will see it generating time stamps. At some point we decide it's time to back it up.

We stop our container:

docker-compose stop

We start the volumerize container:

docker run -d \
    --name volumerize \
    -v test-volume:/source/test-volume:ro \
    -v backup_volume:/backup \
    -v cache_volume:/volumerize-cache \
    -e "VOLUMERIZE_SOURCE=/source" \
    -e "VOLUMERIZE_TARGET=file:///backup" \
    blacklabelops/volumerize

We run a backup:

docker exec volumerize backup

We can stop volumerize and start our container again:

docker stop volumerize
docker-compose up

All our data should still be there:

docker-compose exec test cat /home/test/time.txt

Now let's destroy our container and it's volumes:

docker-compose down -v

We can start the container again to check that the data was lost:

docker-compose up
docker-compose exec test cat /home/test/time.txt

Right we've lost our data. Let's restore it.

Stop our container and start volumerize.

docker-compose down
docker run --rm \
    -v test-volume:/source/test-volume \
    -v backup_volume:/backup:ro \
    -v cache_volume:/volumerize-cache \
    -e "VOLUMERIZE_SOURCE=/source" \
    -e "VOLUMERIZE_TARGET=file:///backup" \
    blacklabelops/volumerize restore

We can start the container again to check that the data was recovered:

docker-compose up
docker-compose exec test cat /home/test/time.txt

At this point I end up with time.txt not containing the original lines from before I forcibly took down the test-volume by running docker-compose down -v

andheiberg commented 6 years ago

Turns out I was missing that volume was named test_test-volume.