Enterprise Java

How to restore a Neo4J backup on managed Kubernetes

In the following video I’ll explain how to restore backups of Neo4J instances to a fresh instance that runs in a managed Kubernetes environment. The backup contents will be taken from a persistent volume to which we previously wrote the backup.

In this previous post you can see how to take backups in the first place.

Try it yourself

Again, you’ll find the Kubernetes resources in the following GitHub repository.

1
2
3
cd /tmp/
git clone https://github.com/sdaschner/neo4j-tools
cd neo4j-tools/

We need to ensure that we have the backupdir- and datadir- persistent volumes available. You can have a look at the previous posts and the video on how we got there. The data directory only contains an empty database which we will restore from the backup.

The following pod will bind both volumes, restore the backup and write the result to the data directory which afterwards can be used again in our Neo4J instance:

1
2
3
4
kubectl apply -f backup/neo4j-restore-backup.yaml
 
NAME                               READY   STATUS      RESTARTS   AGE
neo4j-restore-backup               0/1     Completed   0          13s

If we now start our Neo4J instance again, for example the single core instances, we will see that the database contents have been restored.

Published on Java Code Geeks with permission by Sebastian Daschner, partner at our JCG program. See the original article here: How to restore a Neo4J backup on managed Kubernetes (Video)

Opinions expressed by Java Code Geeks contributors are their own.

Sebastian Daschner

Sebastian Daschner is a self-employed Java consultant and trainer. He is the author of the book 'Architecting Modern Java EE Applications'. Sebastian is a Java Champion, Oracle Developer Champion and JavaOne Rockstar.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to top button