Android: Backup to google drive

Created on 8 Jun 2020  ·  10Comments  ·  Source: home-assistant/android

Is your feature request related to a problem? Please describe.
There are a few settings under App Configuration that would be nice to restore. Along with anything new that gets added as a device setting it would good to allow users to back that up.

Describe the solution you'd like
Back up to google drive would be quick and simple since devices should have play services so they can perform the action.

Describe alternatives you've considered, if any
There are not any backup solutions at the moment for this app.

Additional context
This idea came up from this comment https://github.com/home-assistant/android/pull/610#issuecomment-640725891 and for what the PR wants to achieve this will be really helpful. Even for future additions it can be useful.

enhancement settings

All 10 comments

I've just had a quick look and actually this is already default in the app...

https://github.com/home-assistant/android/blob/master/app/src/main/AndroidManifest.xml#L27

So assuming this isn't overwritten elsewhere (which I doubt it is), then if my PR for the message stream is approved and merged, the database with the messages would be backed up by default :grin:

Is it working as intended? When I go to google drive > Backups and then App Data I do not see Home Assistant listed here but I do see other apps. So maybe we haven't tagged things to be saved?

It should save everything that can be saved automatically if you don't provide a specific list (which they haven't). I'd have to look through the rest of the code to work out whether that flag is being overwritten somewhere, and if not whether anything the app currently saves should be being backed up (although I would have expected the settings to be if nothing else).

If nobody else replies with clarity I'll go through it myself at some point :+1:

Snapchat-1887813005

Is that similar to what you have in your backup folder on your drive? If so that's probably correct. WhatsApp uses a different method to backup your conversation history to your drive account, and I have several apps that restore correctly from backups that aren't listed. I just don't think you can see things there that are automatically backed up using that flag.

yea I was referring to selecting the Pixel backup then going to App Data and the app was missing there. I was expecting to see HA listed there. Personally I don't know what if anything gets restored if we cleared data. Last time I cleared data I had to go back and add the device name and enter the HA URL etc...

Yeah, clearing data will clear it from the device and then you have a blank slate, I think that's standard because you've told it you don't want that data, but if you lose/break/upgrade your phone then when you reinstall the app it should pick up from where it left off.

Maybe for belt and braces we could add an option to export/import the messages database, but I'd need to have a head scratch over the pros and cons of doing that :man_shrugging:

@dshokouhi - mine does have Homeassistant in the app list...

Screenshot_20200608-195656

I'm on my phone so I don't know if there would be any way to actually see what's in that file from a computer.

Oh hmm maybe mine isnt since I am on the firebase builds and not the actual beta channel 🤔

Maybe for belt and braces we could add an option to export/import the messages database, but I'd need to have a head scratch over the pros and cons of doing that 🤷‍♂️

I was actually waiting for things to get merged before I was going ot submit a feature request :)

Not sure, but it's something I can definitely look in to going forward. And yeah, I can happily add import/export database to my list of things to do - just might take a while is all (reasons detailed in my pr) :slightly_smiling_face:

Ok so since we already have the backup taking place I will close this. And don't worry about things taking long on your end, myself and others are just happy to see your contributions coming in :)

Thank you for taking the time to discuss :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tiagofreire-pt picture tiagofreire-pt  ·  3Comments

N-Schaef picture N-Schaef  ·  5Comments

Hypfer picture Hypfer  ·  3Comments

CedrickFlocon picture CedrickFlocon  ·  4Comments

andriej picture andriej  ·  4Comments