gnucash-android icon indicating copy to clipboard operation
gnucash-android copied to clipboard

Feature Request: Database Sync

Open alensiljak opened this issue 8 years ago • 10 comments

So far, people have been mostly asking about synchronizing their mobile database to desktop. Which is the most common need for any GnuCash user, naturally.

Here I would like to have synchronization between different Android devices. Meaning uploading the whole database to a cloud service and using it at another device.

Again, this is something I've worked on before (in MMEX) and would be happy to share any insights. The code is also available at MMEX 4 Android repository for anyone to have a look at the implementation. Using a built-in sync service would be my preference, instead of having a custom scheduled task. And this also seems to be the direction in which Android 8 APIs are moving, it seems.

Any thoughts?

alensiljak avatar Sep 27 '17 07:09 alensiljak

We have been working in this direction for some time, just not quite gotten to it. There are lots of things to iron out along the way which set the stage for sync.

One thing I would like to have before any sort of sync is that the database schema of the Android app and schema of desktop GnuCash should match. This would enable any sync work which is done to immediately be applicable to both other mobile devices and to the desktop GnuCash.

This would require a lot of rewriting of some logic for fetching data from the database. But once that is done, I think it would give us a more solid base to work with in the future. Such as allowing the app to open GnuCash files which were created on the desktop without fear of messing anything up.

I started some work on merging the schemas, but it's still in a highly volatile state. I'll maybe publish it as a branch so others can contribute to it before we merge into develop.

When you say a built-in sync service, I assume you mean something using a SyncAdapter right?

codinguser avatar Sep 28 '17 14:09 codinguser

Re: Sync Adaptor - Yes, correct. That's exactly what I meant. I've seen reports that the background service, which we use now, doesn't work correctly on Android 8.

Database schema adjustment to match the desktop looks like more work to me. It does not have a direct effect to synchronisation feature except that it takes valuable time from available devs, I guess?

More importantly, I was using CloudRail to work with multiple cloud storage providers. Would such a library be even suitable for this project, considering it is not Open Source (even though it is free for OS projects)?

alensiljak avatar Sep 28 '17 15:09 alensiljak

Just to note that I had second thoughts and somehow prefer to have the mobile application (and database) separate from the desktop, main one. That seems to provide more insight and control over data. In that sense, the synchronization might not be as important as long as the export feature is there (which is great, btw).

alensiljak avatar Nov 08 '17 15:11 alensiljak

I, for one, would really appreciate this feature. Right now what I'm doing is export transactions from mobile to desktop every once in a while, and once a month wipe out my data on mobile and copy my desktop accounts back to Gnucash Android. Which is not ideal (e.g. I have to setup my widget again).

hanophora avatar Nov 09 '17 14:11 hanophora

Hi, @Pikrass, I'm not sure why you have to export back and forth so I'll share my understanding. Note that this is an exercise for me before making the switch to GnuCash for real.

  1. If you want the same transactions on mobile and desktop. Simply export or copy the whole data file from mobile to desktop. As this seems to be your main scenario, you can simply use an external file sync utility. For more info, see this issue. There are some clients that I found at that time. Possibly there are better options now and the old ones may have been updated. There is a problem with supporting synchronization with various services as API libraries go out of date, users prefer different services, etc. In MMEX, I implemented CloudRail, which supports several main cloud storage providers but users still keep asking for more. I'd prefer if the devs dedicate that little time they have for voluntary projects to developing GnuCash for Android and not sync adapters for various services. And let the sync app devs take care of that part. That's my view.

  2. If you want to only export the transactions from mobile to desktop. This is my favorite scenario. Mobile is just a temporary storage that's being filled as the transactions are made during the month. Then, once a month, approximately, all the transactions are exported to the desktop and deleted. Balances are updated, either automatically or manuall from the desktop as there could be other transactions that were entered on desktop but not on mobile.

  3. If you export the transactions to desktop and want to import back only the accounts but no transactions back to mobile, it should be enough to export the accounts into the same file path as before. That way you would not need to adjust the widget but would have to update the balances, I guess.

alensiljak avatar Nov 09 '17 14:11 alensiljak

I'm really appreciate this feature,too. Really happy to know the feature on the plan list. but as a user in the country which the net is not work well for same reason,Hope the sync also can built on the webdav,maybe sometimes the ip will block by same reason ,at least i can use it on my own webdav server to sync the date. ~

Tback1 avatar Nov 16 '17 15:11 Tback1

Any updates on this?

G-Pereira avatar May 06 '22 07:05 G-Pereira

I'm also hoping to get this sort of thing working, such as a WebDav (with optional resting-key encryption that each device needs to decrypt data) but with healing in transactions. Ex: I enter all info into Desktop, go away on a trip and enter info in my phone (offline), turn off phone, come home and enter info, then turn on phone and let it sync too, all devices re-sync. Trying to find some cross-platform solution, especially with regard to automatically pulling financial info from institutions, seems near impossible unless I used something like Firefly III, but that's online-only. Was willing to tolerate Gnome's CSD crap, but *cringe-at-CSD*..

OdinVex avatar Jan 31 '23 21:01 OdinVex

This repository is dead. The developer stopped working on this several years ago. Some people try to revive it, though, look here https://github.com/GnuCash-Pocket/gnucash-android and help if you can.

Kaligula0 avatar Feb 01 '23 12:02 Kaligula0

This repository is dead. The developer stopped working on this several years ago. Some people try to revive it, though, look here https://github.com/GnuCash-Pocket/gnucash-android and help if you can.

How many are there now? Original, Mobile, and now Pocket? Maybe it would be better to stick to Firefly III, then. I'll check out Pocket, for now. Thank you for following up with a reply.

OdinVex avatar Feb 01 '23 18:02 OdinVex