Formatted my Linux OS, reload folder to sync in file system but lost all file attachment resources

Hi,

I am using Joplin Desktop v1.0.216 on a Ubuntu 20.04 OS
I formatted my OS and backed up the folder with all my notes. Then I also backed up the following folders:

~/.config/joplin-desktop
~/.config/joplin

but unfortunately I ignored the subfolder ~/.config/joplin-desktop/resources because I thought the real resource attachments were still in my main note folders.
Now after re-opening Joplin Desktop I cannot see my attachments anymore.
On my Android phone I can still see them correctly (it is synchronized with the computer via file system by using Syncthing application), but not in the Desktop app.

Is there a way to recover the resources?
Most of those attachments are really crucial for me, so I hope you can really help me!

Thanks

If they are on the syncthing, can’t you get your resources from there? But first, backup your phone data, and backup your syncthing data.

Then normally you can just clear your desktop Joplin profile, then sync with syncthing again.

1 Like

no unfortunately Syncthing was just synchronizing the folder of my notes (which is /mnt/MyDrive/Joplin/) and not ~/.config/joplin-desktop/.
So, after formatting, I placed the old ~/.config/joplin-desktop/ folder in my home (without ~/.config/joplin-desktop/resources) and when I opened Joplin (without clearing any profile) I found all my notes back, but lost the attachment references.

So I spent all the day yesterday to screenshot the attachments from my phone and now I need to decide how to proceed for the future because at this point I would like to understand what’s the best way for me to handle the attachments.
E.g. what if I don’t need to encrypt the attachments and I will place the files inside a local folder (synchronized with Syncthing) and just want to reference it from a .md note by using a relative path so that both the desktop and phoen application will be able to read it?

E.g. if my notes folder is /mnt/MyDrive/Joplin/ and I want to place my attachments inside /mnt/MyDrive/Joplin/data/ and want to reference it by using a relative path like <img src="file://data/image.png" />, is there a way to do that?

Thanks

What you suggest is not supported so I wouldn’t recommend to do it. In Joplin, you attach a file to a note, you sync, and then the file appears on all devices. How the resources are stored, etc. is implementation detail and if you change something to it you’re likely to lose data.

reference it by using a relative path like <img src="file://data/image.png" />

Some users do this but obviously that will only work on desktop, not on mobile.

1 Like

Ok thanks, so in case I decide to use the usual way to attach notes directly in Joplin and I decide to format my system again, of course I need to keep the folder with my notes (which is anyway on another HD /mnt/MyDrive/Joplin/) but also backup the entire ~/.config/joplin-desktop/ (~/.config/joplin-desktop/resources included)?
Or better: is there a way to accomplish the backup without the need of ~/.config/joplin-desktop/resources?

edit: I ask this especially because in my case I always do regular backups of my /mnt/MyDrive/Joplin/ folder (and it is also synchronized with Syncthing), but I don’t do the same for ~/.config/joplin-desktop/ and I may easily lose the data in there.

Thanks

reference it by using a relative path like <img src="file://data/image.png" />

sorry I also want just to get back on this, of course it will work only on my PC, but that’s why I asked if there is a way to reference the note path and from that to use a relative path, e.g.

<img src="file://$CURRENT_FOLDER/data/image.png" />

this way I will sync the folder with the attachments between PC and phone and the real attachment will be store on both devices under $CURRENT_FOLDER/data/

We're back to square one then because that's how it works by default: A resource is attached using the syntax [some file](:/abcd12345), and :/abcd12345 will link to the right file on both desktop on mobile

It's not clear what problem you are trying to solve to be honest as Joplin already supports what you need.

Yes but what I meant is if it possible to use [some file](:/abcd12345) to point to normal files that I will place inside the shared notes folder and so acces it by using e.g. [some file](:/data/image.png).

Just to try to clarify the source of those concerns: since I discovered that the original attachments are under ~/.config/joplin-desktop/resources for me this is not just an implementation detail because in my case of formatting the OS I just backed up the shared notes folder (/mnt/MyDrive/Joplin/), where of course the original attachments were missing. So when I re-opened Joplin I found all my notes but the attachments were not showing (it could not find the references), because the ~/.config/joplin-desktop/resources folder in my new home was just empty.

So I am just trying to find a good general way to proceed with Joplin and because I think that my way to synchronize and backup my notes between my devices has to be reviewed a this point.
I short words, next time I will need to format my OS I don’t want to care of backing up the ~/.config/joplin-desktop/ folder, I just want to have one single point of source for notes and attachments, so that I will share it with my devices and will be also my backup for cases like formatting my PC or phone.
In this context you may also understand that I would also avoid the manual data export (e.g. JEX etc…) especially because, if one day my PC drive will fail and my system will not boot, then I will lose the attachments (~/.config/joplin-desktop/) while the notes will still be on my other drive (/mnt/MyDrive/Joplin/) also shared and synchronized between my devices thanks to Syncthing.

Thanks

I have to admit I do not quite understand your set up.

Your Joplin profile apprently is in ~/.config/joplin-desktop - there should be your database.sqlite wIth notes and .resources folder with attachments.
Now you also have /mnt/MyDrive/Joplin/ where you say your notes are? How do they get there?

  • /mnt/MyDrive/Joplin/ is the shared folder for the File system sync, is contains all the .md files and the .resource folder.
  • ~/.config/joplin-desktop is just the folder that the Joplin desktop app automatically created when I installed it and yes, it contains also database.sqlite and .resources/.

If you were using Joplin’s file system sync then that directory should contain not only notes but also resources.

Anyway, I have re-read your original question. If you have all your notes with attachments on Android then I think not all is lost for you.

All you need to do use export profile function on your phone to save your profile to storage, copy over to your computer and you’ll get your attachmetns. But first you need to wait for the next version to be released as the current version has a bug which breaks profile export.

1 Like

thank you, that’s a very good news, I will wait for the new version then!
About changing my approch to backup after this problem I had, I am still thinking about how to proceed from now on. That’s why I was asking for referencing attachments directly to a shared folder instead of attaching inside the notes from Joplin itself or maybe I should put all my resources on the cloud and reference them by just using the URLs.
Another idea I am having is to avoid all of that, just attach my resources the normal way with joplin and just run regular .jex backups by using the terminal app, but about this latter idea I opened another thread asking for a clarification.

Thanks