Re: [Neo4j] how to set up the graphDB location at the server startup without changing conf file ?

397 views
Skip to first unread message

Peter Neubauer

unread,
Jun 18, 2012, 11:42:56 AM6/18/12
to ne...@googlegroups.com
Karim,
we just introduced a new, better Config infrastructure, letting you
override any configuration with environment variables, see
https://github.com/neo4j/community/blob/master/kernel/src/test/java/org/neo4j/kernel/configuration/SystemPropertiesConfigurationTest.java
. This has just been expanded to the whole server, and we are in the
process of getting it over to the main repo.

Rickard Öberg is working on that, not sure how much is left there
until a pull request but I suspect soon :)

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

If you can write, you can code - @coderdojomalmo
If you can sketch, you can use a graph database - @neo4j


On Mon, Jun 18, 2012 at 5:19 PM, karim duran <karim...@gmail.com> wrote:
> Is there any way to set up the graphdatabase location at the server startup
> like this :
> $NEO4J_HOME/neo4j-community-1.7.1/bin$ ./neo4j start DB=/home/karim/cms.
> I mean, without changing org.neo4j.server.database.location in the conf.
> Thanks.

André Szelp

unread,
May 27, 2013, 2:29:08 PM5/27/13
to ne...@googlegroups.com
Is there an update on this? Does specifying db location via environment variables work now?
If yes, both 1.8 and 1.9?

Peter Neubauer

unread,
May 30, 2013, 5:02:11 AM5/30/13
to Neo4j User
Andre,
I don't think it is working yet. A simple workaround would be to write your own shell script that changes this setting in the neo4j-server.config before starting the server?

/peter


Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

On Mon, May 27, 2013 at 8:29 PM, André Szelp <a.sz....@gmail.com> wrote:
Is there an update on this? Does specifying db location via environment variables work now?
If yes, both 1.8 and 1.9?

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

bendaizer

unread,
May 30, 2013, 11:24:04 AM5/30/13
to ne...@googlegroups.com
For what it's worth, I use the following command to switch quickly between databases

    sed -i "s%^org.neo4j.server.database.location.*%org.neo4j.server.database.location=$NEW_DB%" $NEO/conf/neo4j-server.properties

if you're on a mac or bsd you might need to add  ' ' just after -i

Peter Neubauer

unread,
May 31, 2013, 5:22:08 AM5/31/13
to Neo4j User
Good call Amine,

exactly what I was thinking!

/peter


Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Neo4j 1.9 GA is out - http://blog.neo4j.org/2013/05/neo4j-19-general-availability.html
Neo4j questions? Please use SO - http://stackoverflow.com/search?q=neo4j


Eric Pederson

unread,
Feb 26, 2015, 5:42:54 PM2/26/15
to ne...@googlegroups.com
I found this old thread that corresponds to my situation.

In 2.1.5 and 2.1.6 I found a workaround, you could set the following in the property file

   org.neo4j.server.database.location=${sys:database.location}

and then set -Ddatabase.location=/foo/bar/graph.db in the startup script.

This stopped working in 2.2.0-M04.  Is there a new workaround?   Editing the config file (which is stored in version control) per developer is a huge headache.

Thanks,
Reply all
Reply to author
Forward
0 new messages