Force encryption of old notes?

I encrypted my data without error on the desktop and then synced on the phone but old notes are not encrypted. I sync to Dropbox. Besides looking on my computer, I also went to the Dropbox web interfaced and verified old not encrypted files there. Then I tried re-encrypting and that didn't fix the issue although the procedure finished without errors. Then I decrypted and re-encrypted and that didn't fix the problem either.

I have used the searched, and haven't found the answer. Maybe I don't know what to look for.

There are no errors on the desktop or the phone. I would be glad to provide any other needed information to solve this.

Fortunately, through all of this, all of my data (encrypted or not) is always readable on the desktop and the phone.

I an running: Joplin 1.2.6 (prod, linux)

I have similar issues.
I am also using Joplin 1.2.6 on an Android Phone and under windows. The android phone app was upgraded first and ran overnight re-encrypting my files. This morning I updated to 1.2.6 on Windows and allowed the it to synchronize all the files. Both processes completed without error. Both apps have an orange banner "Press to set the decryption password". However on the Android, some folders are labelled "encrypted" and the folder "Conflicts" has shown up, it contains about 100 notes. On Windows, I see no conflict entries; normal folders containing tasks exist on Windows that otherwise show as encrypted on the Android device.

I found that if I edit an unencrypted old note and save it, it remains unencrypted. If I use the duplicate feature and delete the original unencrypted note, the duplicate is encrypted.

I wonder if some version of exporting all notes (with encryption on or off?) and importing (with encryption on) would force the encryption.

I am still looking for a workaround. To clarify, in my above post I said "If I use the duplicate feature and delete the original unencrypted note, the duplicate is encrypted." what I meant was that you have to delete the md file manually.

I found that if I

  • go to the sync directory and delete the md file (that is not encrypted,) then

  • do a sync in Joplin,

my data that was in the md file is now encrypted and visible (unencrypted) in Joplin.

I think that the sync sees the data in the database, doesn't see a corresponding md file and makes an encrypted version in a new md file.

Let me know if there is anything wrong with this methoed as I'd like to use it to get my non-encrypted data encrypted.

could you explain what exactly you mean by "old notes" ? is this notes which you created before you started using encryption (EE2E) ?

Yes. By old notes I mean the ones created before I started using encryption.

When I turned on encryption, only some of my "old notes" were encrypted and some were not. Any new note created after would be encrypted but those old unencrypted ones stayed unencrypted even if I edited them.

could you add a little statistic of what we are looking at ;
number of notes total and "old", text or other, attachments etc.
Just to get a feeling for the size of the problem ...

I am on Linux and used grep to check for "encryption_applied" within the md files. This gives me the following.

474 md files not encrypted (encryption_applied: 0)
785 md files encrypted (encryption_applied: 1)
1259 total md files

I am not sure about attached files. I only have md files in the directory and info.json. I have a directory called locks and one called temp. This is all on Dropbox.

Forgot to add. My notes are very simple. Just text with an occasional copy/paste of a picture.

My best shot would be:

  • export all notes (JEX), the exported notes will all be "not encrypted",
  • clear all notes in Joplin, all devices, and
  • on the sync target (manually),
  • re-import all your notes from the JEX files to your desktop
  • start "re-encryption" in Preferences, once more (but ignore step 1 provided in the dialog box).

The way I read your first post, your sequence was different.
Let me know ...

1 Like

That sounds more complicated and risky than my idea of just deleting the non-encrypted md files and letting them be regenerated encrypted. I've tried just that on a few individual files with no data loss and while getting the desired results (having that data encrypted.) Do you see anything wrong or risky with my approach over what you suggested?

When I saw the numbers ... I thought manual delete is a challenge. But why don't you try your approach first, and if it fails you try mine :wink:

But before yo get get to scared about my approach consider this: the first 4 steps take under 4 minutes, the last step is all automatic. And it "adjusts" any masterkey problems.

I tried the manual deletion. It was easy as I just wrote a script to move those unencrypted md files to a holding directory and then I went into Joplin and did a sync.

This was interesting. I had 786 encrypted md files and 474 not encrypted md files. When the sync was over, I only had a total of 786 md files (all encrypted.) In reviewing the unencrypted files I had moved, I found they look like either 1. notes I had deleted a while ago inside Joplin or 2. notes that were already in Joplin (encrypted) so they were just extra files.

When I did the sync on the Linux desktop, it fetched 402 items. I immediately did a second and it fetched 75 items. When I did a sync on the phone, it fetched 477 items.

Everything looks good. I am not sure why those unencrypted md files were hanging around. I hope this information can be of some use.

Thanks for your help and support.

1 Like