davidhealey / waistline

Libre calorie counter app for Android. Built with Cordova.
568 stars 67 forks source link

data import and export functions not working #219

Closed JackElsey closed 4 years ago

JackElsey commented 4 years ago

I'm having trouble migrating my data to a new Google Pixel 4a running Android 11.

I understand that the file waistline_export.json needs to be in the directory Android/data/com.waist.line/files in order for Waistline to find it. This directory does not exist on my phone after installing Waistline, although the app did create an empty directory Android/media/com.waist.line. Placing the file in Android/media/com.waist.line does not result in a successful import.

Attempting to create the data/com.waist.line directory manually with the stock Files app results in a message:

This name is already being used. Try a different name.

Entering some data into the app and then going to Settings > Export Data results in an alert saying "Database Export Complete" but neither the file waistline_export.json or the directory it's supposed to exist in are created. However, if I delete entries from my diary and then go to Settings > Import Data the deleted entries are restored.

davidhealey commented 4 years ago

This might be a change with newer versions of Android. Did you try creating Android/media/com.waist.line/files?

JackElsey commented 4 years ago

Sorry, I edited my prior post with more information.

davidhealey commented 4 years ago

So it must be creating the file somewhere for the import to work. Try doing a system search for waistline_export.json to find the location.

JackElsey commented 4 years ago

I agree that the new export file must have been created somewhere, but searching for waistline_export.json in both the stock Files app and the filebrowser app Solid Explorer only return the file that I was originally trying to import into waistline. I've configured both apps to show hidden files.

davidhealey commented 4 years ago

And is it importing the file you were originally trying to import?

JackElsey commented 4 years ago

No, sorry if I was unclear. It's importing the file with dummy diary entries.

davidhealey commented 4 years ago

Plug your phone into a computer. Make a backup of the export data that you have and want to keep. Remove that file completely from your phone. Use the computer's search tool to look for any other export.json files on the phone.

JackElsey commented 4 years ago

Plugging my phone into my computer and opening the directory Android/data with Ubuntu's Nautilus file browser reveals dozens of directories that weren't displayed on the phone, including com.waist.line/files. Replacing the file waistline_export.json in that directory with the file that contains the data I want to migrate resulted in a successful data import. Thanks for helping me figure this out. Please enjoy a pint or two on me.

davidhealey commented 4 years ago

Please enjoy a pint or two on me.

Thanks! In the next version of Waistline I intend to create a more user friendly import/export feature with a proper file browser so you can put the data file wherever is convenient.