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

Include user settings in backup file #172

Open
DominikNovosel opened this issue Nov 13, 2022 · 3 comments
Open

Include user settings in backup file #172

DominikNovosel opened this issue Nov 13, 2022 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@DominikNovosel
Copy link
Contributor

Currently, the backup database only restores event entries, but nothing from the settings page is retained, which is annoying if one happens to not remember what their settings were, or simply due to the tedium of changing them all again.

It seems to me that the backups are, at least partially, intended for sharing, which is problematic in and of itself, because all existing entries are overwritten when importing and it's not possible to transfer individual events, and I'll open another issue for this. Regardless, to try to partially accommodate this use case and avoid forcing the user's settings upon someone else, some simple changes to the import logic and interface could allow the user to choose whether to only import the events, the settings, or both.

@m-i-n-a-r
Copy link
Owner

I agree, but we have to consider 2 important aspects:

  • Birday backup, as of now, is just a raw copy of the internal db of the app. You can prove it yourself, just try to open a Birday backup using any SQLite DB browser, and all you will see is a table 😄 this means that overwrite any previous entry is mandatory, else i would have to find a way to open this db file, extract its entries, and load in the current DB. That's surely possible and i'll add it to the "try and probably fail" todo list though!
  • Settings should be part of the auomatic Google backup, if the app is installed via Play Store, and are not part of the Birday backup not only for what i wrote in the previous point. Another good reason is that a Birday backup is backward compatible and can be exported and imported with almost any version of the app, while the settings are added and removed, and a backup taken on v3.1.1 is not easily restorable in v4.0.0. I would have to write a logic to recognize unsopported or removed settings and avoid processing them. This is possible of course, but i need help: for example, how do i bundle settings with the db?

@m-i-n-a-r m-i-n-a-r added enhancement New feature or request help wanted Extra attention is needed labels Nov 14, 2022
@DominikNovosel
Copy link
Contributor Author

Hey! Long time no see, huh? I've been pretty busy lately and all but forgot about this conversation, but rest assured, my interest in this app hasn't dwindled.

Settings should be part of the automatic Google backup

Curiously, this never seemed to work for me, even though I did end up migrating to a Google Play installation of Birday some time ago. Maybe this feature is region locked or something.

Unfortunately, I don't know how to implement this either. I'm very much out of my depth when it comes to software development, and databases seem to be a deeper rabbit hole than I thought. I was very much under the impression that this would be relatively simple to implement.
For instance, if I understood correctly, since the backup is a verbatim copy of the entire database, the import backup function works by simply overwriting the existing DB, rather than merging with it. As for the settings, I don't really understand the barrier to bundling them with the DB, but assuming you overcome said barrier, and assuming the settings data would be structured as identifier+value, would it be possible for the settings import function to iterate through a list of parameters a particular version of Birday supports, look them up in the backup file and use their corresponding values to update the settings in the app? The result should be that any removed settings still present in the backup will be ignored.

@m-i-n-a-r
Copy link
Owner

Hey 😄 glad to know you're still interested in the project!
The Google backup shouldn't be region locked, and you should find your backed up apps under Google Drive > backups > App data. But, I have to admit that this kind of backup fails sometimes, and it's not totally reliable.
What you said is possible in theory, but quite hard to implement. I don't think I will work on it before the next update beause I already added quite a lot of stuff, but it's something I want to do. Another possible approach (simpler to implement and maybe to use?) would be to simply have an "export settings" feature. In this way, I could simply write and export an xml, or json file, and the user could import it manually whenever he wants.
The funny part is that I could easily join the settings and the csv/json export formats, compared to the standard db export, but I don't think I will. At the moment, I prefer the "export settings" solution 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants