When File System sync is enabled and a user imports a JEX backup from desktop on Android, Joplin duplicates notes instead of detecting existing note IDs and merging or skipping. It looks like the JEX import path does not check whether an item with the same id already exists in the local database or via the current sync target. I confirmed this on Android. Desktop might behave the same, unverified.
Steps
Have an existing profile synced via File System sync (sync target already contains the notes).
Import a JEX export of that same dataset from desktop into the same profile.
After import (and after sync runs), the notes appear duplicated.
Expected
Import should detect existing items and avoid duplication. Either skip items that already exist, or resolve by keeping the latest version. If the intended behavior is “always import as new copies,” then the importer should regenerate IDs or warn clearly.
Actual
Duplicates are created, suggesting there is no check for existing note/item IDs during import.
Impact
This creates large-scale duplication that is painful to clean up. It also makes JEX import risky as a faster bootstrap method when filesystem sync on mobile is very slow.
Import is not suitable for that purpose. There is unfortunately no way to bypass an extremely slow initial sync with file system sync on Android unless you have a rooted device and can manually replace the profile. I had a look before at implementing an alternate import feature to skip a long initial sync, but unfortunately because of the way the sync works it would be very complicated to get that to work, so I gave up.
It is by design that the import does not do duplicate handling and will generate new ids for all imported data. On the one hand, the definition of an import function is somewhat ambiguous and it is a common pattern in software that an import does not do any duplicate handling (whereas a restore function does handle duplicates, or replaces all data). On the under hand it is a common complaint about Joplin that this is not clear, and I agree there should be some kind of warning about this, because not knowing this can waste a lot of time due to how long it can take for Joplin to sync a large number of items
Also, because SAF is so slow on Android for directories containing a large number of files, my personal recommendation would be to not use file system sync on Android, but instead use WebDAV if it’s possible. If you are syncing the file system directory with a cloud service supported by the RoundSync app, then using RoundSync is the best way to go. See Could you please add the function of synchronization to FTP server - #5 by mrjo118
seems the import feature is fairly new as I’ve not seen it before, and I wasn’t aware of its limitations (intentional or otherwise). I had been especially asking for it in the past exactly to solve the problem with the android slow sync, and was quite disappointed to see it finally implemented but still not solving the actual problem. Kind of wasteful I think to not solve two problems at once.
It also makes me question the whole purpose of importing from JEX. how is that useful? Doesn’t that just limit usage to one device when using this method?
It’s been a feature on desktop for years. It was implemented more recently on mobile but I think the feature has been there for at least a year.
The import jex feature is definately not useless. If something goes wrong with the sync and you can’t remedy it, you can make a jex backup on one client then delete everything on both the client(s) and server. Then you can import the backup on one device and sync the changes to the rest of your devices. So it’s intended mainly for importing backups - but you need to clear everything down before importing the backup in order for it to be useful.
my meaning is that it’s value is questionable for android devices. how would the mobile device propagate the changes further? What I noticed is that the notes just stayed duplicated on the android. That means those notes were not becoming part of any other sync process.
so I question that the would even if the android phone was later set to sync another way
Yeah, the notes you import will get uploaded by the sync. It’s just that file system sync on Android is very slow as you mention, so its probably just so slow you didn’t notice that (also the import retains modifcation date, so imported notes wont appear at the top unless recently modified originally).
While ideally it is best to do the initial setup on a computer, if a user didn’t have a computer then they could do the initial import via the mobile app instead, so it’s useful to have on mobile as well. Also if you’re using a fast sync target like Joplin cloud / server or don’t have a large collection in the first place, it doesn’t really matter whether you import on the desktop or mobile app as it should be just as quick