# How to backup a db running in kubernetes

**URL:** <https://community.neo4j.com/t/how-to-backup-a-db-running-in-kubernetes/16724>\
**Category:** Import / Export\
**Tags:** kubernetes, load\
**Created:** [April 6, 2020, 2:05pm UTC](https://community.neo4j.com/t/how-to-backup-a-db-running-in-kubernetes/16724 "2020-04-06T14:05:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ticapix](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ticapix/32/10366_2.png) [@ticapix](https://community.neo4j.com/u/ticapix)\
**Post date:** [April 6, 2020, 2:05pm UTC](https://community.neo4j.com/t/how-to-backup-a-db-running-in-kubernetes/16724/1 "2020-04-06T14:05:58Z")

</div>

Hello

I've read the [How to backup Neo4j Running in Kubernetes](https://medium.com/neo4j/how-to-backup-neo4j-running-in-kubernetes-3697761f229a) it seems that either the tool has change since the redaction of the article or that I'm not using the correct version of neo4j.

I've deployed neo4j with helm3 in a k8s 1.17 cluster (hosted by [ovh.com](http://ovh.com))

```auto
helm install --namespace neo4j db stable/neo4j --set imageTag=4.0.3

```

I would like to do a DB backup and restore but I'm facing two issues:

1. the [doc](https://neo4j.com/docs/operations-manual/current/tools/dump-load/) says the database must be stopped
2. all code I see refers to `neo4j-admin backup` but I only see `neo4j-admin dump` with no parameter to specify host/user/password when running the image with  
`kubectl run -it --rm neo4j-admin --image=neo4j:4.0.3 --restart=Never --namespace neo4j --command -- bash`

Any ideas how to dump/load or backup/restore a neo4j community db running in a kubernetes cluster ?

best regards,

---

<div class="post-metadata">

**Author:** ![david\_allen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/david_allen/32/13090_2.png) [@david\_allen](https://community.neo4j.com/u/david_allen)\
**Post date:** [April 6, 2020, 2:44pm UTC](https://community.neo4j.com/t/how-to-backup-a-db-running-in-kubernetes/16724/2 "2020-04-06T14:44:13Z")

</div>

There is a difference between dump/load and backup/restore. The dump/load commands are strictly offline operations, while backup/restore are online operations.

To do this with kubernetes, you should use the online option of backup/restore, and the articles you're following are the right ones to go to.

The existing operations manual documentation for Neo4j is rather focused on running in the context of an actual machine or VM rather than running in kubernetes, where special considerations apply.

---

<div class="post-metadata">

**Author:** ![ticapix](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ticapix/32/10366_2.png) [@ticapix](https://community.neo4j.com/u/ticapix)\
**Post date:** [April 6, 2020, 3:34pm UTC](https://community.neo4j.com/t/how-to-backup-a-db-running-in-kubernetes/16724/3 "2020-04-06T15:34:56Z")

</div>

Thank you for the semantic clarification. Indeed backup/restore is what I'm after.  
When we read the [code](https://github.com/neo-technology/neo4j-google-k8s-marketplace/blob/master/backup/backup.sh#L41) associated with the post, the `neo4j-admin backup` command is used.

But using the latest `neo4j-4.0.3` docker image, I don't see the `backup` option.

Is that a difference because of the version `3.4` vs `4.0` or because your code uses the enterprise version and I'm using the community one ?

```plaintext
$ kubectl run -it --rm neo4j-utils
--image=neo4j:4.0.3 --restart=Never --namespace neo4j --command -- bash
If you don't see a command prompt, try pressing enter.
root@neo4j-utils:/var/lib/neo4j# ./bin/neo4j-admin -V
4.0.3
root@neo4j-utils:/var/lib/neo4j# ./bin/neo4j-admin
Usage: neo4j-admin [-hV] [COMMAND]
Neo4j database administration tool.
  -h, --help Show this help message and exit.
  -V, --version Print version information and exit.
Commands:
  help Displays help information about the specified command
  memrec Print Neo4j heap and pagecache memory settings recommendations.
  dump Dump a database into a single-file archive.
  store-info Print information about a Neo4j database store.
  report Produces a zip/tar of the most common information needed for remote assessments.
  load Load a database from an archive created with the dump command.
  check-consistency Check the consistency of a database.
  import Import a collection of CSV files.
  set-default-admin Sets the default admin user.
                        This user will be granted the admin role on startup if the system has no roles.
  set-initial-password Sets the initial password of the initial admin user ('neo4j'). And removes the requirement to
                          change password on first login.
root@neo4j-utils:/var/lib/neo4j#

```

---

<div class="post-metadata">

**Author:** ![ticapix](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ticapix/32/10366_2.png) [@ticapix](https://community.neo4j.com/u/ticapix)\
**Post date:** [April 8, 2020, 12:31pm UTC](https://community.neo4j.com/t/how-to-backup-a-db-running-in-kubernetes/16724/4 "2020-04-08T12:31:14Z")

</div>

The backup/restore is only available in the enterprise edition.

---

<div class="post-metadata">

**Author:** ![david\_allen](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/david_allen/32/13090_2.png) [@david\_allen](https://community.neo4j.com/u/david_allen)\
**Post date:** [April 10, 2020, 8:37pm UTC](https://community.neo4j.com/t/how-to-backup-a-db-running-in-kubernetes/16724/5 "2020-04-10T20:37:38Z")

</div>

It's true that backup/restore is an enterprise feature. Additionally, there are big differences between 3.5 and 4.0 that bear on the configuration
