Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doco and samples for restore #15

Closed
seertenedos opened this issue Nov 16, 2019 · 8 comments
Closed

doco and samples for restore #15

seertenedos opened this issue Nov 16, 2019 · 8 comments
Milestone

Comments

@seertenedos
Copy link

It would be great if there were some samples for restoring the latest. Also it would be great if there was a way to configure it so that if any volume it backed up in the past was empty then it gets auto restored to latest on startup. That said to do that i assume it would have to be one volume per instance as it would have no way to know each folder in the /data folder was a different volume.

I am planing to move my volumes/containers between servers frequently and thought this would be a great way to backup and restore.

@djmaze
Copy link
Owner

djmaze commented Nov 27, 2019

As for the documentation: good idea, we should add some information about restore.

The auto-restore feature is an interesting idea, but I am not sure you really want something like that (restoring a potencially not up-to-date backup) to happen automatically. I think you should develop that idea further and open a different issue for that.

@djmaze djmaze closed this as completed in 10fb7b0 Nov 27, 2019
@djmaze djmaze added this to the 1.1.1 milestone Nov 27, 2019
@seertenedos
Copy link
Author

seertenedos commented Nov 27, 2019

in case you re interested i ended up using the following project to do what i wanted for volumes but i am planning to use yours for things that are not volumes.
https://github.com/srgl/backer

Also thanks for the restore doco

@djmaze
Copy link
Owner

djmaze commented Nov 28, 2019

Wow, a volume plugin which sets up a loopback filesystem. Interesting solution. The drawback seems to be that you have to set up a fixed volume size beforehand.

Personally, I am partially bypassing local volumes by using a hyperconverged minio cluster in conjunction with s3fs-based docker volumes. As those volumes can be mounted on different hosts under unpredictable paths inside docker's plugin directory structure, there is a different service which makes sure all volumes are available under a well-known folder on each host (which Restic can then backup). Sounds complicated, but it is quite easy and seems to work reliably ;)

@seertenedos
Copy link
Author

would your solution handle sqllite databases etc? While the volume plugin i am using is not perfect i know that some things like databases use filesystems in a way that will not work unless it is local normal filesystem and in a lot of cases as far as i could tell using a remote mount via fuse does not work well for them.

Also it is the restore part for me. I really want to make sure i backup when a volume is unmounted and restore if a volume is requested that does not exist locally or if it is out of date i guess. As i said before what i have found so far is close but not perfect so far.

@djmaze
Copy link
Owner

djmaze commented Nov 30, 2019

I really want to make sure i backup when a volume is unmounted and restore if a volume is requested that does not exist locally or if it is out of date i guess.

So that is more like what flocker was trying to achieve? (Sadly, development has been discontinued.) Also, to create and restore a backup each time a container is scheduled to another node sounds like quite some overhead to me..

would your solution handle sqllite databases etc?

Yes, that should work, although with a restricted performance.

With that said, most applications that support sqlite also support complete RDBMS like Postgres. So if possible I switch applications to postgres in conjunction with a HA Postgres cluster running on my swarm. (It works really well!)

@seertenedos
Copy link
Author

what you have said is correct for a swarm or when moving containers frequently. My use case is more 2 isolated docker hosts where the containers are just backing up 99% of the time but if i move to another host or loose my data i want it to restore. This more personal use than work use and i normally just have a few commands to run to restore part or my whole environment once i have docker installed.

@seertenedos
Copy link
Author

I have come back to this one on ubuntu as it is still causing me issues. I am trying to resport the latest version but it seems to join the command and argument together for restic. Testing on ubuntu 18.04.

sudo docker-compose run --rm app restore latest
Trying to initialize remote repository 'azure:test:/' (in case it has not been initialized yet)
Fatal: create key in repository at azure:test:/ failed: repository master key and config already initialized

unknown command "restore latest" for "restic"

Can you tell me what i am doing wrong? I am trying to use this to restore when i create a new remote instance and then i will then use docker-compose up to then run backups while the host is up.

@seertenedos
Copy link
Author

the following seemed to work but is not exactly ideal.

docker-compose run --rm --entrypoint /usr/local/bin/restic app restore latest --target /mnt/data

it would have been nice if the command in my post before this just worked as it is much shorter and nicer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants