# Attachments lost after reorganizing notes

**URL:** <https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282>\
**Category:** Support\
**Created:** [20 April 2022 14:00 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282 "2022-04-20T14:00:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![guckuck](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guckuck/32/6234_2.png) [@guckuck](https://discourse.joplinapp.org/u/guckuck)\
**Post date:** [20 April 2022 14:00 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/1 "2022-04-20T14:00:51Z")

</div>

Hi,

I think, I lost many attachments.

I use nextcloud for syncing.

Before switching to Joplin I used Evernote. I normally scan documents to pdf and these pdfs where added to Evernote, one scan one note.

With Joplin I have to do this manually. So, I dicided to summerize some note to one.

Before

- note A with attachment A
- note B with attachment B
- note C with attachment C

Now

- Note with attachment A, B, C  
I copied (sometimes I maybe used cut and paste) the whole link from the notes B und C to the summary-note A. After copying I deleted the old note B and C.

Now, the attachments from B and C are gone. I get the little J-Icon and can not open the attachments. Attachment A is still there.

This is a big problem. I lost so many important documents. I am desperate. I have backups but I use Joplin since more than two years. I can not recover every attachment.

I hope, there is another way.

Best regards  
Kay

---

<div class="post-metadata">

**Author:** ![guckuck](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guckuck/32/6234_2.png) [@guckuck](https://discourse.joplinapp.org/u/guckuck)\
**Post date:** [20 April 2022 14:22 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/2 "2022-04-20T14:22:55Z")

</div>

Question for recovery: Is there a way to search for notes with orphaned attachments?

---

<div class="post-metadata">

**Author:** ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)\
**Post date:** [20 April 2022 14:23 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/3 "2022-04-20T14:23:17Z")

</div>

Check if they are in your resource folder or not. The attachment markdown should look like `[AttachmentName](:/0c993a43c13346fdba587bf5ca507017)` and that id should correspond to a file in your resources directory (i.e. .config/joplin-desktop/resources) (click help \> open profile directory if you don't know where it is)

---

<div class="post-metadata">

**Author:** ![guckuck](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guckuck/32/6234_2.png) [@guckuck](https://discourse.joplinapp.org/u/guckuck)\
**Post date:** [20 April 2022 14:24 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/4 "2022-04-20T14:24:38Z")

</div>

The attachments are gone. I just open joplin on another device. It starts to delete more than 100 resources that are still in use. I found the ressources in old time machine backups.

---

<div class="post-metadata">

**Author:** ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)\
**Post date:** [20 April 2022 14:25 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/5 "2022-04-20T14:25:50Z")

</div>

Not natively but there are tools such a @rxliuli's [batch-web tool](https://joplin-utils.rxliuli.com/joplin-batch-web/#start) which has options to check for orphaned resources and orphaned links

---

<div class="post-metadata">

**Author:** ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)\
**Post date:** [20 April 2022 14:27 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/6 "2022-04-20T14:27:13Z")

</div>

Then I assume they are missing from your sync target for some reason and Joplin is reflecting the deletion of them. I assume your latest backup would have all your old resources stored?

---

<div class="post-metadata">

**Author:** ![guckuck](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guckuck/32/6234_2.png) [@guckuck](https://discourse.joplinapp.org/u/guckuck)\
**Post date:** [20 April 2022 14:30 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/7 "2022-04-20T14:30:14Z")

</div>

I think, this is a serious bug. Joplin thinks the ressources aren't in use after I copied them to the new note and remove the old note. I do this since a few months. So I have to search through many backups. This is a nightmare.

---

<div class="post-metadata">

**Author:** ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)\
**Post date:** [20 April 2022 14:36 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/8 "2022-04-20T14:36:39Z")

</div>

Before we go that far could you explain exactly what you did?  
Did you just copy the markdown tag with resource id (like I posted before) between notes? Or something else?

---

<div class="post-metadata">

**Author:** ![guckuck](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guckuck/32/6234_2.png) [@guckuck](https://discourse.joplinapp.org/u/guckuck)\
**Post date:** [20 April 2022 14:41 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/9 "2022-04-20T14:41:25Z")

</div>

I copy the whole markdown-link: ...

Another example:  
Before  
Note Invoice Jan with attachment jan  
Note Invoice Feb with attachment feb  
Note Invoice Mar with attachment mar  
... and so on

Copy all links from feb - dec to note Jan and rename "note Jan" to "note year"  
Remove notes feb - dec.

Now, all attachments from feb - dec are gone, attachment from jan is still there.

---

<div class="post-metadata">

**Author:** ![guckuck](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guckuck/32/6234_2.png) [@guckuck](https://discourse.joplinapp.org/u/guckuck)\
**Post date:** [20 April 2022 14:42 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/10 "2022-04-20T14:42:29Z")

</div>

The batch script don't help me. It shows no note with orphaned resources.

---

<div class="post-metadata">

**Author:** ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)\
**Post date:** [20 April 2022 14:43 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/11 "2022-04-20T14:43:23Z")

</div>

Make sure you put any markdown in a code fence, Discourse also uses markdown.

---

<div class="post-metadata">

**Author:** ![guckuck](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guckuck/32/6234_2.png) [@guckuck](https://discourse.joplinapp.org/u/guckuck)\
**Post date:** [20 April 2022 14:46 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/12 "2022-04-20T14:46:24Z")

</div>

I'm sorry. One example. I copy the whole markdown-link:  
`[invoice_jan.pdf](:/9b980800659c4da5b60b1a40219a46dd)`

---

<div class="post-metadata">

**Author:** ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)\
**Post date:** [20 April 2022 14:52 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/13 "2022-04-20T14:52:43Z")

</div>

I'll have a go at replicating it so just to be clear its something like:

Note 1:  
`[attachment_jan](:/abc...)`

Note 2:  
`[attachment_feb](:/def...)`

You then rename `Note1` to `Summary` and copy `Note2`'s attachment data into `Summary` so it now looks like:

Summary:  
`[attachment_jan](:/abc...)`  
`[attachment_feb](:/def...)`

Then you delete `Note2` and the resources no longer show up and are being deleted?

Also, just for information, what is your note history config set as?

Also what Joplin version and OS?

---

<div class="post-metadata">

**Author:** ![guckuck](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guckuck/32/6234_2.png) [@guckuck](https://discourse.joplinapp.org/u/guckuck)\
**Post date:** [20 April 2022 14:59 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/14 "2022-04-20T14:59:44Z")

</div>

Yes, that is nearly correct: I don't delete Note1 because this note is renamed to "Summary".

Here the history config:  
Mac 1: 365  
Mac 2: 90  
Android 1: 372  
iPad: 90  
PC 1: I think 90  
Portable: I think 90

I always use the latest version.  
**On Mac 1:** Joplin 2.7.15 (prod, darwin)

Client-ID: 3e3ae07d1fbf4621b9bdb4a1f90d201e  
Sync-Version: 3  
Profil-Version: 41  
Unterstützter Schlüsselbund: Ja

Revision: 8352e23

**Android 1:** Joplin 2.7.2  
**iPad 1** : Joplin 12.7.2

---

<div class="post-metadata">

**Author:** ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)\
**Post date:** [20 April 2022 15:02 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/15 "2022-04-20T15:02:32Z")

</div>

> [@guckuck](#):
>
> Yes, that is nearly correct: I don't delete Note1 because this note is renamed to "Summary".

Yeah I forgot to change the last bit.

If you don't have any clients with note history off then I wouldn't expect to see your resources being deleted until that limit has been reached.

---

<div class="post-metadata">

**Author:** ![guckuck](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guckuck/32/6234_2.png) [@guckuck](https://discourse.joplinapp.org/u/guckuck)\
**Post date:** [20 April 2022 15:04 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/16 "2022-04-20T15:04:38Z")

</div>

I notized one interesting fact: I create such summery-notes since many months.

I have a summery-note from 29.08.2021. Here, all attachments are there. Also from Jan. 2022.

But on summery notes from Mar. 2022, all attachments (except one) are gone.

---

<div class="post-metadata">

**Author:** ![guckuck](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guckuck/32/6234_2.png) [@guckuck](https://discourse.joplinapp.org/u/guckuck)\
**Post date:** [20 April 2022 15:05 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/17 "2022-04-20T15:05:44Z")

</div>

What? The note history deletes old attachments? WTF? The note-history shouldn't delete attachments that are still in use.

---

<div class="post-metadata">

**Author:** ![guckuck](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/guckuck/32/6234_2.png) [@guckuck](https://discourse.joplinapp.org/u/guckuck)\
**Post date:** [20 April 2022 15:07 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/18 "2022-04-20T15:07:51Z")

</div>

I have notes from 2016 with attachments. The attachments are still there.

---

<div class="post-metadata">

**Author:** ![Daeraxa](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/daeraxa/32/6172_2.png) [@Daeraxa](https://discourse.joplinapp.org/u/Daeraxa)\
**Post date:** [20 April 2022 15:08 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/19 "2022-04-20T15:08:30Z")

</div>

Yes, if you had a note with a picture and you then deleted that picture entirely with no other notes referencing it then wouldn't you expect the attachment to be deleted? The note history setting would preserve it until the note revisions themselves are deleted at which point nothing else in the database references it.

In your case it doesn't sound like it should be applicable because you have a reference to that attachment in another note.

---

<div class="post-metadata">

**Author:** ![kartoo](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/kartoo/32/324_2.png) [@kartoo](https://discourse.joplinapp.org/u/kartoo)\
**Post date:** [20 April 2022 15:09 UTC](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282/20 "2022-04-20T15:09:29Z")

</div>

Joplin copies with full absolute path if you do copy and paste using the visual editor. This is a bug and completely wrong way to handle internal copy pasting of images. I reported this already. You might be hitting this one.

[Next page](https://discourse.joplinapp.org/t/attachments-lost-after-reorganizing-notes/25282.md?page=2)
