federicoiosue / Omni-Notes

Open source note-taking application for Android
https://omninotes.app
GNU General Public License v3.0
2.69k stars 1.11k forks source link

Backed up database is empty #678

Closed eduardosm closed 5 years ago

eduardosm commented 5 years ago

Describe the bug The sqlite database from backups is empty.

Context

How to reproduce Steps to reproduce the behavior:

  1. Fresh Omni-Notes install
  2. Create one or more notes
  3. Make a backup
  4. Copy the backup to a PC
  5. Open the sqlite database (e.g., with sqlitebrowser)
  6. The database is empty

Expected behavior There should be a table with the notes.

federicoiosue commented 5 years ago

It's a known problem with Android Pie. It's addresses in Beta builds by exporting notes as JSON

ArmitageShanks commented 5 years ago

I just lost all my data by doing a backup and restoring it on Pie.

Can I only restore this backup on pre Pie ROM now?

federicoiosue commented 5 years ago

I just lost all my data by doing a backup and restoring it on Pie.

Can I only restore this backup on pre Pie ROM now?

As stated above you must be on Beta channel to be able to use backups on Pie

ArmitageShanks commented 5 years ago

Oh I got that. But I wondered if it's possible to restore the backup I already done on Pie or do I have to get an older ROM, I need the data in the old backup.

From what I understood about the json issue, old backups won't work on Pie?

And how do I get on the beta channel?

And thanks for a great app!

federicoiosue commented 5 years ago

Oh I got that. But I wondered if it's possible to restore the backup I already done on Pie or do I have to get an older ROM, I need the data in the old backup.

From what I understood about the json issue, old backups won't work on Pie?

And how do I get on the beta channel?

And thanks for a great app!

Android Pie made some big changes on app's database management. The previously used data backup was quite elementary: it just used to copy database and restore it from/to different folders. When the app was restarted (directly by the restore process) everything worked like a charm.

Now, due to this new database management (based on WAL) doesn't allow that anymore.

If you're available for a test I could try a workaround without requiring to move to beta version.

ArmitageShanks commented 5 years ago

If you're available for a test I could try a workaround without requiring to move to beta version.

Sure thing. Let me know what to do.

federicoiosue commented 5 years ago

If you're available for a test I could try a workaround without requiring to move to beta version.

Sure thing. Let me know what to do.

Could you please try this version? Is just an update to the latest version released on Play Store so it's safe to update because app's signature is checked.

I made a couple of attempts and it seems to work to backup/restore data on Android Pie. The problem is: I'm not that much sure if your backup is good (I'm afraid not). But you should at least be able to use some previously made backups before Android Pie, if you have any.

ArmitageShanks commented 5 years ago

It works!

federicoiosue commented 5 years ago

Great, you rock! I'll publish on Play Store then! Thanks for your feedback