iSoron / uhabits

Loop Habit Tracker, a mobile app for creating and maintaining long-term positive habits
GNU General Public License v3.0
7.95k stars 939 forks source link

Cannot import .db backup #1706

Closed officer-k22 closed 1 year ago

officer-k22 commented 1 year ago

I also have import problems, which might be due to different reasons than SimonDedman's.

Pre-submission checklist

I am submitting a bug report, not a feature request. I have searched for similar issues, but did not find any matches.

Description

Settings
Import Data
File Browser opens
I click my backup file (.db)
the app vanishes/closes/minimizes itself
sometimes it says "App terminated repeatedly"

I have created the backup file via "export complete backup" before installing a new LineageOS version after a factory reset. I have translated the messages and setting names from German, so excuse me if they are actually different in the english original.

System information

Phone: Fairphone 3+ Phone Operating System: Android 13, LineageOS 20-20230501-NIGHTLY-FP3 App version: 2.1.1 from F-Droid

iSoron commented 1 year ago

Thanks for the report, @officer-k22. After you attempt to import the backup and the app crashes, could you reopen the app and send a bug report from within the app (Settings / Generate bug report)? Perhaps we can see more details from that log. If you don't mind sharing your backup file with me, that would also be helpful. You can send it to: dev@loophabits.org

programmerHaaks commented 1 year ago

I've had the same problem. I exported from one phone, saved it to the filesystem on another, then tried to import it and it crashed. After reading the documentation and seeing you using Google Drive as an example, I thought I'd give that a try instead and it worked. This is on a Samsung with stock ROM.

So, for a workaround, try importing from Google Drive.

I'll see if I can reproduce it later and send in a bug report.

iSoron commented 1 year ago

@programmerHaaks Thanks, that would be helpful.

officer-k22 commented 1 year ago

Importing via Google Drive worked. After that, importing from the file browser also did not result in a crash. I don't know whether that is because of a system update, app update or the previous Google Drive import. Thanks @programmerHaaks !

lkraav commented 8 months ago

I just now had a situation where exporting a 2.1.3 db wouldn't import into 2.2.1: "Failed to import backup." toast with no other details.

Downgrading new phone app to 2.1.3, import, then upgrade back to 2.2.1, everything works.

Seems like some data structure regression in the latest release?