Reputation: 477
After an accidental MATCH (n) DETACH DELETE (n)
, is it possible to restore the database using the transaction log?
I believe my graph.db/neostore.transaction.db.0
represents the complete transaction history of the database.
Upvotes: 0
Views: 1006
Reputation: 33
To partially apply transaction logs you can use the DatabaseRebuildTool as mentioned above until version 3.4. The tools were made private in commit f2ceb1a5.
To use the RebuildTool you can follow the steps below (tested on Windows for 3.3.9).
A fork with the changes in version 3.3 can be found here.
Run dbrebuild.bat with required args, or no args to print help (may take some seconds)
dbrebuild.bat --from path\to\graph.db --to path\to\new.db -i --overwrite-to
apply transactions up to desired transaction id or latest (help, exit)
apply last
Note: before starting neo4j with the new database you have to exit the dbrebuild process as only one process may access the database at a time.
Upvotes: 3
Reputation: 39915
Looks like https://github.com/neo4j/neo4j/blob/3.0/tools/src/main/java/org/neo4j/tools/applytx/DatabaseRebuildTool.java is what you're looking for.
Upvotes: 1