Attachments lost after reorganizing notes

I don't use the visual editor. I always use the markdown-editor.

Any hints how to recover the attachments?

Right now I'm copying an old resources-folder from Time Machine and searching for every single attachment to copy it in the note again. Very time consuming.

If the references still match up between your markdown and the filenames in your backed up resource folder then you should just be able to paste them into your resource dir as well as the one on your sync target.

I would advise making backups before doing much else though - if you don't have the simple backup plugin then install it and run it in case anything unexpected happens.

So, I have to copy the resource to the resource-dir on my mac (I just work on) and to the resource-dir on my nextcloud-server? Did a understand that correctly?

In theory, yes. Just make sure you do the backup first in case anything does go awry somehow.

Yes, the backup is running.

Whatever the outcome, thank you for your support!!!

1 Like

And another question: Is this a serious bug? :slight_smile:

Depends if it can be replicated or not which is what I want to find out, I just cant do it right this moment.
If you are reliably able to replicate it then it might be worth detailing the exact steps taken and providing log files showing the deletion etc.

Ok, I understand. I will try to reproduce it but I use Joplin for my whole private und work life. I have to rely on the program.

Does joplin always create logs? Or do I have to turn it on?
Here one attachment is removed. Looks normal except the attachment is still in use: 2022-04-16 16:40:44: Synchronizer: "Sync: deleteLocal: remote has been deleted: Resource: (Local f2fc0ca6e96dc858145687664e55d756): (Remote f2fc0ca6e96dc858145687664e55d756.md)"

@Recovery: Should it be enough only copy the missing attachment on the server resource directory and than sync all clients? Because: I can not copy the missing attachments on every device (i.e. iPad).

Arg, I can not copy it in the server-directory: On the server all resources have the ending .md.

Maybe I should use the option "Re-upload local data to sync target" after copying all missing attachment on the local resource-directory?

That might be worth doing indeed, it is worth seeing if you can get just a couple of clients working and playing nicely with the sync target then extend it to other devices.

Joplin doesn't notice that I copy a resource back to the resouce-directory. :frowning:

I assumed the reupload would be able to recognise it.

If the notes show correctly locally now you copied, does a JEX export (either Export all > JEX or right click on a notebook) contain your missing resources or not? (You can open jex files as a compressed archive)

Ok, I start upload all loal resources. This would last a few hours, I think.

No, in the JEX-file are only the correct attachments. I have export a note with 2 correct attachments and 7 orphaned resources. Only the 2 correct attachments are there.

I often work similarly with attachments, but could not find this problem.

  • Create Note A with one resource
  • Check the resource id in note_resources, there is now an entry for this note
  • Copy the md resource link from note A to a new created Note B
  • The resource id now has two entries in the database note_resources

Could you look in the database.sqllite with a SQLLite tool (Like SQLiteDatabaseBrowser) if there are entries for the resource id in the table note_resources with the following command select * from note_resources WHERE resource_id = 'XYZ'?

There are no entries in the db for an example resource-id.

@laurent possible I have found the bug. Could some one replicate this.

  1. Create Note A with resource A on PC A
  2. Create Note B on PC A and add the md resource link from resource A
  3. Check the table note_resources for resource A, there are two entries here
  4. Sync Joplin to your sync target
  5. Check on PC B the table note_resources for resource A, there is only one entry here and it is from Note A
  6. Wait a lite bit
  7. Check on PC B the table note_resources for resource A, there are two entries here, for Note A and Note B

Therefore, the resource is deleted when Note A falls out of history, even if the resource is still used in Note B.

Ok I was probably too fast when checking the table after the sync ... after a while the second entry is also present.