I am trying to import my notes back to Joplin which I previously exported. I used “JSON - Json Export Directory” format for export. Today when I am trying to import back there is no option to import back this format. Please help me in importing my notes back.
I am sorry I couldn’t understand your question. They are not in Joplin. They were deleted from Joplin after export using JSON format. But apparently there is no JSON import option to import them back.
@laurent@foxmask
I am thankful to you guys for building such a great tool. But think it’s a bug that Joplin allows to export in a format that it doesn’t accept back. I would very thankful for your attention and response.
Hi,
you could read this from documentation. Also this mentioned tutorial, which explain how to convert JSON files to ENEX format.
I agree with you on the lack of warning on the export formats that don’t allow the import.
There’s nothing wrong in not importing a format that can be exported, however I agree that in this particular case (JSON) it might be confusing because it’s more like a machine-readable format.
It was added by a user at some point and I think I’m actually going to remove it. There’s no good reason for it to exist since as a machine readable format we already have JEX, which is not hard to parse.
Thank you for your response. Yes so nobody get into this situation in future. Can you please help me to recover from it? There are many important notes that I cannot afford to lose.
I thought it may have been a bit of a long shot as I could not see why a Standard Notes JSON export would be the same structure as a Joplin JSON export.
Did you ever sync your notes with a server and, if you did, do you have Joplin on any other computer and how did you delete your notes after the JSON export? Did you delete all notes and allow Joplin to sync or did you just delete the .config/joplin-desktop folder?
I do not have the knowledge to figure out a way to convert a JSON export to something Joplin can import. Therefore I am trying to think of other ways.
When you sync and that sync deletes files, does your online storage place those files in a “Recycle Bin” like Nextcloud does?
I am wondering if it would be possible to:
delete the ~/.config/joplin-deskop folder on your deskop computer, which reverts Joplin to being like a new install,
restore everything from the online storage “Recycle Bin” back into its original positions on the online storage (which hopefully it does automatically) and,
then reconnect the desktop Joplin to your sync target.
I am just trying to think of a way of getting notes back for long enough to make a JEX Export. Then the online storage / Joplin can be tided up again and the JEX Export imported.
If you do try this make sure that Joplin is not active on your mobile in case it detects any restored files as old and deleted and deletes them again. The mobile device can be sorted out afterwards by deleting the app’s cache / storage before running it again.
You may want to wait to see if any others see any flaws in the above before you start or whether they have any better suggestions…
I decided to write a python script to convert JSON into MD. After running this script, I successfully imported my notes back to Joplin.
for filename in os.listdir(os.getcwd()):
final_file = ''
try:
data = json.load(open(filename))
for key, item in enumerate(data):
if item == 'title':
final_file+=data[item]
final_file+="\n\n"
if item == 'body':
final_file+=data[item]
title = data['title']+'.md'
with open(title, "w") as text_file:
text_file.write(final_file)
except:
print("\n\n\n"+filename+"\n\n\n")
continue