vorta icon indicating copy to clipboard operation
vorta copied to clipboard

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

Open szpak opened this issue 1 year ago • 4 comments

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

szpak avatar Feb 22 '24 23:02 szpak

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

TheLazron avatar Feb 26 '24 18:02 TheLazron

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

TheLazron avatar Feb 26 '24 19:02 TheLazron

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).

szpak avatar Feb 26 '24 21:02 szpak

@m3nu should I work on this

TheLazron avatar Mar 04 '24 19:03 TheLazron