Replies: 2 comments
-
Hi @pmorch! I'm Dosu and I’m helping the Trilium team. You don't need to script against the SQLite database or use browser automation for periodic/automated exports anymore. Trilium now exposes an API (ETAPI) that lets you export notes—including the whole tree—to HTML or Markdown ZIPs via HTTP requests, which you can automate with curl and cron. This is the recommended approach for automated exports and is supported/documented by maintainers source. How to automate exports:
The exported ZIP matches what you get from the UI: static HTML with navigation, index, and attachments. The HTML is intentionally simple (frameset-based, no search, not mobile-friendly) source. If you want a raw dump of all notes for disaster recovery (not styled HTML), there's a CLI tool in No recent changes have added a built-in, one-step CLI export for HTML, but scripting the ETAPI export endpoint is the officially recommended and supported way to automate exports source. Let me know if you want a full example script or more details on authentication! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
Fantastic! I just tried it and it works great. Dosu is quite impressive... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Part of what I want to store in Trillium is disaster recovery procedures. So there is a chicken-and-egg situation: If I need to restore after a complete failure, I may not have a running Trillium instance, only a backup.
So I was hoping to have access to an up-to-date HTML export of my Trillium instance. Righ-clicking on the root node and exporting works great, but cannot be easily automated. Or perhaps it could with something like Selenium or Playwright. But that comes with its own footguns.
In TriliumNext/Trilium#558: "Easy way to export trilium to static website" from 2019, @zadam writes:
Is this still the only path forward? Having to manually create the file structure, frames, links, CSS and whatnot seems brittle and not a 10-minute job... And I don't trust that N years from now, when I actually need to access the export to restore, that the output of my manual export script will still be in good shape.
If this is the case, I think I'd rather document how to start a local Trillium instance based on a backup of the trillium folder containing the database.
But I'm still hoping for an easy way to export from the command line...
Beta Was this translation helpful? Give feedback.
All reactions