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

Borg Backup Restore procedure is not working #181

Open
braunMarkus opened this issue Oct 6, 2024 · 5 comments
Open

Borg Backup Restore procedure is not working #181

braunMarkus opened this issue Oct 6, 2024 · 5 comments

Comments

@braunMarkus
Copy link

braunMarkus commented Oct 6, 2024

Describe the bug

The Borg backup software is not working as described or to be more precise, the restoration of any borg created backup is not working for me.
I am using borg locally to create backups on a seperate mounted disk and it creates backups weekly which is working fine.
However, I cannot restore things. Whenever I try to use the described way with "borg export-tar ::" it just throws out a .tar file which is neither recognized by the built-in backup tool when copied to the right location nor if I extract the backed up files locally.
I have the feeling that the path inside the backup is somehow mixed up because when I extract it, the path is always 'home/yunohost/yunohost.backup/tmp/...' instead of '/home/yunohost.app/'.

Context

  • Hardware: Lenovo bare metal (Mini PC)
  • YunoHost version: 11.2.27
  • I have access to my server: SSH & Webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no
    • If yes, please explain:
  • Using, or trying to install package version/branch:
  • If upgrading, current package version: can be found in the admin, or with yunohost app info $app_id

Steps to reproduce

Follow the steps from borg Application page to restore
borg export-tar :: this-tar.tar
yunohost backup restore this-tar.tar
=> Error: Info.json not found or not a valid json file

Expected behavior

Well, just as described in your documentation ;-)

Logs

When an operation fails, YunoHost provides a simple way to share the logs.

  • In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.
  • In command line, the command to share the logs is displayed at the end of the operation and looks like yunohost log display [log name] --share. If you missed it, you can find the log ID of a previous operation using yunohost log list.

After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)

If applicable and useful, add screenshots to help explain your problem.

@xmgz
Copy link

xmgz commented Nov 12, 2024

exactly the same issue:

borg backs up apps and creates a .tar (.tar.gz) which includes (inside) a info.json file.

I've exctracted that file, rename it like app-backup.tar file (app-backup.info.json) but then YNH can not reinstall because than json is malformed/incorrect/etc.

So we have borg backups, but can't we restore apps?

Have you @braunMarkus found any workaround for this issue?

I found about it trying to recover an app after migration to ynh12 (if this is relevant). Also tried .tar.gz without success.

Shouldn't backup-ynh detect this info.json file inside .tar file? Thank you.

@braunMarkus
Copy link
Author

Hi xmgz, I haven't found neither a solution or a workaround.
Today I read something about the tool Duplicati which I am already using on Windows. I did not know that it runs on Linux, too.
I will follow the idea to do yunohost backups and copy those files with Duplicati to various locations but I haven't started yet so it will take some time.
Hopefully, somebody from yunohost borg team will notice this issue in the meantime

@xmgz
Copy link

xmgz commented Nov 18, 2024

welp, "somebody" (me) has posted about

https://forum.yunohost.org/t/borg-restore-backup-file-without-info-json/31979

with reference to this issue here

I have not tried that last ".tar repackaging" yet

@tio-trom
Copy link

tio-trom commented Jan 3, 2025

I came across this nasty surprise today.

image

Checking the folder structure of the same backup done with yunohost (right) and borg (left) I see some structure difference like someone else mentioned here:

image

So I have restructured the Borg backup .tar archive to simply remove the folder structure home/yunohost.backup/tmp/APPNAME/ and it WORKS! Basically the archive contents should be the conf and hooks folders and backups.csv plus info.json files. Directly in the archive and not in other folders inside the archive.

So it is simply an issue with the folder structure of the Borg archives and Yunohost cannot make sense of them.

Can we find a proper solution for this within Borg or Yunohost?

@yalh76

@orhtej2
Copy link
Contributor

orhtej2 commented Jan 3, 2025

My ad hoc theory is that $workdir should be ., and we need to pushd the actual $workdir hereish

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

No branches or pull requests

4 participants