Neo4j docker importing existing databases

Hi there,

I'm trying to load an existing graph.db folder into a neo4j 3.5.6 docker image but it fails because of permission errors.

When I run the docker image without any data it works perfect and generates an empty database. However when I put the folder for graph.db into this folder it will complain about not being able to obtain store.lock. I also tried to import it after starting the empty database but this will crash the docker with the permission denied error.

I also tried to change ownership of the folder to neo4j user or system user but nothing so far works.

Here is my general code for it:

docker run --detach --name=neo4j-35-tmp --rm
--publish=7475:7474 --publish=7476:7473 --publish=7688:7687
--volume=$HOME/Documents/neo4j-multi-image/3.5/data:/data
--volume=$HOME/Documents/neo4j-multi-image/3.5/import:/import
--volume=$HOME/Documents/neo4j-multi-image/3.5/conf:/conf
--volume=$HOME/Documents/neo4j-multi-image/3.5/plugins:/plugins
--env NEO4J_AUTH=neo4j/Neo4ja
neo4j:3.5.6

rm -rf $HOME/Documents/neo4j-multi-image/3.5/data/databases/graph.db
mv -f graph.db $HOME/Documents/neo4j-multi-image/3.5/data/databases

Does anyone know what I'm doing wrong / how I can achieve this?

Kind regards,
Julian

One thing that jumps first to mind is the use of /import. You might want to go into the container and look at the ownership and permissions of that folder (and, really, all of the folders that you are linking to). Also, when I do this volume linking, I usually spell out that directory to be $HOME/graph_data/my_graph_data:/var/lib/neo4j/import.

So when you are in the container, you should make sure that /var/lib/neo4j/import has ownership of neo4j:neo4j and the files in that directory should have permissions 755. You also should confirm that the directory linking is correct (/var/lib/neo4j/import -> /import). You will also want to check this for /data.

Please let us know what you find!