The safest Trilium Notes recovery plan has two layers: use Trilium’s built-in backup points, then keep an additional copy of the database somewhere separate from the computer running Trilium. The primary file is document.db, a SQLite database in Trilium’s data directory. It contains your notes, tree structure, metadata, and most configuration.
For a restore, identify the correct data directory and recovery file, stop Trilium, preserve the current database, remove the active database and its generated -wal and -shm files, put the selected backup in place as document.db, make sure it is writable, and restart. If synchronization is enabled, coordinate the restore across every sync-cluster member before allowing the restored instances to synchronize.
As an Amazon Associate I earn from qualifying purchases.
The menu names and service-management details can vary between desktop and self-hosted deployments. Use the About Trilium Notes screen and the help for your installed release rather than assuming that an example path applies to your system.
What Trilium actually backs up
Trilium’s primary knowledge-base database is a SQLite file named document.db. The project’s database documentation says this file stores the notes, the note-tree structure, metadata, and most configuration. The file is located in Trilium’s application data directory, not necessarily beside the program executable.
#1 Best Overall
- Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Read the project’s database documentation for the database role and the current project guidance. The database page also advises advanced users to make a backup before modifying the database directly. That is sensible even for a planned maintenance task: a mistake in a SQLite file can affect the entire knowledge base.
The data directory is installation-specific
Desktop packages, a self-hosted server, a portable installation, and a container can use different locations and different methods for stopping the application. The backup guide uses ~/trilium-data as an example data directory; it is an example, not a universal path. Find the path from within Trilium instead of guessing.
Do not treat a live file copy as automatically consistent
SQLite can use temporary write-ahead-log files while the application is running. A file manager copy made during active writes is not a documented, guaranteed-consistent Trilium backup procedure. The official restore instructions explicitly require stopping Trilium before replacing database files. For a manually maintained extra copy, the conservative procedure is to stop the relevant Trilium instance first, then copy the database or an already-created backup point.
What Trilium’s built-in backup points contain
The documented built-in scheme creates copies at several maintenance events and stores them in a backup directory under the data directory. The guide describes daily, weekly, monthly, and pre-migration events, with at most four backups from different points in time. This is a description of the documented scheme, not a guarantee that every release or deployment retains exactly four files.
| Backup event | What it is useful for | Location or filename documented by the guide |
|---|---|---|
| Daily | Recovering from a recent accidental edit or deletion | backup directory under the data directory; the exact filename is not stated |
| Weekly | Recovering when the problem was not noticed immediately | The guide’s example is backup/backup-weekly.db |
| Monthly | Returning to an older, less frequently changing point | backup directory under the data directory; the exact filename is not stated |
| Before a database migration | Providing a rollback point before a schema or database migration | backup directory under the data directory; the exact filename is not stated |
These files are convenient because Trilium creates them, but they remain on the same data storage unless you copy them elsewhere. The project backup page calls this only very basic backup solution and encourages an additional backup to cloud storage or a different computer. Read the full Trilium backup documentation for the project’s wording and procedure.
Rank #2
- Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Build a recovery plan before you need it
A usable backup is more than a file that exists. You need to know where it is, which point in time it represents, and how to stop the instance that owns it.
1. Identify the installation and its data directory
- Open Trilium.
- Use the About Trilium Notes menu or screen to identify the data directory. Record the complete path in your administration notes.
- Determine whether the instance is a desktop application, a self-hosted service, or a container. On a server, identify the service manager or container that must be stopped before database files are changed.
- Check the application’s in-app help for the exact release you are running. The current project overview describes Trilium as cross-platform, so instructions written for one operating system should not be assumed to apply unchanged to another.
2. Keep a second copy outside the active data directory
Copying a selected database to another computer or to cloud storage protects against a damaged disk, an accidental deletion of the entire data directory, or a failed upgrade that affects every local backup point. A portable external drive is another possible physical destination for a second copy; it is an optional storage method, not a Trilium requirement or a specific product recommendation.
Free tools Windows power users keep installed
One-click scans. No signup required.
Use a destination that is not the same folder and, preferably, not the same physical device. Keep enough history to answer your own recovery question: a single current copy helps with hardware failure, while several dated copies help when corruption or an unwanted change is discovered days later. The built-in set supplies only the points that Trilium retains; your separate copy can preserve the versions you consider important.
3. Label copies with time and origin
Give each extra copy a date, the Trilium installation it came from, and a note about whether it was made before an upgrade or migration. This prevents a file from an old test instance being mistaken for the production knowledge base. Do not rename the original built-in files in the backup directory unless you are certain that the change will not interfere with how your deployment manages them; copy them to the separate destination instead.
4. Plan a test restore
A backup is not proven merely because it can be listed in a directory. At a suitable maintenance time, practice identifying the data directory, stopping the application, and starting an isolated copy or otherwise validating that the database opens. Keep the live knowledge base separate from any test instance. The official pages do not provide a success-rate statistic or a complete test-lab procedure, so treat this as an operational check rather than a measured guarantee.
Rank #3
- Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
How to make an additional copy safely
The built-in points are the simplest source for an off-device copy. A cautious workflow is:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minute- Open Trilium’s About screen and confirm the data directory for the instance you intend to protect.
- Check the
backupsubdirectory and choose the point you want to preserve. If you need the current state rather than a scheduled point, plan a maintenance window and stop Trilium before copyingdocument.db. - Stop the desktop application or the server/container that owns the data directory. Use the shutdown method appropriate to that deployment; do not assume that closing a browser tab stops a server process.
- Copy the selected backup file, or the stopped instance’s
document.db, to your separate computer, cloud destination, or portable drive. Preserve the original filename in the destination record and add a date outside the database filename if needed. - Restart Trilium only after the copy has completed. Confirm that the application opens normally and that the source data directory still contains the expected files.
The backup guide does not describe a live-copy recipe for a running SQLite database. If continuous availability is a requirement, consult the instructions for your installed release and deployment instead of treating an ordinary file copy as guaranteed consistent.
Critical warning for synchronized installations
If Trilium synchronization is configured, the official guide says the restore must be performed across all members of the sync cluster. Restoring an older database on only one member can cause that older state to be detected and synchronized toward the newer database. A restore that appears correct locally can therefore be undermined when synchronization resumes.
Before replacing any file, list every sync-connected member and decide how each one will be stopped, backed up, restored, and restarted. Do not reconnect a restored member to the cluster until the coordinated procedure for all members is complete. The documented warning does not provide a newer conflict-resolution workflow; follow the current, version-specific help for your deployment if it differs.
How to restore a Trilium backup
The following sequence follows the project’s documented order. It uses the weekly filename from the guide as an example; substitute the recovery point you actually selected.
Recommended Free Tools
Rank #4
- High capacity in a small enclosure – The small, lightweight design offers up to 6TB* capacity, making WD Elements portable hard drives the ideal companion for consumers on the go.
- Plug-and-play expandability
- Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
- SuperSpeed USB 3.2 Gen 1 (5Gbps)
Step 1: Select and preserve the recovery point
- Decide what time you need to return to. For the guide’s weekly example, the source file is
backup/backup-weekly.dbbeneath the data directory. - Check the file’s date and size and make sure it belongs to the intended Trilium instance. Do not guess based only on a similarly named folder.
- If the current database might be needed for evidence, export, or a different recovery attempt, make a separate copy of the current
document.dbbefore changing anything. Preserve it outside the active data directory and label it clearly as the pre-restore state.
Step 2: Stop Trilium completely
Exit the desktop application or stop the service/container that has the data directory open. On a server, verify that the process has actually stopped before manipulating files. A restart command that returns before the old process exits is not enough; the database must no longer be in use.
Step 3: Locate the active data directory
Use the path recorded from About Trilium Notes. The example ~/trilium-data from the guide is not a universal location. In a server or container deployment, the path visible inside the service may differ from the host path, so use the path configured for that deployment and its current documentation.
Step 4: Remove the active database and generated SQLite sidecars
In the data directory, remove the active document.db and the generated document.db-wal and document.db-shm files. Preserve copies elsewhere first if there is any chance they will be useful. These sidecar files belong to the old active database; leaving them beside a restored database can cause the application to see stale write-ahead-log or shared-memory state.
Step 5: Put the chosen backup in place
Copy the selected backup file into the data directory and rename the copy to exactly document.db. For the weekly example, copy backup/backup-weekly.db to the data directory as document.db. Do not leave the restored file with its backup filename and expect Trilium to discover it automatically.
Step 6: Make the file writable by the Trilium process
The restored database must be writable by the account that runs Trilium. The guide gives chmod 600 document.db as an example on systems that support Unix permissions. Use the equivalent ownership and permission settings for your operating system and deployment; the important requirement is that the application account can read and write the file while unrelated accounts are not granted unnecessary access.
Best Value
- Plug-and-play expandability
- SuperSpeed USB 3.2 Gen 1 (5Gbps)
Step 7: Start Trilium and inspect the result
- Start the application or service using its normal deployment method.
- Open the knowledge base and check several notes, the note tree, recent metadata, and any configuration that matters to your workflow.
- Watch for startup errors, a read-only database, missing notes, or an unexpected empty tree. Stop again if the result is not the intended recovery point, and use the preserved pre-restore copy or another backup rather than repeatedly overwriting files.
For a synchronized installation, complete the coordinated all-member plan described above before normal synchronization is allowed to carry the restored state between members.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Desktop, server, and container differences
Desktop installation
A desktop restore usually involves closing Trilium, using the data-directory path shown in the About screen, replacing the files, and launching the application again. The path can differ by operating system and packaging format, so do not paste a path from another computer into your file manager without checking it.
Self-hosted server
On a server, identify the service name, the account that owns the data directory, and the service’s shutdown and startup commands from the deployment documentation. Stop the service before removing document.db or its sidecars. If the server has reverse proxies, scheduled restarts, or health checks, account for them so an automatic restart does not reopen the database while you are replacing it.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Container deployment
For a container, determine which host volume or bind mount contains the Trilium data directory. Stopping only a shell or web client does not stop the container process. Stop the container, replace the database in the mounted data location, verify ownership and permissions as seen by the container user, and then start the container according to its deployment configuration.
Troubleshooting common restore problems
| Symptom | Likely issue | Action |
|---|---|---|
| Trilium starts with newer notes than expected | The wrong backup point was selected, or the restored member synchronized with an untouched newer member | Stop synchronization, stop the affected instances, verify the dated source files, and follow the all-member restore plan before restarting them together. |
| The application reports that the database is read-only | The restored file is not writable by the account running Trilium | Correct ownership and permissions for the deployment. The guide’s Unix example is chmod 600 document.db. |
| Trilium refuses to open after replacement | The active process was still running, the wrong file was copied, or stale sidecar files remain | Stop the process, verify the data-directory path and filename, preserve the current state, remove the active document.db-wal and document.db-shm, and repeat the documented replacement order. |
| The expected backup file cannot be found | You are looking in the wrong data directory, or the installation retains a different set of built-in points | Return to the About screen, inspect that instance’s backup directory, and check the installed version’s help. The documented four-point scheme should not be assumed to cover every deployment. |
| The restored database opens but recent work is absent | The chosen point predates that work | That is expected for an older recovery point. Preserve the current database copy and compare it with the restored state before deciding which information to re-enter manually. |
What the built-in scheme does not protect against by itself
Keeping all four documented points under one data directory does not protect them from loss of that directory, its disk, or the computer that hosts it. That is why the project recommends an additional cloud or different-computer copy. The separate copy should be made deliberately and retained according to the amount of history your work requires.
The database documentation describes document.db as containing notes, tree structure, metadata, and most configuration. Because deployments can add their own operational files, review the current instructions for your release and deployment before assuming that replacing this one file reproduces every surrounding service setting. The documented restore procedure specifically addresses the database and its SQLite sidecars.
Version and documentation checks
The TriliumNext Docs repository containing the cited backup and database pages was archived on March 9, 2025. The application project remains the place to find current project information and points readers toward current documentation and in-app help. Consult the current Trilium project repository and its documentation index when your installed release or deployment does not match the examples.
For reference, the archived documentation repository is available at https://github.com/TriliumNext/Docs. Treat its procedure as project guidance, then verify labels, paths, permissions, and service operations against the version you actually run.
Quick Recap
A compact recovery checklist
- Record the data-directory path from About Trilium Notes.
- Confirm that
document.dbis the database you intend to protect. - Copy selected built-in backup points to a different computer, cloud destination, or optional portable drive.
- Before a restore, preserve the current
document.dbsomewhere separate if it may be needed. - For synchronized installations, plan the operation for every sync-cluster member.
- Stop Trilium completely before changing database files.
- Remove the active
document.db,document.db-wal, anddocument.db-shm. - Copy the chosen backup into place as
document.db. - Ensure the restored file is writable by the Trilium process.
- Restart, inspect the recovered notes and tree, and only then return the installation to normal operation.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




