Import & Export

To import a note:

  • The easiest way to import is to simply drag & drop a file or an archive into the Note Tree.
    • This will automatically detect some formats such as Obsidian.
    • Safe import is automatically on to prevent accidental running of foreign scripts.
  • To configure an import, there is a dedicated dialog which can be accessed from either Note Tree → Import into note or Note menu → Import into note.
    • This feature allows for dedicated importers for others apps such as Obsidian or Microsoft OneNote.
    • Safe import as well as other options can be configured from the collapsed Options section at the bottom.

To export a note, right click the note in the Note Tree and select Export. Similarly, in Note menu there is a Export note option.

Supported formats

Trilium natively supports the following formats for both import and export.

  • HTML:
    • This is the main format used by Trilium, where standard tags are used to represent basic formatting and layout (e.g. <strong>, <table>, <pre>).
    • Note that HTML is not a standardized format so some more specific features such as admonitions or Internal (reference) links might not be supported by other applications.
    • The notes can also be exported as static HTML that can be used for web publishing.
  • Markdown
  • OPML (Outliner Interchange Format)
    • Supports both OPML v1.0 for plain text and v2.0 with HTML support.

A single Text note can also be exported as a Word document (.docx): in the export dialog, select Only this note and then Word document. The document keeps text colors, highlights, font sizes, headings, lists, links, images, page breaks and tables with their cell colors, borders and column widths, so it looks the same in Microsoft Word, Google Docs or LibreOffice. Body text is set in Calibri at 11pt with Word's usual paragraph spacing, and headings are bold. Links to other notes become plain text, and diagrams and embedded notes are left out. A Word document that you import becomes a File note, which the Note menu can convert into a Text note: see Converting between note types.

To export into the format of an existing Word document, such as a form your company uses, import that document as a File note and point a ~docxTemplate relation at it. The exported note then replaces the body of that document and takes everything else from it: its fonts and heading styles, its headers and footers, its page size and margins, and its embedded fonts. The editor's font sizes are measured from the template's body text. Make the relation inheritable, or put it on a template, so that every note in a subtree exports the same way. Whatever the template's body holds is left out, and only the page setup of its last section is used.

To keep part of the template's body, such as a cover page or a signature block, type {{content}} on a line of its own where the note should go. The note then replaces only that line, and the rest of the body stays as it is. The whole line is replaced, so any other text on it is lost. The note's text takes the style and the formatting of that line, such as its font and size, and the editor's font sizes are measured from it; headings keep the template's heading styles.

To import from other applications such as OneNote, Notion and others, see Importing data from other applications.

Maximum import size

Versions prior to v0.104.0 had an upload limit of 250 MiB that could be bypassed via a TRILIUM_NO_UPLOAD_LIMIT environment variable; with v0.104.0 this limit was removed.

Nevertheless, there is still a limit for the maximum size of a single item (whether it's a File, an Attachments or even a Text note). The limit is approximately 374 MiB and it's determined by the Synchronization protocol. Attempts to import such large files will be refused.

During large imports or exports, memory consumption might spike but it will remain somewhere around the 2 gigabyte mark. Tested with a 2.4 GB database with ~21k notes.

Exporting the root note

The root note is the top-most note. Exporting it behaves just like any other note: right click on it in the Note Tree and select Export.

Starting with v0.104.0, when a root note is imported, it will be imported as a child of your existing root note. This behavior makes sure that the import cannot change or overwrite your existing notes.

You can easily move the notes onto the root using the tree's Multiple selection and delete the redundant root note.

BeforeAfter
  • root
    • one
    • two
  • root (existing)
    • root (from import)
      • one
      • two

Exporting the User Guide

The in-app User Guide can be exported like any other note: right click one of its pages or chapters in the Note Tree and select Export, or use Note menu → Export note.

  • Exporting a chapter with This note & all descendants writes the pictures and files of each page as its attachments. Importing that archive creates an ordinary copy that you can edit, with its pictures and the links between its pages working.
  • Exporting a single page with Only this note embeds its pictures in the exported file.