Batch Restoring Notes from History

Hi there,

first of all: I LOVE Joplin.
I use it for quite some time and regularly install the latest version. It is great to see this fantastic tool making so much good progress.
Thanks for the AWESOME work, Laurent!!!

Unfortunately, yesterday, a major problem has occurred. I try explaing how it went down:

The first thing to break down was my Nextcloud updating process. I have lot many things during a faulty update apparently caused by a video player app that barred me from reentering my Nextcloud instance after trying to migrate to the current version.

As I sync Joplin with Nextcloud, this also affected my note syncing.

Now I did this:
I renamed my Nextcloud folder and reinstalled Nextcloud from scratch.

I then copied over the Joplin sync folder and hit the sync button inside Joplin (latest version)
After a while I returned to the computer, I saw that all the notes had been deleted.

I wonder how and why this happened. All my sync data was in the folder I had just copied to the new Nextcloud instance, the link was the same as were the credentials.
The sync was also up to date as I did not alter anything in my windows install of Joplin.

I tried undeleting MD files from the drive but then realized that it all is probably in the sqlite file and this has not been deleted but rather changed … so I lost most of my hope here yesterday.

Today I had a peek inside the existing sqlite file and saw that there are actually all the notes still in there. Maybe this is because I adjusted the history for notes inside Joplin to 365 days.

So: Is there a way to restore all these notes without going into the sqlite database and copy/pasting every bit by hand? We are talking of well over 3000 notes …

Thanks a LOT for your help.

For the note deletion I guess that’s the issue you had? https://joplinapp.org/faq/#all-my-notes-got-deleted-after-changing-the-webdav-url

To restore the notes, do you have any backup, because that would be the easiest way at this point. There’s a plan to implement a recycle bin that will allow restoring the notes from history but currently it is not implemented.

Also, when you say all the notes are still in the database, you mean in the “notes” table? If that’s where they are they should also show up in the app, but I guess you mean in the “revisions” table.

Hi Laurent,

thanks for your swift answer. I moved over the Joplin folder from the old to the new Nextcloud instance, so I assumed the sync would go fine from there. So: no, not exactly the problem you linked to.

As for the database: I am not sure on which table the content sits inside the sqlite database. ALl I did was open it with a texteditor and I saw that there are many, many notes in there that are not present in the joplin application.

Does it make sense that I upload the sqlite file for you so you can have a look at it yourself?

Hi again, Laurent,

yes, you are right. Meanwhile, I have opened the database with this program
https://sqlitebrowser.org/

I did not edit anything but could see that in “revisions” there are almost 3000 entries.

Is there any sensible way to put them back where they came from?

as he said,

To restore the notes, do you have any backup, because that would be the easiest way at this point. There’s a plan to implement a recycle bin that will allow restoring the notes from history but currently it is not implemented

it’s not yet implemented.
you will be able to recover them maybe a little bit later with a furture version

1 Like

Yes, thanks. I have understood that.

I am asking since the data is there. Can it be copied from the revisions table to the one where it is sitting normally?

I cannot believe there is no way to get back the data.

no.

But where exactly is the data sitting? I checked revisions but there is no “body” field.

Still, as I said: The content is there, as I can see it in the text editor.

As an alternative, I still have what was synced to the NExtcloud instance. I downloaded the folders content but there seems to be no sqlite file, only a LOT of *.md files.
I tried importing them into Joplin application (markdown folder) but without success.

If you still have the content of the sync folder somewhere, you can restore from that: clear the local data on the desktop app, then set it up to sync with that folder on Nextcloud.