# Force encryption of old notes?

**URL:** <https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550>\
**Category:** Support\
**Created:** [10 October 2020 20:06 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550 "2020-10-10T20:06:16Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![rqk](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rqk](https://discourse.joplinapp.org/u/rqk)\
**Post date:** [10 October 2020 20:06 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/1 "2020-10-10T20:06:16Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![markrenier](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/markrenier/32/3138_2.png) [@markrenier](https://discourse.joplinapp.org/u/markrenier)\
**Post date:** [11 October 2020 07:01 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/2 "2020-10-11T07:01:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rqk](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rqk](https://discourse.joplinapp.org/u/rqk)\
**Post date:** [12 October 2020 13:45 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/3 "2020-10-12T13:45:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rqk](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rqk](https://discourse.joplinapp.org/u/rqk)\
**Post date:** [14 October 2020 21:04 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/4 "2020-10-14T21:04:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rqk](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rqk](https://discourse.joplinapp.org/u/rqk)\
**Post date:** [1 January 2021 15:11 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/5 "2021-01-01T15:11:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ajay](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/ajay/32/6551_2.png) [@ajay](https://discourse.joplinapp.org/u/ajay)\
**Post date:** [1 January 2021 16:21 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/6 "2021-01-01T16:21:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rqk](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rqk](https://discourse.joplinapp.org/u/rqk)\
**Post date:** [1 January 2021 17:52 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/7 "2021-01-01T17:52:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ajay](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/ajay/32/6551_2.png) [@ajay](https://discourse.joplinapp.org/u/ajay)\
**Post date:** [1 January 2021 18:27 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/8 "2021-01-01T18:27:06Z")

</div>

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 ...

---

<div class="post-metadata">

**Author:** ![rqk](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rqk](https://discourse.joplinapp.org/u/rqk)\
**Post date:** [1 January 2021 18:51 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/9 "2021-01-01T18:51:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rqk](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rqk](https://discourse.joplinapp.org/u/rqk)\
**Post date:** [1 January 2021 18:52 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/10 "2021-01-01T18:52:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ajay](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/ajay/32/6551_2.png) [@ajay](https://discourse.joplinapp.org/u/ajay)\
**Post date:** [1 January 2021 21:15 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/11 "2021-01-01T21:15:56Z")

</div>

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 ...

---

<div class="post-metadata">

**Author:** ![rqk](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rqk](https://discourse.joplinapp.org/u/rqk)\
**Post date:** [1 January 2021 21:54 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/12 "2021-01-01T21:54:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ajay](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/ajay/32/6551_2.png) [@ajay](https://discourse.joplinapp.org/u/ajay)\
**Post date:** [2 January 2021 08:46 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/13 "2021-01-02T08:46:01Z")

</div>

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 😉

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.

---

<div class="post-metadata">

**Author:** ![rqk](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rqk](https://discourse.joplinapp.org/u/rqk)\
**Post date:** [2 January 2021 17:22 UTC](https://discourse.joplinapp.org/t/force-encryption-of-old-notes/11550/14 "2021-01-02T17:22:20Z")

</div>

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.
