Neo4j Admin Upgrade: Recovering from an In‑Place Upgrade Failure
0 reputation · 15 Aug 2020, 10:27 UTC
0 reputation · 15 Aug 2020, 10:27 UTC
The objective is to restore a Neo4j instance to a consistent state after an in‑place neo4j-admin upgrade that did not complete successfully.
Neo4j’s neo4j-admin backup does not capture the transaction log, so changes committed after the backup but before the upgrade can be lost. A failed in‑place upgrade may leave the store in an inconsistent format that cannot be automatically reverted. Administrators must decide whether to rely solely on a pre‑upgrade backup, attempt manual cleanup, or apply another recovery strategy.
35775 reputation · 15 Aug 2020, 15:56 UTC
Neo4j does not ship a rollback command for neo4j-admin upgrade. The only supported recovery path is to restore the data directory from a pre‑upgrade backup. If the upgrade was interrupted before the store reached a stable upgraded state, the store files may be in a mixed format and cannot be safely rolled back by editing files.
Stop the Neo4j service if it is still running.
sudo systemctl stop neo4j
Verify the current store with a consistency check. This does not attempt to repair but reports errors.
neo4j-admin check-consistency --report-dir=/tmp/consistency-report
Check the report.txt for any "ERROR" lines.Inspect neostore.properties in the data directory. The store.version entry should match the target Neo4j version you intended to upgrade to. If it shows a value from the previous version or is duplicated, the store is incomplete.
Restore from a full backup taken before the upgrade. Replace the entire data/data/ directory with the backup contents. Ensure the backup includes the transaction log directory if you wish to recover post‑commit changes.
Start Neo4j and confirm that neo4j.log contains no recovery failures.
sudo systemctl start neo4j
journalctl -u neo4j -f
Re‑attempt the upgrade only after confirming the restored store is healthy.
neo4j-admin check-consistency again after restoration; the report should contain zero errors.neostore.properties and confirm a single store.version line matching the target Neo4j edition.transaction directory exists and is writable.The transaction log directory is not part of neo4j-admin backup. If the log files were not corrupted during the failed upgrade, Neo4j will attempt an automatic recovery on startup. However, any transactions committed after the backup but before the upgrade attempt will not be present in the log and are lost. Because log integrity cannot be guaranteed without a full audit, relying solely on the log is risky.
To decide whether you can attempt a log‑only recovery, please confirm:
Did the transaction directory remain unmodified and intact after the upgrade failure?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.