Neo4j 5 Online Backup Restore: Is Point-in-Time Recovery Safe Across Major Versions?
0 reputation · 06 Jul 2023, 09:33 UTC
0 reputation · 06 Jul 2023, 09:33 UTC
I need to restore an online backup taken with neo4j-admin backup into a Neo4j 5.x instance, and the backup was created on an earlier major version. The goal is a point-in-time recovery that preserves node and relationship counts, indexes, and any stored procedures or user-defined functions, without a separate manual data migration step.
Backup store files are binary-specific to the Neo4j version that created them, and WAL replay up to the backup timestamp may fail or corrupt the store when the target runs a different major version. Official guidance also notes that deprecated index types can lose compatibility after a cross-version restore, and UDFs compiled for the earlier version may fail until recompiled. It is unclear whether PITR is supported at all across a major version boundary, or whether a dump/load migration is mandatory instead.
Assume Neo4j 5.x as the target and a 4.4+ source with incremental online backups; verification would use neo4j-admin check-consistency and count comparisons against a pre-backup export.
neo4j-admin database dump/load the only supported cross-major-version path?check-consistency confirm indexes and UDFs are fully functional?32275 reputation · 06 Jul 2023, 19:38 UTC
No. An online backup created with neo4j-admin backup on Neo4j 4.x cannot be restored directly into a Neo4j 5.x instance for point-in-time recovery. The supported cross-major-version path is neo4j-admin database dump / neo4j-admin database load, not an online backup restore. Re-indexing is required after any cross-version migration, and UDFs must be recompiled for the target runtime.
Confirmed behavior for Neo4j 5.x target, 4.4+ source: The store format and backup metadata are version-bound. neo4j-admin restore --from expects a backup from the same major version. Cross-major restores are unsupported and will fail or risk corruption.
Likely explanation, marked for review: Binary store changes between 4.x and 5.x make WAL replay unsafe across the boundary. Deprecated index providers from 4.x lose compatibility in 5.x. Java UDFs compiled against the 4.x API will fail to load on 5.x until rebuilt. These points are consistent with documented version compatibility, but current verification is recommended for your exact 5.x minor.
neo4j-admin restore from the 4.x online backup into Neo4j 5.x.neo4j-admin database dump neo4j --to=/path/backup.dumpon the 4.x source, then on Neo4j 5.x:neo4j-admin database load neo4j --from=/path/backup.dump --database=neo4jBeyond neo4j-admin check-consistency --database=neo4j, verify functional correctness:
SHOW INDEXES YIELD name, state, type WHERE state <> 'ONLINE' and sample queries that use the indexes.CALL dbms.procedures() YIELD name and execute representative calls.Confirm the exact source minor version and index provider in use. If the source is 4.4.x with native indexes only, dump/load remains the required path. If legacy Lucene indexes are present, additional index recreation steps are needed before verification.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.