docker run -d -v /home/data:/data --name=neo neo4j
after I run a neo4j in docker,docker exec -it neo bash
./neo4j-admin dump --database=graph.db --to=/home/2018.dump
it will say neo4j is runningcommand failed: the database is in use -- stop Neo4j and try again
but ./neo4j stop
will get neo4j not running
what should i do?
If executing from the same terminal as the docker process, use Ctrl-C which will stop the neo4j docker container process.
Neo4j is a highly scalable, robust native graph database. docker pull neo4j.
I had the same issue before, so I wrote this workaround to dump neo4j data and pull it outside the container to the host machine.
docker rm --force neo4j-dump
docker run \
--name neo4j-dump \
--env-file /storage/bin/.neo4j.env \
--mount type=bind,source=<neo4j_data_folder>,target=/data \
neo4j bin/neo4j-admin dump --database=graph.db --to=/graph.db.dump
docker cp `docker ps -aqf "name=neo4j-dump"`:/graph.db.dump <target_dump_file>
docker rm --force neo4j-dump
This will create a new container and dump data instead of starting neo4j service, then copy the dump to the host, just update and to yours
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With