I produced a mess on the sync-target by synchronizing wrong data from another client, so I tried to clean it up.
At first I exported a clean version as .jex, then I deleted the joplin folder in nextcloud and all the notes in the client.
After that I imported the .jex file and used "re-upload local data to the sync target" in synchronization to get this clean data into nextcloud.
At first sight it worked (there were about 500 notes in about 30 notebooks synchronized), but after that the process did not stop, it continued and all the notes and notebeooks appeared several times. The double notebooks had no icons.
I stopped this after a while, by closing the joplin client.
What might be the problem?
Would uninstall and reinstall the client be a solution or will the problem occur again?
I don't think that reinstalling would change anything as it doesn't delete the data, Although, you can rename Joplin profile directory to reset your settings and start from the scratch.
Generally, it seems, you're doing everything right. It might be quite naive response but maybe you could try your process one more time?
and removed some related files manually.
After reinstalling the client, I imported the .jex file and used "re-upload local data to the sync target".
Now it works how it was ment to be (in theis case).
There is still the question, what data were stored in the local profile, after I deleted all notes in the client?
I thought this would empty the local profile.