# How to recover deleted notes

**URL:** <https://discourse.joplinapp.org/t/how-to-recover-deleted-notes/17907>\
**Category:** Support\
**Created:** [10 June 2021 01:19 UTC](https://discourse.joplinapp.org/t/how-to-recover-deleted-notes/17907 "2021-06-10T01:19:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ridgeway](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@ridgeway](https://discourse.joplinapp.org/u/ridgeway)\
**Post date:** [10 June 2021 01:19 UTC](https://discourse.joplinapp.org/t/how-to-recover-deleted-notes/17907/1 "2021-06-10T01:19:48Z")

</div>

I recently started using Joplin and decided to trust it with some important notes. Then I accidentally deleted one. How can I recover it?

I have Note History enabled with history kept for 30 days (and I don't have syncing). The [Note History](https://joplinapp.org/note_history/) page only says how to recover old versions of existing notes.

Is there a way to recover notes that were deleted?

If there's no easy way, I noticed the database has a deleted\_items table, so could it could be done with a query?

This is Joplin Desktop 1.0.241 (prod, darwin).

---

<div class="post-metadata">

**Author:** ![laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@laurent](https://discourse.joplinapp.org/u/laurent)\
**Post date:** [10 June 2021 09:04 UTC](https://discourse.joplinapp.org/t/how-to-recover-deleted-notes/17907/2 "2021-06-10T09:04:30Z")

</div>

Do you have a backup of your local files? Or of the files on the sync target? If so, you can recover from this. Otherwise the note might still be in the revision table but it's not currently possible to recover it from there.

---

<div class="post-metadata">

**Author:** ![laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@laurent](https://discourse.joplinapp.org/u/laurent)\
**Post date:** [10 June 2021 09:48 UTC](https://discourse.joplinapp.org/t/how-to-recover-deleted-notes/17907/3 "2021-06-10T09:48:54Z")

</div>

If the note is particularly important, you should be able to restore it from the next version using the command palette. You'd type Ctrl+Shift+P, then "restoreNoteRevision NOTE\_ID".

---

<div class="post-metadata">

**Author:** ![rlee](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@rlee](https://discourse.joplinapp.org/u/rlee)\
**Post date:** [10 June 2021 12:09 UTC](https://discourse.joplinapp.org/t/how-to-recover-deleted-notes/17907/4 "2021-06-10T12:09:02Z")

</div>

I use Dropbox, and I've been able to recover deleted notes using Dropbox's undelete feature. Once I have them back, no problems.

---

<div class="post-metadata">

**Author:** ![ridgeway](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@ridgeway](https://discourse.joplinapp.org/u/ridgeway)\
**Post date:** [10 June 2021 14:47 UTC](https://discourse.joplinapp.org/t/how-to-recover-deleted-notes/17907/5 "2021-06-10T14:47:21Z")

</div>

Thanks @laurent. I made a copy of ~/.config/joplin-desktop soon after deleting the note, just in case. I don't have a sync target since I've never used syncing.

I realized I was using an old version of Joplin that didn't have the command palette, so I upgraded to 1.8.5. In that version, Command+Shift+P works but "restoreNoteRevision" doesn't appear as one of the commands. I also don't know how to find the note ID, since the note is deleted.

---

<div class="post-metadata">

**Author:** ![laurent](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@laurent](https://discourse.joplinapp.org/u/laurent)\
**Post date:** [10 June 2021 15:25 UTC](https://discourse.joplinapp.org/t/how-to-recover-deleted-notes/17907/6 "2021-06-10T15:25:31Z")

</div>

You will need the next version 2.0.x, which is not released yet. For the note ID, there's no easy way to find it so you'll have to get it for example from the "item\_id" field of the "revisions" table. You could look at the revisions and find which ones seem to be related to your note.

---

<div class="post-metadata">

**Author:** ![ridgeway](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@ridgeway](https://discourse.joplinapp.org/u/ridgeway)\
**Post date:** [11 June 2021 02:09 UTC](https://discourse.joplinapp.org/t/how-to-recover-deleted-notes/17907/7 "2021-06-11T02:09:46Z")

</div>

Thanks @laurent!

For anyone else who wants to do this, the steps are:

1. Make a backup of your Joplin data: ~/.config/joplin-desktop.

2. In a terminal,  
`sqlite3 ~/.config/joplin-desktop/database.sqlite`

3. In sqlite3,  
`select item_id, body_diff from revisions order by created_time;`

4. Look at the results to find what you want to restore. Copy the item\_id.

5. Download Joplin 2.0.8 from [Release v2.0.8 · laurent22/joplin · GitHub](https://github.com/laurent22/joplin/releases/tag/v2.0.8) (I first tried 2.0.4 and it didn't work).

6. Open Joplin 2.0.8. This upgrades your Joplin database so the old version can't use it anymore. That's why you need a backup.

7. Ctrl+Shift+P (or Command+Shift+P), then "restoreNoteRevision NOTE\_ID".

8. Save your restored note somewhere outside Joplin.

9. Replace ~/.config/joplin-desktop with your backup.

10. Open the old Joplin and import your saved note.

Once version 2 is released, you can skip 5-6 and 8-10.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/1/c/1c948e33314e232a0927789508474d8624f4270b.png) [@system](https://discourse.joplinapp.org/u/system)\
**Post date:** [11 July 2021 02:10 UTC](https://discourse.joplinapp.org/t/how-to-recover-deleted-notes/17907/8 "2021-07-11T02:10:20Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
