Replies: 8 comments 3 replies
-
|
Hi @Revali25! I'm Dosu and I’m helping the Trilium team. Starting with a new database in Trilium does overwrite any existing data in the database file—there’s no automatic backup or archival of the previous data at that moment. If you didn’t manually back up your database file (usually called The 400 error during sync or login is usually caused by a mismatch between the sync protocol versions of your client and server, or by incorrect sync credentials (for example, if the document secret doesn’t match between devices). This can happen if the server and client are running different Trilium versions, or if the local database was reset and no longer matches the server’s sync state (source). If you have backups, you can restore them by replacing the current To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
I replaced my document.db with a backup db and now it's saying that the database is malformed |
Beta Was this translation helpful? Give feedback.
-
|
A "database is malformed" error means the SQLite database file (document.db) is corrupted or incompatible and can't be read by Trilium. This often happens if you restore a backup while Trilium is running, if there are leftover document.db-wal or document.db-shm files, if the backup itself is corrupted, or if there's a version mismatch between the backup and your Trilium install (details, more). To properly restore a backup:
If you still get the malformed error, the backup file itself may be corrupted. Try restoring from an older backup if you have one. If none of your backups work, recovery is unlikely, but you can try SQLite repair tools (with low success rate), or—if you have access to any working Trilium instance—export your notes as a zip and import them into a new instance (source). If you want more targeted help, let me know which backup file you used, whether Trilium was stopped during the restore, and if you have other backups available. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
@DosuBot is there a way for me to change the frequency of backups, so that they back up every 6 hours in addition to once daily, weekly, monthly, etc.? I have plenty of space on the drive and I don't want to have potential data loss like this again. |
Beta Was this translation helpful? Give feedback.
-
|
Trilium doesn't support changing the built-in backup frequency to every 6 hours (or any custom interval) through its UI, config.ini, or environment variables—the built-in automatic backup is daily and not user-configurable beyond that (source). If you want more frequent backups, you can automate periodic exports using Trilium's ETAPI (HTTP API) and schedule them with cron (Linux) or Task Scheduler (Windows). For example, to export your notes every 6 hours:
This approach gives you flexible, frequent backups without interfering with Trilium's built-in backup system. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
@Revali25 , so is everything OK now, did you manage to restore from backup? Dosu's answer is correct. The interval for backups is not customizable. |
Beta Was this translation helpful? Give feedback.
-
|
Is that Raspberry Pi using an SD card for storage? Sounds to me like a data corruption caused by a failing memory card. Trilium is doing daily, weekly and monthly backups as separate files. The backups are performed by the server, but also by the desktop client as well. So, if you used synchronization, a copy of your data may still be present as a backup on the device where you run the desktop client. Did you check if the weekly/monthly backup is corrupted as well? |
Beta Was this translation helpful? Give feedback.
-
|
okay this is really weird. on my desktop computer, I have access to the database, but on my laptop I try accessing the server with the web address, and also with the electron app, and the behavior is the same as before. The electron app says "Sync in progress" but never actually progressing past that, and the server website is asking me to set up the database. Accessing it from my phone asks for the password I set when I accidentally overwrote the database earlier. I haven't been able to SSH into the server because I accidentally lost my ssh key, I'm working on fixing that but is it possible somehow that Docker is running two containers and for whatever reason my desktop is accessing one of them, and the other devices are accessing another? On my desktop I'm able to access the database with both the website and the electron app, so I'm just super confused now. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'm unsure if I actually just did what I think I did, but I have a trilium instance set up running on a raspberry pi I had laying around. I've been doing some creative writing planning in it, and just today I tried accessing it and I got a 400 error when trying to log in. I'm unsure why this happened, I accessed trilium through my website's domain, and it was asking me if I want to set up syncing, or start with something new. I tried saying I wanted to sync, but every time I tried it would give me a 400 error. I'm very confused about this because it's worked perfectly without any hiccups until now. I tried reinstalling the Windows client with no luck, and the only way I was able to make any progress was to start with a new database. Does this mean I just deleted everything I had already?
TriliumNext Version
0.101.3
What operating system are you using?
Windows
What is your setup?
Local + server sync
Operating System Version
Windows 11 25H2
Error logs
No response
Beta Was this translation helpful? Give feedback.
All reactions