Safe to Delete

Neo4j Graph Database Transaction Log Files (neostore.transaction.db.*)

Quick Answer: Neo4j stores transaction logs for database recovery and cluster replication. Learn how to prune old Neo4j transaction logs safely.

Bottom Line: It is safe to prune old committed Neo4j transaction logs using Neo4j’s configuration retention settings or the dbms.checkpoint() procedure.


Why Do Neo4j Transaction Logs Exist?

Neo4j graph database writes write-ahead transaction logs (neostore.transaction.db.0, neostore.transaction.db.1) inside data/databases/neo4j/transactions/.

  • Primary Purpose: Transaction recovery, ACID compliance, and cluster synchronization across Causal Clustering nodes.
  • Storage Growth: High-volume graph updates (node insertions, relationship updates) generate gigabytes of log files.
  • Storage Impact: Retaining default transaction logs consumes 5 GB to 50 GB+.

What Happens If You Prune Old Neo4j Transaction Logs?

  • System Safety: āœ… Safe to Prune. Old logs that have already been checkpointed to main store files are no longer needed for crash recovery.
  • Automatic Retention: Configuring dbms.tx_log.rotation.retention_policy keeps transaction logs bounded automatically.
  • Reclaimed Storage: Pruning old logs frees 5 GB to 50 GB+ of disk space.

How to Prune Neo4j Transaction Logs Safely

Method 1: Configure Retention Policy in neo4j.conf

Edit conf/neo4j.conf to prune logs older than 2 days or 10 GB:

# Retain logs for 2 days maximum
dbms.tx_log.rotation.retention_policy=2 days

# Or retain a maximum size of 10 GB
# dbms.tx_log.rotation.retention_policy=10 GB

Method 2: Trigger Checkpoint via Cypher Shell

CALL dbms.checkpoint();

Frequently Asked Questions (FAQ)

Can I manually delete active neostore.transaction.db files while Neo4j is running?

No. Deleting active transaction log files while the Neo4j service is running causes database store corruption and transaction failure.

Discussion

Loading authentication...

Related in developer

The AI Engineer's Model Disk Cleanup Guide: Hugging Face, Ollama & PyTorch

The ultimate 1,200-word field guide for AI developers and local LLM hobbyists to reclaim 200GB+ from Ollama, Hugging Face, PyTorch, and vLLM model weights.

Safe to Delete

Android Studio System Index Cache (AndroidStudio Cache)

Android Studio caches Gradle project indexes, VFS caches, and compiler artifacts. Invalidate and clear is safe.

Safe to Delete

Ansible Automation Temp & Fact Cache (~/.ansible/tmp)

Ansible stores temporary playbook execution modules and target host fact JSON caches in ~/.ansible/tmp. Clearing Ansible tmp is safe.

Safe to Delete
Back to all files