Best way to delete orphaned resources

While browsing my resources folder, I noticed hundreds of photos that no longer are related to a note. Deleting them through the attachments view is tedious as I can only delete one at a time, and then must scroll through the list again to locate the next deletion.

Could I simply delete these from the resources table folder without causing harms to the database? That would be much simpler as I can quickly see the problem files and delete in bulk.

Again, what harm, if any, would I cause by directly deleting files using Window File Explorer (or its equal)? Thanks!

1 Like

Don't do this - I tried this as a test. Causes sync conflicts and AFAIK, no way to resolve the conflicts unless you start a new JoplinProfile.

1 Like

Thanks... not the answer I hoped for, as I now see countless htm files which appear orphaned...

and I feel compelled to remove them :face_vomiting:

So maybe there’s another “simple” way to clean this up?

For example, I exported (JEX) my database and noticed that the JEX resources folder has no htm entries, nor do I see the presence of the unattached photo files.

What if I deleted the contents of my profiles’ /resources folder, and then imported the JEX. Would that work? Or would the text entries be duplicated between the import and the existing fields.

Or alternatively… delete the /resources folder and replace it with the JEX /resource folder?

To put some perspective here… the JEX has 970 resource files… my current db has 1,445 files… nearly 500 excess files!

there are a lot of threads on this already. please search

Post, follow the bug via https://github.com/laurent22/joplin/issues/932

Hopefully it's fixed soon

1 Like

It was far less onerous to delete the profile and restore from JEX.

Thanks for the bug link.