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

Can't restore To-Do List backup from old phone #17

Open
kidhanis opened this issue Jul 2, 2023 · 0 comments
Open

Can't restore To-Do List backup from old phone #17

kidhanis opened this issue Jul 2, 2023 · 0 comments

Comments

@kidhanis
Copy link

kidhanis commented Jul 2, 2023

I’m trying to migrate data from an old phone to a new one using Privacy Friendly Backup. However, I can’t restore data from the backup file generated by the app. I tried wiping the data from both apps in both phones, but restoring still didn't work in either phone.

To-Do List version: 2.4.2
Backup version: 1.3
Old Phone: Zenfone 2 running Marshmallow
New Phone: Samsung Galaxy S10e running Android 11

Observed behavior

I find this error in the logcat when trying to restore the data:
SQLiteLog: (1) no such table: sqlite_sequence

I made a backup in the new phone, which is a fresh app install with just a few new tasks, and restore works fine in this case. I then compared the contents of this backup with the backup of the old phone, and I noticed two main differences in the JSON format:

  1. The order of objects in the content array is different: in the new phone, the todo_list object (the one that starts with \"tableName\":\"todo_list\") is first in the array, while in the old phone it comes last. This array also contains the sqlite_sequence object, so the error shown above might come from here.
  2. The todo_list table is described in the backup file of the old phone like this:
    CREATE TABLE todo_list (\\n\\t_id\\tINTEGER PRIMARY KEY AUTOINCREMENT,\\n\\tname TEXT NOT NULL\\n)
    These control characters don't show up in the backup of the new phone, and this output matches the table format found in privacy-friendly-todo-list/app/src/main/assets/from_1_to_2.sql
    I've used this app since at least 2018, so I believe that the To-Do List app in the old phone used to have the old database version and this script migrated the database to the new version.

Workaround

I found a workaround due to the observations described above: after moving the todo_list object to the first position in the array, restoring works in both phones, so now I can see all the data in the new phone. Any subsequent backup I make can be restored without issues.

Expected behavior

Successfully restore data to new phone without having to modify the backup file.

Steps to reproduce

This can all be done with one phone.

  1. Install version 1.0.1 of To-Do List, which had the old database version
  2. Add lists and tasks in the app
  3. Upgrade To-Do List to version 2.4.2
  4. Go to the Backup app and make a backup of To-Do List. If you inspect the backup and expand "database" -> "content", the fourth and last Object in that array should be the todo_list object.
  5. Wipe data of To-Do List
  6. Restore the backup. To-Do List will still be empty if the backup wasn't restored.
  7. To make the backup work, export it and edit the file to move the todo_list object to the first position in the content array instead of the fourth. Then, import back to the Backup app and try steps 5 and 6 again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant