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

Duplicated "source folders" on export and import of the same profile #1942

Open
szpak opened this issue Feb 22, 2024 · 4 comments · May be fixed by #2017
Open

Duplicated "source folders" on export and import of the same profile #1942

szpak opened this issue Feb 22, 2024 · 4 comments · May be fixed by #2017
Assignees

Comments

@szpak
Copy link

szpak commented Feb 22, 2024

Description

I was able to reproduce the issue.

Steps to reproduce the behavior:

  1. Create a new profile.
  2. Add one directory in "Sources" (I also added repository, but it is probably not needed to reproduce the problem).
  3. Export profile to JSON (I also changed new_archive_name, but it is probably not needed).
  4. Import profile from JSON (check both "Override * settings").
  5. Switch to the old/new profile (as it is reset to default).
  6. Switch to the "Sources" tab.
  7. Observe duplicated entry/ies.

Environment

  • OS: Linux
  • Vorta version: 0.8.12
  • Installed from: DNF/RPM
  • Borg version: 1.2.7
@TheLazron
Copy link
Contributor

Was able to replicate this issue, would like to work on this

@TheLazron
Copy link
Contributor

So, is overriding supposed to completely, "override" the profile, like replacing all the sources currently present with the one in JSON, or is it supposed to add the sources coming from JSON to the current list of sources.

For a scenario different than the one mentioned in the issue:
Exported JSON profile Pr1.json, has a source ~/Desktop/source_1

And a currently present profile Pr1 has a source ~/Desktop/source_2
So after importing 'Pr1.json', is it supposed to add the source from JSON under the new profile, or completely replace the existing sources.

As per current behavior, the new sources get appended to the list of existing sources under a profile upon overriding. Which explains the duplicate entries mentioned in the issue.

So are we just looking to avoid duplicate entries, or completely replace the existing sources under a profile

@szpak
Copy link
Author

szpak commented Feb 26, 2024

Override existing settings suggests "all settings" should be overridden. If only "Sources" are threaded the other way (what about "exclusions"? for consistency, the same should be applied to them), e.g. to give a user an ability to add extra "sources" into the existing profiles, there could be an extra import settings to treat is that way.

Nevertheless, I don't know if the aforementioned idea would be useful for anybody, and in my opinion, the default behavior would be to override "all backup settings" (including sources and exclusions).

@TheLazron
Copy link
Contributor

@m3nu should I work on this

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