mathisdt / trackworktime

Android app to track your work time via WiFi or location and categorize each recorded intervall by a predefined client/task and a free text.
https://zephyrsoft.org/trackworktime
GNU General Public License v3.0
136 stars 30 forks source link

Restoring Data fails #268

Closed pappou99 closed 9 months ago

pappou99 commented 9 months ago

While changing my device I tried to backup and restore my data. The backup runs smoothly, three csv files are produced. Restoring on the other device results that preferences are restored, but no events (sounds similar to #237 ) I checked my backup.events.csv and there is a line (line number 2) which has no timestamp; a task is written there.

Like mentioned in #237 I edited the csv that there are no lines without timestamp - the result is the same: No events are restored. I also deleted the task at the old device, did a backup again (a file with timestamps in all lines is produced) - same result.

Below the two anonymized logfiles (Backupdevice and Restoredevice) are attached.

Log_Backup_device.txt Log_Restore_device.txt

mathisdt commented 9 months ago

Do you put the backup files into exactly the same location as they were on your old device (uppercase/lowercase matters)? There's a problem (which is already fixed but the app update is not published yet for other reasons) when the source directory is not the same - the app firstly imports the settings (including the backup directory) and then the directory is set to the location where it was on the old device and thus the process doesn't find the other two files. You can check if it is the same location by making a backup on both devices and comparing the line starting with keyGrantedDocumentTree of the file backup.preferences.csv. If it's not exactly the same, then this should be the cause.

This bug can be addressed in two ways (until the update is published): First option, use exactly the same location on both devices. Second option, edit the file backup.preferences.csv in a text editor and put the new Android path into the line starting with keyGrantedDocumentTree, after .../tree/ (and replace any / contained in the path by %3A).

If that doesn't help, the last resort is to send me you backup files (via email). Please don't do that right away, but if the above doesn't yield any hint as to what goes wrong, I would like to try the restore in my debugger to analyze what the app does and where it goes south - this is also useful for other users who might trip over this in the future. Of course I would use your data only for the analysis, like I also do with any logs sent to me, and never publish any of it.

pappou99 commented 9 months ago

Because it is a different device with different SD-Card it had a other foldername in it. Manipulating the folderpath helped.

Thank you very much - and waiting for a new release with the fix.

mathisdt commented 9 months ago

Already fixed via e6724cb (but not released yet).