zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.2k stars 1.9k forks source link

Feature Request - Implement restore backup function #1578

Open zDEFz opened 3 years ago

zDEFz commented 3 years ago

Trilium-Notes - Internal Server error, what happened?

Ver 0.45.8 trilium-2021-01-27.log

One of my Trilium-Notes Desktop instances seemed to sync with an old password [overnight], with some "invalid data", it seems. I decided, I'm no longer using sync function for my case, to make sure it's not messing things up. Did not happen with my small Trilium-Notes Database.

What didn't help: Deleting Browser Cache and put back backup, rename old db to document.db.

What helped: Put back old backup AND delete document.db-shm, document.db-wal and session_secret.txt. Knowing that those get recreated automatiically. Without deleting the old files, I would get "Internal Server Error" Luckily, we have daily backups.

Then, restart docker container.

To avoid all this restoring trouble, it would be cool to have a small wizard, with which the user could restore the old backup. Might just need a proper authentification, right? Or would it be a security problem?

zadam commented 3 years ago

Hi, you're right with the -wal and -shm files, those need to be deleted as well. For now I fixed at least the docs on restoring the backup: https://github.com/zadam/trilium/wiki/Backup#restoring-backup

zDEFz commented 3 years ago

Any update on this?