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

[Feature request] Database backup to custom folder #742

Closed
schklom opened this issue Aug 22, 2023 · 14 comments · Fixed by #829
Closed

[Feature request] Database backup to custom folder #742

schklom opened this issue Aug 22, 2023 · 14 comments · Fixed by #829

Comments

@schklom
Copy link

schklom commented Aug 22, 2023

Database backups are a pain to find and backup properly (in /Android/data/com.waist.line/files).
Is it possible to add a button somewhere to pick a folder where we want to save the backup?

@EmilJunker
Copy link
Contributor

On versions prior to Android 13, the backup files are saved to the Documents folder which is very accessible. But on Android 13 and above, the backup files must be saved to a different folder for technical reasons, see #738 and #733.

@grrrrr
Copy link

grrrrr commented Aug 31, 2023

@EmilJunker is that actually the case? WaistLine is the only app I have on Android13 that doesn't let me choose a backup location.

Is there any option around this, as on my device I do not have access to Android/data/com.waist.line/files via a file browser (e.g. Material Files) to do an off phone backup of the export?

@EmilJunker
Copy link
Contributor

@grrrrr I'm able to access the backup location using this file browser app from the Play Store: https://play.google.com/store/apps/details?id=com.marc.files

In the future, maybe we can implement a solution where the exported file can be shared with other apps via Android's native sharing widget (a suggestion from #744). This Cordova plugin looks like it might allow to do just that: https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin

@grrrrr
Copy link

grrrrr commented Aug 31, 2023

Thanks for checking, I am de-googled so can't get that to try but at least those I've tried on f-droid don't have access, no root access error.

But sure I can wait for a share option and hope in the mean time no need to re-install :)

@EmilJunker
Copy link
Contributor

The com.marc.files app is basically just a shortcut that opens the system file browser. I don't think it requires any Google APIs or Play services. You can just download the APK from here: https://www.apkmirror.com/apk/marc-apps-software/files-20/

@grrrrr
Copy link

grrrrr commented Aug 31, 2023

I grabbed it via adb in the end :D

@schklom
Copy link
Author

schklom commented Sep 1, 2023

@EmilJunker Is it possible to backup to a less protected storage location like Android/media/com.waist.line/files instead?
Most apps do not even try to allow access to Android/data/..., but Android/media/... is much easier to access. Backing up a folder there can be done by every backup app I tried (Nextcloud, FolderSync, Tasker) without requiring any tricks.

Alternatively, would it be possible to use the Storage Access Framework to define the backup location? A quick search shows that there are cordova plugins to do that https://github.com/customautosys/cordova-plugin-saf-mediastore

@EmilJunker
Copy link
Contributor

Is it possible to backup to a less protected storage location like Android/media/com.waist.line/files instead?

I just tried that using the trick described in #252 (comment), but it looks like it's no longer working. It worked on older versions of Android but when I try it on an Android 13 device I always get "Export failed".

As I wrote above, I think our best option would be to implement a solution where the exported file can be shared with other apps via Android's native sharing widget.

@davidhealey davidhealey reopened this Sep 9, 2023
@Nitrousoxide
Copy link

I attempted to backup my database as well on android 13 and while the popup said it went to /Android/data/com.waist.line/files/waistline_export.json there was no directory "com.waist.line" under /Android/data/

I assume it has just backed up the file to the container's directory path rather than the android host's path because the host's was not symlinked.

@EmilJunker
Copy link
Contributor

there was no directory "com.waist.line" under /Android/data/

@Nitrousoxide Make sure you are using a file browser that actually lets you access the files under /Android/data/. Not all file browser apps do that. This one works for me:
https://play.google.com/store/apps/details?id=com.marc.files
https://www.apkmirror.com/apk/marc-apps-software/files-20/

@EmilJunker
Copy link
Contributor

There should be hundreds of folders under /Android/Data. One for each app on your phone. If you only see so few folders, then there is something fishy going on. Please try a different file browser.

@Nitrousoxide
Copy link

Using Marc's "Files" app seems to make them visible. Looking into that app it seems like its just an aliased link to the built-in file browser for android so it doesn't suffer the permission issues other ones do in modern android 13. So that's a good install regardless of your situation!

@BenediktBroich
Copy link

+1

@makkus
Copy link

makkus commented Mar 25, 2024

Just chipping in to say that waistline is the only app atm where I can't (automatically) backup data. Most other apps I've setup backups for (via syncthing, foldersync, etc) have the backup data under /Android/media, so with the right permissions its possible for those apps to access the to-be-backed-up data and put it where-ever I think is a good idea. For waistline, that's unfortunately not possible (with Android 14, anyway), so the only way to backup the data would be to copy it manually out of that folder (via the "Files" app mentioned above), or maybe use the Google backup mechanism (which I'd like to avoid because it doesn't give a lot of control where my data is stored).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants