Right-click the top note of what you want in the tree and choose Export...
Under What to export pick This note & all descendants, then pick HTML under Format.
Select Export to save a zip with an HTML file for each note and a folder for each note with children.
Watch out for
Labels and relations are only in the zip's !!!meta.json, which only Trilium reads.
Only each note's modified date comes out, as the file's date. Created dates and revisions are only in a database backup (Options, thenBackup, thenBackup now), which only Trilium opens.
Protected notes only come out if you've unlocked them first, and then they're in plain text. Otherwise you get an empty note called [protected].
Links to notes outside the branch won't work, and a note in two places comes out once, with a stub pointing to it from the other.
Canvases come out as an SVG picture plus their drawing data in JSON.
Right-click the note to import into and choose Import into note...
Leave Files & other formats picked, choose the files or a zip of them and select Import.
Watch out for
A zip's folders become the note tree, and relative links and images between its files are connected up.
Front matter turns into labels, one for each key and one per item in a list, so each tag becomes a tags label. Nested values are dropped.
[[Wiki links]] become links to a path of the same name, which is then looked for in the zip, so they may not connect up. For an Obsidian vault, use the Obsidian import.
Files imported on their own, rather than in a zip, don't get their links connected.
In Notion, export the workspace or a page as HTML, with Include subpages and Create folders for subpages on.
In Trilium, right-click a note in the tree, choose Import into note... and pick Notion under Import from.
Choose the .zip and select Import.
Watch out for
It won't take a Markdown & CSV export. It has to be HTML.
Every database becomes a table, whatever its view, and its columns become labels. Formulas and rollups come in as fixed values, and buttons are dropped.
Created and edited dates only come across from Created time and Last edited time properties. Otherwise notes are dated the day you import.
Page icons and covers are dropped, and so are files no page links to.
Relations to pages that weren't in the export are dropped.
In Anytype, export the space with the Any-Block format and JSON selected.
In Trilium, right-click a note in the tree, choose Import into note... and pick Anytype under Import from.
Choose the .zip and select Import.
Watch out for
Only pages and collections come in. Sets, tasks, notes and bookmark objects are skipped.
Anytype's own Tag and Description properties are dropped, and so are properties that link to other objects. Only properties you made yourself come across.
Everything lands under one Anytype import note, with collections as list, grid, board, calendar or table views from their first view.