Hi everyone,
this morning I noticed that our n8n instance suddenly reverted to a state from ~4 days ago after an automatic Docker container restart around 03:00.
n8n is running with SQLite on a persistent Docker volume.
For the last two weeks we’ve been working on a large workflow, which performs frequent reads and writes to internal data tables.
When inspecting last night’s backup (taken at 21:00), I found:
database.sqlite~ 2.6 GBdatabase.sqlite-journal~ 1.3 GB
I copied the database files from the backup and opened them with DBeaver (allowing journal recovery).
Unfortunately, the database also shows the same old state as the live instance — the changes from the last days are missing.
There are no -wal / -shm files, only the large journal file.
My questions:
- Is there any realistic way to recover the missing changes from the SQLite DB / journal?
Or should I accept the loss and recreate the changes from a GitHub push made last night? - I’m also very curious to understand why this happened:
Are there recommended ways to investigate the root cause?
I checked the n8n and container logs, but couldn’t find any helpful hints.
Either way, lesson learned — we will migrate to PostgreSQL to avoid this kind of issue in the future.
Any insight would be highly appreciated, especially if someone has seen a similar SQLite rollback after a container restart.
Thanks in advance ![]()
Edit:
In the Logs i just found the following hint:
- DB_SQLITE_POOL_SIZE → Running SQLite without a pool of read connections is deprecated. Please set
DB_SQLITE_POOL_SIZEto a value higher than zero. See: Database environment variables | n8n Docs
Maybe that could have helped…