How does trilium auto save notes? #6561
-
I'm using trilium for daily notes and lecture notes with very important things like health and tax information and things like this because after a brain injury I cannot remember things consistently and constantly forget. I'm just concerned after a javascript error I got which I don't exactly remember what it said and some I/O error I was wondering how does trilium exactly save notes? Does it automatically save notes? I don't remember if anything was lost because i got the javascript or I/O error so was just concerned that I had lost something and wanted to know if its just auto saving every minute or something. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Trilium auto-saves your notes in real time—every time you make a change, it schedules a save, usually within about a second if you're actively editing. The main editor also keeps an internal backup every 5 seconds and monitors for crashes, trying to recover automatically if something goes wrong. There isn't a fixed "save every minute" schedule; saves happen after each change or pause, so it's rare to lose more than a few seconds of work even if there's an error. All your notes and attachments are stored in a single SQLite database file, and every save is wrapped in a transaction—so either everything saves, or nothing does, which helps prevent partial or corrupted saves if there's an I/O or JavaScript error. If a save fails, Trilium marks the note as needing to be saved and will try again, reducing the risk of data loss. There's also a daily automatic backup and a revision history, so you can recover previous versions if needed. For more details, see this discussion of the saving and backup process and how the database works. If you ever suspect something was lost, you can check the daily backups or revision history to restore previous versions. Data loss from a single error or crash is very unlikely thanks to these safeguards. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Dosu is right, there's a periodic save each time you write something. It's in the matter of seconds, so there shouldn't be a data loss.
There are indeed two cases that we've seen in the wild:
I've daily driven the Trilium app for since 2022 (even before I became maintainer) and I've never suffered irrecoverable data loss. Just some minor annoyances due to bugs in the editor.