I’m trying to sync a KeePassXC database between my Android phone and my Manjaro Linux system. I want full two-way sync of changes, but I don’t want deletions on one device to remove the file on the other. What’s the best way to configure this? Tools like Syncthing seem close, but I’m not sure which folder settings or ignore rules would prevent deletion sync while still keeping both sides updated. Any guidance or examples would help. Thanks!

  • non_burglar@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    17 hours ago

    This is the cost of offline password managers. You can’t do this at a file level, there is no way for a sync protocol to merge changes from two files. I say this having suffered thanks of a couple passwords from this exact scenario.

    You either need to exercise diligence in only adding passwords at one place, or run a “real” db-based password manager.

  • just_another_person@lemmy.world
    link
    fedilink
    arrow-up
    17
    arrow-down
    1
    ·
    edit-2
    1 day ago

    What you’re describing is not a two-way sync then. You’re expecting this to be an actual database, but it’s just a flat file with XML at its core. Here’s the file format specification .

    Best you can do is set frontend options to prevent accidental deletions, and keep lots of backups, or put it on a versioning storage backend.

    You may want to switch to a different solution if this is your desired use-case.

  • frongt@lemmy.zip
    link
    fedilink
    arrow-up
    5
    ·
    1 day ago

    I don’t think that’s really possible. Why do you want to do this? What problem are you trying to solve?

      • MangoPenguin@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        4
        ·
        12 hours ago

        That’s what backups solve, for important data like a PW DB you should be running daily backups with versioning. Then if anything gets deleted or corrupted you can restore it easily.

      • rainwall@piefed.social
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        20 hours ago

        Why not use file versioning on either device folder in syncthing to ensure you retain copies of deleted files? The “simple” setting will retain the last 5-10 versions of any file.

        I’d also recommend backing up your data outside of the sync service once a day or whatever interval makes sense to you. That way a wayword sync, even with safeguards, cant really destroy the data.

        • chaospatterns@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          19 hours ago

          I tried that with my KeePass database and then I ended up with different conflict versions if a device didn’t sync to my server before I updated on another device. Then I ended up with the conflict versions and old versions I had manually resolve. The Android Syncthing app could get auto killed by the Android OS for memory/battery saving, so I had to go back to OneDrive style syncing where the KeePass Android app would internally merge and resolve conflicts. It couldn’t do that using the Syncthing style syncing.