我应该说neo4j-admin工具对我不起作用。
neo4j-admin dump --database=<database-name> --to=<database-address>
我每次都出错,那个数据库不存在。
那么还有其他方法可以导出我的Neo4j数据库吗?
C:\Users\Shafigh\.Neo4jDesktop\neo4jDatabases\database-2912eb35-11ba-4ae1-
b5b9-cb4b88a6f0a9\installation-3.4.7\bin> neo4j-admin dump --database=test_1
--to=C:/Users/Shafigh/Desktop/files
org.neo4j.commandline.admin.CommandFailed: database does not exist: test_1
at org.neo4j.commandline.dbms.DumpCommand.execute(DumpCommand.java:83)
at org.neo4j.commandline.admin.AdminTool.execute(AdminTool.java:127)
at org.neo4j.commandline.admin.AdminTool.main(AdminTool.java:51)
Caused by: java.lang.IllegalArgumentException: Directory
'C:\Users\Shafigh\.Neo4jDesktop\neo4jDatabases\database-2912eb35-11ba-4ae1-
b5b9-cb4b88a6f0a9\installation-3.4.7\data\databases\test_1' does not contain
a database
at
org.neo4j.kernel.impl.util.Validators.lambda$static$3(Validators.java:111)
at org.neo4j.commandline.dbms.DumpCommand.execute(DumpCommand.java:79)
... 2 more
command failed: database does not exist: test_1
答案 0 :(得分:1)
test_1
is just the name of your Neo4j Desktop "project". It is not the name of your "database".
Use this command line instead (which uses the default database name, which is what you are using):
neo4j-admin dump --database=graph.db --to=C:/Users/Shafigh/Desktop/files
[UPDATED with more details, from my comments]
Neo4j Desktop is an environment that allows you to have many projects, with each project having possibly multiple DBs and plugins with different versions. So, your "test_1" is just the name of your project. Within that project, each DB will have its own directory structure, and by default the directory in that structure that contains your DB is given the name "graph.db". You can change the name of that DB if you want by setting the dbms.active_database
property in that DB's neo4j.conf
file -- but that is rarely useful.