Chapter 16 · Backup, Restore, Transaction Logs, Disaster Recovery, and Upgrade Safety
Upgrade/Migration Planning, Store Compatibility, Rolling vs Offline Constraints, Plugins, and Rollback
Plan a Neo4j upgrade as a reversible migration project: inventory server/store/Cypher/Java/driver/APOC/GDS dependencies, validate store-format paths, and define rollback before changing production.
Learning outcomes
Inventory every compatibility surface before changing Neo4j server binaries.
Distinguish server upgrade from store-format migration and automatic minor format evolution.
Explain Community aligned vs Enterprise block defaults and legacy standard/high_limit deprecation.
Build pre/post-upgrade Cypher, plan, driver and plugin acceptance tests.
Define rollback as restore into a compatible stack rather than reinstalling an old binary over an upgraded store.
Reproducible AtlasMart setup
The continuity lab remains
Neo4j Community 2026.07.1, database
neo4j, explicit CYPHER 25 where
language behavior matters, container
atlasmart-neo4j, loopback Bolt
bolt://127.0.0.1:7687, synthetic credential
neo4j / atlasmart-course-2026, Java 21 or 25,
Python driver 6.3, and named volume
atlasmart-neo4j-data. Current 5.26 LTS is
5.26.30. APOC Core 2026.07.1 and GDS 2026.07.0 are
compatibility references only; neither is mandatory for this
chapter's Community drill.
Community provides offline
neo4j-admin database dump, load, and
consistency checking. Enterprise adds online full/differential
backup chains, backup metadata/aggregation, TLS-capable backup
service, and transaction-log replay during restore. The
self-managed neo4j-admin database backup command
is not an Aura workflow; Aura uses managed backup/recovery
features whose retention and restore controls depend on the
service tier. Do not claim that a replica, cluster member,
filesystem snapshot, or Aura copy is automatically equivalent
to a validated backup.
Every destructive command in this chapter targets disposable course containers/volumes or a new isolated restore volume. Never overwrite the only known-good store during a drill. Capture a hash and inventory first, restore to a separate target, validate it, and only then decide whether promotion is safe.
The drill adds one tiny course-owned marker so recovery correctness has a deterministic invariant even if your earlier AtlasMart graph has grown. The marker is not a substitute for business reconciliation; it is a canary.
CYPHER 25
CREATE CONSTRAINT recovery_marker_id IF NOT EXISTS
FOR (m:RecoveryMarker) REQUIRE m.markerId IS UNIQUE;
MERGE (c:Customer {customerId:'C-1001'})
ON CREATE SET c.name = 'Mina Rahimi'
MERGE (m:RecoveryMarker {markerId:'DR-CH16-001'})
SET m.createdAt = datetime('2026-09-09T17:00:00Z'),
m.expectedState = 'before-dump',
m.exercise = 'chapter-16'
MERGE (c)-[:HAS_RECOVERY_MARKER]->(m);
MATCH (m:RecoveryMarker {markerId:'DR-CH16-001'})
RETURN m.markerId, m.expectedState;
| Assumption | Pinned value / rule |
|---|---|
| server | Neo4j Community 2026.07.1; 5.26.30 is the current LTS comparison line |
| Java | 21 or 25 for current 2026.07 server |
| database / volume | neo4j / atlasmart-neo4j-data |
| transport | loopback Bolt without TLS only for this disposable local lab |
| backup destination |
new host directory ./neo4j-dr/backups;
production must be off-host and access-controlled
|
| plugins | none required; if installed, inventory exact APOC/GDS versions before upgrade/restore |
| measurement | record real start/end timestamps and artifact hashes; no invented RPO/RTO numbers |
1. Upgrade is a dependency graph
AtlasMart does not run “Neo4j” in isolation. It runs a server version against a store format, JVM, Cypher language mode, drivers/Bolt, procedures/plugins, operating system, certificates, automation and application queries. Upgrade safety requires an inventory of all of them plus a validated rollback artifact.
| Surface | Chapter 16 baseline | Why it matters |
|---|---|---|
| server | 2026.07.1; 5.26.30 LTS comparison | supported upgrade path and fixes |
| Java | 21/25 for 2026.07 server | startup/support boundary |
| store | Community defaults aligned; Enterprise defaults block for modern new DBs | format compatibility/migration |
| Cypher | 25 current; Cypher 5 frozen compatibility line | syntax/semantics/plans |
| Python driver | 6.3; supports 4.4/5/2025/2026 servers | client compatibility/Bolt |
| APOC | 2026.07.1 if installed | year.month must match Neo4j 2026.07 |
| GDS | 2026.07.0 if installed | must match supported Neo4j line |
2. Store version and server version are not the same concept
A store format is the on-disk representation.
Current docs version formats independently from the calendar
server release. Minor format evolution can occur automatically
on startup; changing to a higher major format or another format
is an explicit
neo4j-admin database migrate operation.
SHOW DATABASES YIELD name, currentStatus, store
RETURN name, currentStatus, store;
Once a store has been migrated or automatically evolved in a way an older binary cannot open, replacing only the executable is not a rollback. Restore the validated pre-upgrade artifact into a server/store combination documented as compatible.
3. Current format choices and legacy deprecation
The current Community default is aligned.
Enterprise uses block as the modern default for new
databases. standard and
high_limit have been deprecated since 5.23. Current
documentation warns that the upcoming vNext LTS planned for
November 2026 is the last line to support legacy
high_limit operations, so format inventory must
happen before that window closes.
| Format | Current role | Upgrade decision |
|---|---|---|
| aligned | Community default; supported | verify entity limits and target server compatibility |
| block | modern Enterprise default with larger limits/performance target | Enterprise-specific migration/restore planning |
| standard | deprecated | plan migration; do not design new deployment around it |
| high_limit | deprecated; removal path announced | migrate to block before crossing the final supported window |
4. Pre-upgrade gate: capture evidence before changing anything
CYPHER 25
MATCH (m:RecoveryMarker {markerId:'DR-CH16-001'}) RETURN m.expectedState;
SHOW CONSTRAINTS;
SHOW INDEXES;
SHOW SETTINGS YIELD name, value
WHERE name IN ['db.tx_log.rotation.retention_policy']
RETURN name, value;
neo4j --version
java -version
python -c "import neo4j; print(neo4j.__version__)"
# If APOC is installed, record: RETURN apoc.version();
# If GDS is installed, record its reported version and compatibility matrix.
sha256sum ./neo4j-dr/backups/neo4j.dump
5. Migrate only when the target requires it
neo4j-admin database migrate is an offline
administrative operation and is not available as an Aura
workflow. It should follow an explicit compatibility plan and
backup validation. Do not run it merely because an option
exists.
# Inspect the exact target-version migration guide first.
# Stop the disposable target database before a real migration.
neo4j-admin database migrate neo4j
“Upgrade server, plugins, store format and application at once” removes causal evidence. Change one bounded dimension at a time when practical, run acceptance tests, and preserve the rollback point.
6. Plugin, driver and Cypher compatibility gate
APOC relies on internal Neo4j APIs, so its year/month must match the Neo4j release family. GDS publishes its own compatibility matrix. Drivers are more decoupled but still need supported server/Bolt combinations. Queries should be tested in the language mode you deploy: current development is Cypher 25, while Cypher 5 is frozen for compatibility.
| Check | Fail condition | Action |
|---|---|---|
| APOC | jar family mismatches server | replace with matching tested APOC before startup |
| GDS | version not in target compatibility matrix | upgrade GDS or defer server change |
| driver | outside supported server line / deprecated API use | upgrade client and run integration tests |
| Cypher | deprecated/changed behavior or plan regression | pin language mode during migration, rewrite and remeasure |
| custom extension | compiled against incompatible internal API | rebuild/test in staging or remove dependency |
7. Rolling vs offline is a topology/licensing question
A standalone Community DBMS cannot become highly available by performing “rolling restart” steps copied from a cluster guide. Cluster rolling procedures require Enterprise topology, quorum/capacity headroom and the exact upgrade guide for source/target versions. If your required migration/store change is offline, plan downtime or a controlled parallel migration instead of claiming zero downtime.
Aura upgrades are provider-managed. You still own
application/driver/query compatibility and recovery testing,
but you do not run self-managed
neo4j-admin database migrate/backup on the
managed service.
8. Rollback decision tree
| Observation | Decision |
|---|---|
| target fails before store mutation | stop, fix configuration/plugin, or revert binary if documented safe |
| store migrated/advanced and target fails | restore pre-upgrade artifact into the old compatible stack; do not assume old binary opens new store |
| queries correct but p99/plan regresses | compare representative plans/parameters; decide rollback vs forward fix from SLO |
| plugin unavailable on target | remove/replace dependency or postpone; do not grant unsafe workaround |
| data changed after cutover | define reconciliation/replay before rollback or you may lose accepted writes |
Check your understanding
- Is a server version identical to a store-format version?
- What is the current Community default format?
- What is the safe meaning of rollback after incompatible store migration?
- Can APOC compatibility be assumed across year/month releases?
- Why test representative query parameters after upgrade?
Review the answers
1. No. They are separate compatibility surfaces.
2. Aligned.
3. Restore the validated pre-upgrade artifact into a compatible prior stack.
4. No; APOC Core must match the Neo4j year/month release family.
5. Planner/runtime/statistics changes can affect sparse and dense cases differently even when results remain correct.
Production judgment
| Review area | Decision evidence |
|---|---|
| graph/workload fit | recovery scope includes every database and external dependency needed to make AtlasMart useful, not only graph files |
| correctness | restored node/relationship/business invariants and application smoke tests; a successful command exit is insufficient |
| RPO/RTO | measured from real cadence, last recoverable point, restore duration and operator/application recovery steps |
| transactions/concurrency | backup method preserves a consistent recoverable state; log retention covers required differential/PITR window |
| memory/CPU/disk/network | backup, restore and consistency-check resource use measured separately from normal workload |
| indexes/constraints | index/constraint state reconciled after restore; rebuild/population time included in RTO if applicable |
| driver/service | pool/retry/bookmark behavior revalidated after endpoint/version changes; ambiguous writes reconciled |
| security | backup files encrypted/protected by platform controls, least-privilege access, secret/certificate handling and deletion policy |
| observability | backup age, artifact chain, failures, restore drills, disk pressure and operator actions are monitored/audited |
| version/edition | server, store format, Java, Cypher, driver, APOC/GDS and Aura/self-managed boundaries captured before change |
| rollback | pre-upgrade artifact remains immutable and compatible with the rollback server; rollback trigger and owner are explicit |
| cost/governance | retention, egress/object-lock/license cost balanced against business RPO/RTO and compliance requirements |
Summary and next step
An upgrade is safe only when compatibility and rollback are proved before production change. Lesson 5 combines artifact recovery, timing, reconciliation, application smoke tests and operator evidence into one repeatable disaster-recovery drill.
Authoritative references
- Current Neo4j versions — Current server and 5.26 LTS release snapshot.
- Backup and restore — Edition-aware entry point for dump/load, online backup, restore and planning.
- Backup and restore planning — RPO/RTO, backup mode, storage location, cadence and retention planning.
- Back up an offline database — neo4j-admin database dump semantics and Community offline boundary.
- Restore a database dump — neo4j-admin database load semantics, overwrite rules and edition differences.
- Back up an online database — Enterprise full/differential backup artifacts and chain semantics.
- Restore a database backup — Enterprise recovery of backup chains and restore-until predicates.
- Check database consistency — neo4j-admin database check for stores, dumps and recovered full backups.
- Transaction logging — Transaction-log retention, checkpointing and pruning behavior.
- Store formats — Current aligned/block formats, limits and legacy-format deprecation.
- Migrate a database — neo4j-admin database migrate and store-format migration boundaries.
- System requirements — Supported Java/runtime and platform requirements for current Neo4j.
- APOC installation — APOC/server release compatibility and restart/deployment coupling.
- GDS compatibility — Graph Data Science and Neo4j version compatibility matrix.
- Python driver installation — Current 6.x driver/server compatibility baseline.