-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrestore-from-backup.yaml
More file actions
68 lines (67 loc) · 1.68 KB
/
restore-from-backup.yaml
File metadata and controls
68 lines (67 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
apiVersion: neo4j.neo4j.com/v1alpha1
kind: Neo4jRestore
metadata:
name: simple-restore
labels:
environment: development
restore-type: backup-reference
spec:
targetCluster: single-node-cluster
databaseName: neo4j
source:
type: backup
backupRef: simple-backup # Reference to the backup resource
options:
verifyBackup: true
replaceExisting: true
preRestore:
cypherStatements:
- "CALL dbms.backup.prepare()"
postRestore:
cypherStatements:
- "CALL db.awaitIndexes()"
- "CALL dbms.security.clearAuthCache()"
force: false
stopCluster: true
timeout: "1h"
---
# More complex restore with job hooks
apiVersion: neo4j.neo4j.com/v1alpha1
kind: Neo4jRestore
metadata:
name: restore-with-validation
labels:
environment: staging
restore-type: with-hooks
spec:
targetCluster: staging-cluster
databaseName: myapp
source:
type: backup
backupRef: daily-backup
options:
verifyBackup: true
replaceExisting: true
postRestore:
job:
template:
container:
image: neo4j:5.26.0-enterprise
command: ["/bin/sh"]
args:
- "-c"
- |
echo "Validating restored database..."
cypher-shell -u neo4j -p $NEO4J_PASSWORD -d myapp \
"MATCH (n) RETURN count(n) as nodeCount"
echo "Database validation completed"
env:
- name: NEO4J_PASSWORD
valueFrom:
secretKeyRef:
name: neo4j-admin-secret
key: password
timeout: "10m"
force: false
stopCluster: true
timeout: "2h"