notabase icon indicating copy to clipboard operation
notabase copied to clipboard

Exporting & Importing notes.

Open RealmX1 opened this issue 2 years ago • 2 comments

Describe the bug Trying to exporting my notes from notabase.io, and importing the files into my locally hosted notabase version. The exported file is a .zip file.

  1. Have trouble when unzipping the exported file: image this shows up for multiple notes. One thing that might be causing the problem is the titles I used for the notes, or the use of Chinese characters/marks (which cause problem for file manager when un-zipping it), but I'm not sure.

    UPDATE: It is note just caused by Chinese characters, any character that leads to confusion of the path interpreter will result in this, for example, ":". When a ":" exist in the file, the exported file will create ONE file with ":" replaced by "_", but when this is imported by local server, two files are generated: One with the title replacing ":" with "_" and has the original content, but doesn't have the original linked reference; and another with the same name as the original file, has original linked reference, but don't have any content. I think the first file is generated through the exported file, and the second one with the original name is generated through another file in which this note is created (interpreter of notabase on file import looked at it, found no corresponding file, and assigned a new empty note with linked reference for it) Original note on notabase.io; has ":" in title, has content, has linked reference (bottom): image Corresponding file in exported zip file: image

     一切有关“好坏”评判的皆是价值评判/估值(evaluation),其中对于好坏度量的描述/定义既是该评判中的价值。
    
    
    
     价值(value)vs. Moral Value/Morality vs. (非价值)数值标定 vs. 价格
    
     和传统意义上哲学里moral value/morality所指代的,以“[[实体]]行为为估值对象的价值“不同,这里所采用的定义更加宽泛,同样包括了人对事物本身的估值。
    
     并不代指人们用于描述事物无关好坏属性时所采用的数值标定。
    
     并不完全等同于“[[价格|价格]]”,价格更多的可以被看作是拥有不同价值观实体在交互过程中达成的,对于价值观实证的妥协。
    
    
    
     [[def: 价值实证 Enforcement of Value]]
    
     [[def: 价值实例 Value Instantiation]]
    

    First note of the file imported into local server, changed ":" to "_", has content, doesn't have linked reference (bottom): image Second note corresponding to the same original note: image

  2. (This may or may not be the result of the first problem) When importing notes to my local server, the original foldered structure of notes are not restored, and a lot of information (one of the most obvious ones is the removal of empty lines) in the notes are removed. The graph view remains similar though. Loss of foldered structure: In notabase.io (original notes) image After exporting from that, and importing to local server: image Loss of empty lines: In notabase.io: image On local server: image

I'm running from wsl2, and uses Edge as the browser

A potential quick fix for the problem is to do hashing on title string and use that in saving file name (and unhash for importing); but it will drastically reduce the readability of the exported file.

RealmX1 avatar Nov 22 '23 01:11 RealmX1

Hello,

Thanks for reporting this issue! Sounds like there are several problems here; let me try to break it down.

  1. As you've noticed, there are some special characters that you can use in note titles that do not export well because those characters are not supported as file names in the OS filesystem. This causes issues with linked references breaking as well since those special characters will be converted to a different character when exported. Unfortunately, we can't work around the OS restriction, so there will have to be some transformation done to the note title when notes are exported.
  2. The folder structure is not preserved when importing notes. We do this because when the typical user stores notes in an OS filesystem, they are usually not expecting each folder to be transformed into a corresponding note (since it wouldn't contain any information).

For context, the importing/exporting feature was primarily designed to facilitate importing from a different system or exporting to a different system. Thus, when exporting notes and trying to import them again into Notabase, the notes will sometimes not appear the same as before (as some information will be lost in the transformation to markdown). Therefore, both of the above points are actually intended behavior.

However, I do agree that it would be useful to be able to export all of your data so that it is easier to migrate from the hosted version of Notabase to a self-hosted version. This cannot be done with markdown files, but I can add a feature to export your data as JSON which you can then import in the self-hosted version. This will allow for your use case of migrating between different versions of Notabase while still preserving all of your data.

I have added the above as a feature request - let me know if that would work for you.

churichard avatar Nov 26 '23 21:11 churichard

That would be great. Thanks.

RealmX1 avatar Nov 27 '23 18:11 RealmX1