This document provides a comprehensive reference for the Neo4jRestore Custom Resource Definition (CRD). This resource is used to restore Neo4j Enterprise databases from backups, including support for point-in-time recovery (PITR) and both cluster and standalone deployments.
When a Neo4jRestore resource is created, the operator:
Resolves the clusterRef — it accepts both Neo4jEnterpriseCluster and Neo4jEnterpriseStandalone. The controller detects the type automatically.
Creates a restore Kubernetes Job that runs neo4j-admin database restore inside a container using the same Neo4j enterprise image as the target.
If stopCluster: true, the operator scales down the cluster StatefulSet before starting the restore Job. When this flag is set, the operator mounts the actual server data PVC (data-{cluster}-server-0) directly into the restore Job container for offline restore access.
After the restore Job succeeds, the operator automatically issues one of the following Cypher commands via the Bolt client:
CREATE DATABASE <dbname> — when the database did not exist before
START DATABASE <dbname> — when the database existed but was stopped for the restore
Status fields and conditions are updated throughout the lifecycle.
Pass --overwrite-destination to allow restoring over an existing database (default: false)
stopCluster
bool
❌
Scale down the target cluster before restore for an offline/cold restore (default: false). When true, mounts data-{cluster}-server-0 PVC into the restore Job.
timeout
string
❌
Timeout for the restore Job (e.g., "2h", "30m")
Target compatibility: clusterRef can reference either:
- Neo4jEnterpriseCluster — for HA cluster restore operations
- Neo4jEnterpriseStandalone — for single-node restore operations
Restore from a Neo4jBackup CR referenced by backupRef
"storage"
Restore from an explicit storage location in storage
"pitr"
Point-in-time recovery using transaction log replay
"s3"
Shorthand for storage with AWS S3 backend
"gcs"
Shorthand for storage with Google Cloud Storage backend
"azure"
Shorthand for storage with Azure Blob Storage backend
Examples:
# Restore from a Neo4jBackup resourcesource:type:backupbackupRef:daily-production-backup# Restore from an explicit S3 pathsource:type:storagestorage:type:s3bucket:neo4j-backupspath:production/cloud:provider:awscredentialsSecretRef:aws-restore-credentialsbackupPath:/backups/production/backup-20250120-020000# Shorthand S3 restoresource:type:s3storage:type:s3bucket:neo4j-backupspath:production/cloud:provider:awscredentialsSecretRef:aws-restore-credentialsbackupPath:/backups/production/backup-20250120-020000# Point-in-time recoverysource:type:pitrpointInTime:"2025-01-04T12:30:00Z"pitr:baseBackup:type:backupbackupRef:daily-backuplogStorage:type:s3bucket:neo4j-transaction-logspath:production/logs/cloud:provider:awslogRetention:"168h"validateLogIntegrity:true
After the restore Job completes successfully, the operator automatically issues a Cypher command to make the database available:
New database (did not exist before): CREATE DATABASE <dbname>
Existing database (was stopped for restore): START DATABASE <dbname>
This means the restore workflow is fully automated — you do not need to manually start the database after restore completes. The status.phase transitions to Completed only after the database bring-up command succeeds.
The operator scales the target StatefulSet down to 0 replicas.
The restore Job is created with the actual server data PVC (data-{cluster}-server-0) mounted into the container, enabling direct offline file-level restore.
After the restore Job succeeds, the StatefulSet is scaled back up.
The operator then issues CREATE DATABASE or START DATABASE as described above.
Use stopCluster: true when:
- The database is too large for an online restore
- You need to restore at the storage level rather than via neo4j-admin
- The cluster is in an inconsistent state that prevents online operations
apiVersion:neo4j.neo4j.com/v1beta1kind:Neo4jRestoremetadata:name:simple-backup-restorenamespace:neo4jspec:clusterRef:test-cluster# Neo4jEnterpriseCluster or Neo4jEnterpriseStandalonedatabaseName:testdbsource:type:backupbackupRef:daily-test-backup# References a Neo4jBackup resourceoptions:verifyBackup:truereplaceExisting:trueforce:falsestopCluster:falsetimeout:"1h"
clusterRef can reference a Neo4jEnterpriseStandalone resource. The controller detects the type automatically.
apiVersion:neo4j.neo4j.com/v1beta1kind:Neo4jRestoremetadata:name:standalone-restorenamespace:developmentspec:clusterRef:dev-standalone# Neo4jEnterpriseStandalonedatabaseName:app-dbsource:type:backupbackupRef:dev-daily-backupoptions:replaceExisting:trueverifyBackup:falseforce:truestopCluster:false# Standalone does not require scaling downtimeout:"30m"