Xdrip: Regular database backups to Google Drive

Created on 8 May 2017  路  23Comments  路  Source: NightscoutFoundation/xDrip

All 23 comments

I'd like to see this feature as well.

+1

I have my build saving the database when the daily intent runs, which ends up saving every 17 to 24 hours. I then have DropSync auto-syncing that folder to DropBox, which then is auto-synced to my PC.

It would not be much harder to auto sync to Google Drive. The syncing is not done by xDrip+, but I think this is a better solution.

Should I push this code for everyone to use?
I would have to add an option switch first, but that shouldn't take too long.

Also, my saved databases remain unless they are deleted manually. I get around this by moving them to another folder on my PC. Auto Sync takes care of deleting them on the phone.

+1

Also, would like Google Drive instead of DropBox:)

I used DropBox as an example. There are many cloud sync apps available for Android. DriveSync works for Google Drive. FolderSync works for multiple cloud platforms - so this is probably the one I would advise users to install. I don't think adding a cloud syncing option to the app is appropriate, as that would lock users into the chosen cloud service. Adding the option to save databases, and requiring users to then do their own syncing is the best choice, in my opinion.

If this is acceptable, I will proceed to push the code. To proceed with this, I will need a little help myself. I have everything working (except it is not yet optional). When I am ready, I need to understand how to push this change without including other changes I have made to my code.

Kimberlie - you have done this, so maybe you could give me some pointers.

thanks
Jim (TecMunky)

Just let me know when you want some help. I try to sync my code with the master branch (git pull master) before I make any new changes so that my local code is identical to master. Then once I am finished coding and testing, I check my code (or specific files if you do not want to check everything in as in your case) into my branch on GitHub and subsequently request a PR. I can help you with the individual commands when you are ready. Just PM me.

Basically it is just adding your files, committing them, then push. For example,

git add
git commit -m "Description of change"
git push origin

Then request a PR on GitHub for these changes in your branch.

so basically, i could create a branch off of master, clone that branch to my pc, sync all the relevant changes from my build to the cloned branch, sync those changes with my branch on github, then create a pull request from there - would that work?

Oops...

I'll try to implement this today if I can get it working.

I already have mine working - just waiting to see if the Daily Intent saves the database correctly. I have the preference set in settings so the user can decide whether to save databases on Daily Intent.

My method still requires an external folder syncing app to sync to the cloud. FolderSync syncs to many different cloud services - I have it set to save to Amazon Drive, Google Drive, and Dropbox - I am using all three just for testing.

Again, I don't think embedding the cloud for syncing into xDrip is appropriate. The user should be able to decide where to sync, which is why I think the external sync app is required.

Do you think you have a better solution?
Please describe it if you do?

My implementation modifies the following files:
DatabaseUtil.java
DailyIntentService.java
prefs_advanced_settings.xml
strings.xml

Do you want me to send you the changes to test?

I had previously had it working - just added the switch option, which is what I am testing now.

I think it would be better to not depend on third party apps. And everybody who has xDrip installed has an Google account with drive, so there is no need to support other online storage services.

In my opinion, forcing everyone to use a specific cloud service is not appropriate.
Also, I think you are assuming a bit when you say "everybody ... has a google account with drive ... "

However, if you want to see my changes, and possibly integrate google drive saving into that, I could do that.

We seem to have conflicting opinions - who is responsible for resolving this?

Oh, and using my method means support does not need to be built in to xDrip for online cloud services, the third party app method is independent of xDrip.

Pull Request #135 covers the Saving Database portion of this issue, if anyone wants to review the code changes and comments.

@TecMunky I think this is a great idea! Thanks for working on this. I think both of your ideas are great. For many folks, I can see a more automated, built-in approach much more usable and user friendly. Then there are others like us (I use DropSync) that would enjoy more control and options. I'm not sure what UI you've developed for this, but I don't see why there couldn't be two options (e.g. checkboxes) one for the more automated Google Drive approach and yours. I know I would us both!! :)

any updates on this? I see no commits tied to this particular issue.

Which particular issue?
The Daily Intent Database Save feature was implemented quite a while back.
You can install dropsync or foldersync to send the database files to any online storage you want.

EDIT: TecMunky beat me to the update.

After looking up #135 it looks like it was merged in to master on June 27th. This issue just needs to be marked as closed if there's no further action needed.

Has this (regular backup) been implemented?
If yes, how can I set it up? Looking under the 3 dot menu or settings, I cannot find anything. Where exactly is it?

All I need is to have a regular backup so that if I lose my phone, I won't lose the entire history.
Ideally, I will be able to decide the frequency of the backup.

I also want to know... Please, anybody knows if this feature has been implemented?

This feature has been implemented. when enabled, the backup occurs just before the "daily" purge of the database. In this manner, by merging backups, all data is saved. The exact time is indeterminate, because it depends on when the database gets purged.

To enable, left hamburger -> Settings, Less Common Settings, Save Database Daily.

I don't remember, but you may need to enable engineering mode first.

The database is stored locally, in the xDrip folder. (in my local build, it is also stored in a folder structure xDrip/db/yyyy/mm/dd. I don't remember the exact folder structure in the official build, but it is somewhere under xDrip folder.

To save to the cloud, you need to use a cloud sync app. FolderSync is my choice for this.

Was this page helpful?
0 / 5 - 0 ratings