Restore from backup clears notes and notebooks

Bug report

I’m testing out Inkdrop to replace Evernote as my main note taking app.

For my testing, I’m trying out the backup and restore feature. The backup was successful as I can see the json files created in the directory where I requested the backup to be made to. However, I’m unable to restore from the backup.

I don’t get any errors when attempting to restore and it appears to go as expected. However, the notebooks and notes are cleared out and nothing is restored. Not sure what to do next.

Info

  • Platform: Linux Arch

  • Platform version: Kernel 4.19.41-1-lts

  • App Version: 3.25.4

  • Platform: iOS

  • Platform version: 12.2

  • App Version: 2.4.3

Reproduce

  1. Create the backup to $HOME/tmp from the settings dialog
  2. See that there are multiple files created in the specified directory, one directory called data shows up and contains the notes I’ve created. Other directories for the notebooks are created, but they contain no data.
  3. Attempt to restore the backup via the settings dialog
  4. All data on Inkdrop is cleared, even synced to the server
  5. No data is restored
  6. Check on iOS app and the app crashes to a blank screen as there is no data on the account
  7. Reloading the app on Arch Linux returns to the First Notebook as if this is the first time opening the program
  8. On iOS at this point the app loads normally
  9. Attempting to reload from backup, either by selecting the $HOME/tmp or $HOME/tmp/data directories, causes for First Notebook to be cleared and iOS app crashes shortly thereafter.

Hi Nicole,

Thank you for the report.
That’s weird.
I would like to know if you manually deleted notes and notebooks before restoring the backup.
If so, you don’t get any data restored as the app also records deletion history.
Could you check if _deleted folder contains files?

That’s interesting. There are some files in the _deleted directory, also did another test and found that the backup directory is also updated.

The first backup resulted in these directories

$ ls $HOME/tmp/data
book:first.json  config.json  note:8yQKFZrtU.json  note:AqS5Rqt0j.json  note:example.json  note:onM9EKidq.json  note:welcome.json  note:Znq7LCA-o.json  tag:tutorial.json

$ ls $HOME/tmp/_deleted
book:1sGB9Vnrr.json  book:hMDLuhOtB.json  config.json          note:example.json    note:g1yuxheaW.json  note:QwL1t41eS.json  note:welcome.json
book:first.json      book:T7uiOGg8B.json  file:KAqlf2yyY.json  note:Fc3p3ewfD.json  note:IA09DCg1O.json  note:TWEBwnS48.json  tag:tutorial.json

I also proceeded to run another test where I deleted only two notes and left the rest as is, the new directories look like this

$ ls $HOME/tmp/idbackup/data
book:first.json  config.json  note:8yQKFZrtU.json  note:AqS5Rqt0j.json  note:onM9EKidq.json  note:Znq7LCA-o.json  tag:tutorial.json

$ ls $HOME/tmp/idbackup/_deleted
note:example.json  note:welcome.json

Then I proceeded to remove the inkdrop directory under the .config directory, logged back in, cleared the data I had and ran the restore from the second backup I generated. The notes were restored successfully.

I believe the situation appears to be that the backup is done at intervals or under certain situations and not just when I tell it to backup manually. This time the restore did in fact work by restoring everything.

So it boils down to my misunderstanding of the backup feature, guess I read the documentation too fast and missed the part where it says that it’s continuously and removed everything without removing the configuration for the backup.

Thanks for clarifying that part. Now this raises the question, though I know I have to be more careful in the future, whether I can easily restore the files from the _deleted directory.

Good to hear that.
Yes, it always syncs with backup folder while running the app.
You can just move files from _deleted directory to data directory if you would like to restore them.
The purpose of _deleted directory is to protect you from losing data accidentally.