+1 vote
in Databases by (59.8k points)

I am using the APOC library of Neo4j to export the results of a Cypher query to a CSV file. However, I get the following error message:

Failed to invoke procedure `apoc.export.csv.query`: Caused by: java.lang.RuntimeException: Export to files not enabled, please set apoc.export.file.enabled=true in your apoc.conf.

Otherwise, if you are running in a cloud environment without filesystem access, use the `{stream:true}` config and null as a 'file' parameter to stream the export back to your client.

There is no apoc.conf file, so I added "apoc.export.file.enabled=true" to neo4j.conf file, but Neo4j failed to restart after adding "apoc.export.file.enabled=true". How can I fix this error?

1 Answer

+1 vote
by (353k points)
selected by
 
Best answer

You need to create an "apoc.conf" file in the same folder as your "neo4j.conf" file. The "neo4j.conf" file should be present in the "conf" folder of the graph you are running. 

To locate the "conf" folder, 

  • click on "..." near the start/stop button of your graph on Neo4j Desktop.
  • on the pop-up menu, click on "Terminal" to open the terminal.
  • on the terminal, run "ls -l" and it will show you the "conf" folder.
  • run "cd conf" to go to the "conf" folder.
Once inside the "conf" folder, create a new file "apoc.conf" and add line "apoc.export.file.enabled=true".
Now restart Neo4j, and you should not get the error.

Related questions

+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
asked Jul 13, 2023 in Databases by phpuser (59.8k points)

...