40

Hi I created a neo4j database with custom java application and tried to change path in configuration file in order to connect to created database.

While trying to check the data in webadmin console only node 0 is visible (seems that the database is empty). I tried to import the same database to Gephi and it's not empty.

Furthermore when I tried to switch back to the original database, which also wasn't empty, in webadmin only node 0 appeared.

I tried to modify the neo4j-server.propertied file the following way:

#*****************************************************************
# Administration client configuration
#*****************************************************************

# location of the servers round-robin database directory. possible values:
# - absolute path like /var/rrd
# - path relative to the server working directory like data/rrd
# - commented out, will default to the database data directory.
org.neo4j.server.webadmin.rrdb.location=data/rrd

# REST endpoint for the data API
# Note the / in the end is mandatory
#org.neo4j.server.webadmin.data.uri=/db/data/ #original database
org.neo4j.server.webadmin.data.uri="/db/mydatabase" #my database

# REST endpoint of the administration API (used by Webadmin)
org.neo4j.server.webadmin.management.uri=/db/manage/

# Low-level graph engine tuning file
org.neo4j.server.db.tuning.properties=conf/neo4j.properties

After switching back to the original database (commenting the new path and uncommenting the old)

org.neo4j.server.webadmin.data.uri=/db/data/ #original database
#org.neo4j.server.webadmin.data.uri="/db/mydatabase" #my database

the old one seemed to be empty as well.

Does anyone know how and where to set the path in order to see the appropriate database in the webadmin console and to be able to execute queries on the desired database?

Thank you!

Dzamo Norton
  • 1,194
  • 11
  • 17
Niko Gamulin
  • 66,025
  • 95
  • 221
  • 286

4 Answers4

32

You first need confirm that the database you are connecting to was properly shut down (means you should not take the image of a running database).

Set the location of the database if you are in server mode from the file

conf/neo4j-server.properties

by editing the below line.

org.neo4j.server.database.location=data/graph.db

if you are using embedded neo4j you can set the location of your db while instantaniating the GraphDatabaseService as under:

new EmbeddedGraphDatabase("Path To Db Directory");
j0k
  • 22,600
  • 28
  • 79
  • 90
Amit Lamba
  • 336
  • 3
  • 10
  • 2
    i have used "neo4j-community-3.0.1" but there is no conf/neo4j-server.properties such file . And there is file name with neo4j.conf but in this file no such properties org.neo4j.server.database.location=data/graph.db . Can you help me how can i switch database . – Anuj Dhiman May 28 '16 at 05:40
  • 2
    @anujdhiman refer https://github.com/neo4j/neo4j/wiki/Neo4j-3.0-changelog configuration the setting org.neo4j.server.database.location has been removed a new setting dbms.active_database is used to specify the database to mount by name a new setting dbms.directories.data is used to configure the path of the data directory – Swapnil Sawant Jun 03 '16 at 10:33
4

You need to set the location on disk of the database directory like this:

org.neo4j.server.database.location=data/graph.db

See http://docs.neo4j.org/chunked/stable/server-configuration.html

espeed
  • 4,754
  • 2
  • 39
  • 51
  • 1
    Have tried to set the location like this but the desired database wan't visible neither from Java app nor webadmin console. – Niko Gamulin Jun 05 '12 at 08:30
  • 1
    @espeed i have used "neo4j-community-3.0.1" but there is no conf/neo4j-server.properties such file . And there is file name with neo4j.conf but in this file no such properties org.neo4j.server.database.location=data/graph.db . Can you help me how can i switch database . – Anuj Dhiman May 28 '16 at 05:40
3

For anyone else struggling to find this file - on my Ubuntu I found it under /etc/neo4j/neo4j.conf

Antony
  • 3,875
  • 30
  • 32
2

I had done this by editing line

# dbms.active_database=graph.db

to

dbms.active_database=new.db

in file conf/neo4j.conf

Yuriy Petrovskiy
  • 7,888
  • 10
  • 30
  • 34