How do you perform a dump of a Neo4j database within a Docker container?

1: Stop the container.

docker stop myname-neo4j

2: Remove the container

docker rm myname-neo4j

3: Run the container as interactive mode (-it) without the option (detach) and executing the shell ( /bin/bash ).

docker run \
--publish=7474:7474 \
--publish=7473:7473 \
--publish=7687:7687 \
--volume=$HOME/neo4j/data:/data \
--volume=$HOME/neo4j/logs:/logs \
--volume=$HOME/neo4j/ssl:/ssl \
--ulimit=nofile=40000:40000 \
--name=myname-neo4j \
-it \
neo4j:3.1.1 \
-c /bin/bash

Now you are inside the neo4j container without running Neo.

4: Check that neo is not up by visiting the URI endpoint in (http://yourhost:7474). You should see the "Unable to connect" message.

5: Dump your database

docker exec -ti myname-neo4j bin/neo4j-admin dump --database=graph.db --to=/home/name/myname.dump

Tags:

Docker

Neo4J