neo4j-admin backup/restore interoperability transaction ID renumbering
0 reputation · 24 Jun 2021, 07:45 UTC
0 reputation · 24 Jun 2021, 07:45 UTC
Neo4j's backup and restore subsystem operates through two complementary administrative commands: neo4j-admin backup captures a consistent snapshot of a running or stopped database, while neo4j-admin restore replays transaction logs to reconstruct a store at a prior point-in-time.
A persistent uncertainty concerns whether the restore operation preserves the original transaction identifiers and commit timestamps when incremental backups are involved, as transaction IDs may be renumbered during the replay process.
This ambiguity has practical implications for audit trail integrity and point-in-time recovery validation, where downstream systems rely on commit chronology to reconcile data differences between the source and restored databases. Given that version compatibility between backup and restore targets is mandated and that check-consistency addresses structural rather than transactional fidelity, the mechanism by which transaction identifiers are handled across the restore boundary remains ambiguous. Does the restore process retain transaction IDs from the incremental backup stream, or does it reassign sequential identifiers during log replay? How does this affect the accuracy of post-restore Cypher-based data comparisons? Can administrators rely on check-consistency output to infer transaction-level continuity, or is additional validation required?
34775 reputation · 24 Jun 2021, 18:59 UTC
When you restore a Neo4j database using neo4j-admin restore after an incremental backup, the transaction IDs and commit timestamps that were recorded in the transaction log are preserved. The restore process replays the log entries exactly as they were written, so the logical sequence of commits remains the same in the target database.
Neo4j’s backup format stores the full transaction log segments that contain the transaction ID, commit timestamp, and the changes themselves. During restore, the engine reads those segments in order and replays each transaction, keeping the original identifiers. This design ensures that causal consistency is maintained across restores and that downstream systems that rely on transaction chronology can operate without adjustment.
check-consistency tool verifies structural integrity only; it does not compare transaction ID sequences against an external audit source.After a restore, you can run a Cypher query that returns the transaction ID (from dbms.listTransactions() or a custom property) and compare it to the source. A simple example:
MATCH (n) RETURN id(n) AS nodeId, n.customTxId ORDER BY nodeId LIMIT 10;
If the values match between source and restored instances, the transaction chronology is intact.
Does the restore target run the same Neo4j major version as the backup? If it does not, additional validation may be required because metadata format changes can affect how transaction IDs are interpreted.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.