-
Notifications
You must be signed in to change notification settings - Fork 722
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
Add remote borg backup support #4804
Conversation
Signed-off-by: Tim Diels <[email protected]>
Signed-off-by: Tim Diels <[email protected]>
Signed-off-by: Tim Diels <[email protected]>
Signed-off-by: Tim Diels <[email protected]>
Signed-off-by: Tim Diels <[email protected]>
Signed-off-by: Tim Diels <[email protected]>
I.e. do not support aio-lockfile for remote borg repos. Let's wait and see if if somebody requests it. Signed-off-by: Tim Diels <[email protected]>
Signed-off-by: Tim Diels <[email protected]>
Signed-off-by: Tim Diels <[email protected]>
Signed-off-by: Tim Diels <[email protected]>
4d3e48c
to
7e96d1d
Compare
Hi, first of all thank you for your contribution! I've thought a bit about this the last week and came to the conclusion that I do not want to maintain this since it requires an additional server for me for testing (with a not so easy to reproduce setup) and has the potential of many users needing help getting this to work (and thus only a limited usecase). So I would still only test local backup also in the future. However I would be fine with merging this if you @timdiels would step in as the maintainer of this feature. That means if bug reports or any questions regarding this feature come in, I would ask you for help on the topic. If that is fine for you, I would continue with the review.
Yes, this is expected and documented.
Sounds good!
Yeah, we could create a dev instance from this if we proceed...
Yes |
Hi,
I'm willing to maintain it, mostly on weekends, for as long as I'm a nextcloud user (which I have been for a couple of years so far).
I will do it on the dev build after I've made the change you suggested.
Is there an easier way to develop than the hacks I did (in a different branch) for local testing? Not sure how you normally test AIO? If it's always via push to github, wait for build and deploy, I will probably keep my debug branch for later. Note to self:
|
Cool, then we can go ahead with this PR. I've invited you to the repo for easier collaboration :)
Great :)
Usually it is indeed always via push to github, wait for build and deploy. So probably it is easier for you to keep your debug branch 👍 |
Very much appreciate the PR guys! |
Signed-off-by: Tim Diels <[email protected]>
Signed-off-by: Tim Diels <[email protected]>
I tried out local backups on my machine and made all the requested changes I believe. Could we get a a dev build going? |
@timdiels one last task is then to resolve the conflicts after handling the comments. Afterwards I will create a final image from the branch for a last testing round. |
…-backup3 Signed-off-by: Tim Diels <[email protected]>
Signed-off-by: Tim Diels <[email protected]>
@szaimen I believe the only remaining comment was to keep the excludes in sync. I've merged main into it. Could you create the new image? |
Yes
I created new images 👍 |
@timdiels just a few suggestions to not print out borg info to not spam the logs... |
Signed-off-by: Tim Diels <[email protected]>
Signed-off-by: Tim Diels <[email protected]>
I retested the remote backup, still works. |
Signed-off-by: Tim Diels <[email protected]>
Signed-off-by: Simon L. <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you very much! 🥳🎉🚀
This is now released with v10.0.0 Beta. Testing and feedback is welcome! See https://github.com/nextcloud/all-in-one#how-to-switch-the-channel |
Is there a way to back up to remote and local? Unfortunately I can't find any way to "reset" my old backup option (different path) somehow, even after following: 5593 (except step 5, since I'm already on 10.0.0). Since I'm not sure how it's working currently I'll just give you how I did backups until now, once a day to local and once a week to remote. In general I never expect to use the remote only in natural disaster situations, and then I can accept loosing the last week. If this option isn't available, this could be a nice thing to add. |
This adds support for backing up directly to a remote borg repo. (I tried reaching out earlier)
Why?
I'd like to backup/restore via the UI, resist ransomware and store the backups remotely without storing a local (compressed) copy of the nextcloud data.
Alternatives (https://github.com/nextcloud/all-in-one?tab=readme-ov-file#are-remote-borg-backups-supported):
How to use it
Instead of entering a local repo path (which remains supported), you can choose to instead enter a remote borg repo url. (These screenshots are from a disaster recovery but it's analogous, just ignore the passphrase):
The first you try to initialise the repo, the backup container will create an ssh key and foolishly try to init the borg repo resulting in error because you have to authorise the ssh key it generated first. So, e.g. I copy paste the public key shown here to my borgbase repo:
Then I can try again as instructed and it should work. The following backup info is shown:
Changes
borg extract
because, at least with a remote repo,borg mount
is very slow (20 seconds vs 24 minutes restore for pretty much an empty nextcloud install).FYI Oddly the original code never restores host-mounts.
Testing
I hacked the code til I could run local deployments of nextcloud-aio without any builds and manually tested:
TODO