Feature request: customizable database location (which could enable automatic cloud backups + multi-device sync)
I just started testing Wealthfolio, and although I'm really liking what I see, I just realized there's no option to modify the (local) path where the database is saved and read from.
If we could do this, the app would automatically gain two major features by my book:
1. Automatic cloud backups By setting the database path to a location in our disk that is cloud synced (e.g.: Google Drive, OneDrive, Dropbox, etc.), we would automatically gain an excellent backup system. I know we can do that manually, but unfortunately manual backups have the nasty habit of never being up to date when your computer fails 😉
2. Multi-device sync In turn, this would also allow us to have Wealthfolio installed in another PC (e.g.: desktop + laptop) and have it load the exact same cloud synced file. So in practice, this would also give us multi-device support without any additional development effort. We should, of course, never edit the database simultaneously from two different devices, but I think that's a negligible and acceptable risk for a PC-only app.
In fact, this is exactly how Portfolio Performance works, and I've been using it from 3 different PCs for years now without a single issue.
Do you think it would be possible to implement this in Wealthfolio? Or is there anything in its current architecture preventing a "clean" separation between the user data and the rest of the files?
We need to be careful when syncing the SQLite database file, as it can lead to file corruption.
In the case of Portfolio Performance, the database is either saved as an XML or as a binary file. But in both cases, I think the file is loaded in memory when you open the app, and when you save it will simply overwrite whatever was on the hard drive. So no corruption is really possible, you just have a (very small) chance of losing data if you overwrite a new file with an old version.
Does Wealthfolio actually use SQL operations to write and read data directly to/from disk? If that's the case I guess you could have issues if you load the "old" (current) version of the database from disk, the original file is updated in the background by e.g.: Google Drive while you're using the app, and then you try to send writes to it thinking it still contains the old data.
Is that the kind of issues you foresee?
To circumvent potential sync issues, the following features could be implemented separately:
- add an automatic backup function (e.g. every X days / on every change...) to a specific folder Y.
- this would already solve the need for regular backups
- add an automatic import function on startup (check if file in backup folder Y has changed, if yes, import)
- Based on hash / timestamp
- this would enable multi-device setups
Resolving this feature request in the manner described above would mean the following:
- Use existing proven import/export functionalities
- Export would include all performance data
- The export will thus be rather large, but at the same time, can also be used in an environment without internet connection (no fetching from data providers necessary)