browsing distinct Neo4j databases in the same machine - neo4j

I am experimenting with several Neo4j databases in my machine. The databases have been generated and populated from Java programs.
Now I would like to inspect them.
It seems that the recommended way is to open the web console so it points to a specific database by means of configuring the property:
org.neo4j.server.database.location=<database location path>
in the neo4j configuration file: conf/neo4j-server.properties
This if fine if I am only interested in one database. But it does not look like a good idea if I am switching often between databases or if I want to explore more than one at the same time.
Is it possible to configure distinct web consoles (maybe using distinct ports) so they refer to my distinct databases?
And is it possible to do this without installing several instances (binaries) of Neo4j in my machine and having to modify lots of configuration files?

Yes! If you edit that same conf/neo4j-server.properties file you can change the org.neo4j.server.webserver.port and org.neo4j.server.webserver.https.port values (I normally set the https port to one less than the http port).
Once you've done that you run ./bin/neo4j start (make sure you shut down your Java app which is accessing the database first) to start the server on that port and then simply visit http://localhost:<port>
I'm not 100% sure if generating the database from Java will generate everything that you need for running a server. If not you can download Neo4j from http://neo4j.com/download/, make multiple copies of it, and replace the graph.db folder with yours one (make sure you shut down any processes which are accessing those databases before copying the directory). Also if you've downloaded a newer version you might need to set allow_store_upgrade=true (see: http://neo4j.com/docs/stable/deployment-upgrading.html)

You can have multiple Embedded Neo4j databases without installing separate binaries. You just need to be configure the different database path for each instance of the database.

Related

How do I edit neo4j.conf in an AuraDB instance?

I am trying to edit the settings of my AuraDB hosted neo4j instance, specifically, trying to set the following line:
apoc.import.file.enabled=true
I have looked at the official tutorial and many other places, and for the life of me, I am not able to find out where either the "settings" button is located, or how to locate the neo4j.conf or apoc.conf files. It seems that something has possibly changed in a newer version. I have tried both in the browser at https://console.neo4j.io/#databases and in Neo4J Desktop. For the desktop application, I am running it on Ubuntu via the .appimage. I created my database on the website and connected via remote connection following this guide.
Some things that might help me solve the issue:
Is it possible to open a shell in auradb to let me run normal bash commands?
Is the .conf accessible "within" the .appimage?
From the official description of File locations, I am supposedly able to do the following in Neo4j Desktop to find the configuration file:
From the Open dropdown menu of your Neo4j instance, select Terminal,
and navigate to /conf/neo4j.conf.
Yet, when I press the Open dropdown menu, I do not see a Terminal option. What I get is Neo4j Browser, Neo4j Bloom, and Neo4j ETL Tool.
Aura is a managed database - which is to say that you don't get low-level access to configuration of the kind you're describing. The documentation you're looking at relates to self-hosted instances of Neo4j, where you're the one managing and configuring the instance from scratch and where you have that level of access to the underlying configuration.
To the problem you're trying to solve, the following article entitled Loading data into Neo4j Aura is your best bet for the currently available options for loading data into your managed database.
Per the documentation, APOC is installed in Aura databases, but only a limited set of functions and procedures are enabled (as of May 2022). In particular, only a small subset of apoc.import procedures are available - from what I can see, CSV and GraphML support is enabled via apoc.load.csv and apoc.load.graphml, while you also have access to apoc.load.json and apoc.load.xml.
Lists of the currently supported procedures and functions are available at the foot of that document:
Neo4j Aura Supported APOC procedures (updated).json
Neo4j Aura Supported APOC functions (updated).json
From a Neo4j Aura Knowledge Article:
In Aura, we currently do not support changing any property that may
exist in the Neo4j product and defined in neo4j.conf.

Unable to switch neo4j database

I am new in neo4j and i am using "neo4j-community-3.0.1" . I want to switch database and retrieve nodes .After google i found how to switch database . But there is no file with name
conf/neo4j-server.properties
There are two files neo4j.conf and neo4j-wrapper.conf . But there is not any configuration such
org.neo4j.server.database.location=data/graph.db
Can any one help me how to switch database and i am able to see node using
browser
As of Neo4J 3.0, all the configuration files have been streamlined and unified into one file. Which is "neo4j.conf".
You need to change the DB path in this file.
If you are using Linux the file can be found at
/etc/neo4j/neo4j.conf
The actual entry you need to change will be
dbms.directories.data=/var/lib/neo4j/data
If you are using the windows client for Neo4J Community. You should have an option to browse to a database directory before starting the database.
Quoting this link.
http://neo4j.com/blog/neo4j-3-0-massive-scale-developer-productivity/
"The new file, config and log structures in Neo4j 3.0 are designed to streamline operations and to bring Neo4j better into line with operational IT expectations. One notable change is to move from multiple config files to a single namespaced files."
The ops manual might also be of use to you.
http://neo4j.com/docs/operations-manual/current/

Connecting neo4j database from Neo4j webadmin pane

I have created neo4j nodes and relationships from java code , i am trying to use Neo4j webadmin panel to display them as a graph.
I have changed server config property "org.neo4j.server.database.location" to point to the DB folder i have created from java program.
Is there any other changes i need to do in order to view the nodes and relationships? how to achieve the same?
Please guide.
You need to make sure your java program is shut down as it's not possible to access a graph.db directory more multiple Neo4j instances (1 server and 1 embedded in your example) at the same time.
Aside from this make sure you're using the same version.

Neo4J web console has stats for my embedded data, but cannot query it

I'm currently evaluating Neo4J (2.0M3), and in an attempt to get some kind of visualisation and query-exploration (I haven't succeeded yet!), I switched from using the Test DB to an Embedded DB, and have a Server that I can start up when required.
I understand how to get my node and relationship data written to the data directory of my choice (via How to explore databases created by an embedded-Neo4j Java application and stored outside the /data directory?), and how to configure the Server/web console to point to that directory. Sure enough, the Dashboard does show the data counts I expect, but no Cypher query I try - not even the ones that work fine in my unit tests - return any nodes. Simple lookups by name and Id all fail.
Can anyone explain the inconsistency? This happens with a vanilla Server install, with data written to the default graph.db directory, as well as with different directories. The paths under 'Server Info' are all what I expetc to see.
Another thing I don't understand: why can I not have my own Server running, and create a GraphDatabaseFactory/GraphDatabaseService in code that will accept a server URI, which will allow me to use the standard Java API and see live updates in the web console without having to stop/start the server each time?
You can set up your embedded java project to even start a server, see http://www.cakesolutions.net/teamblogs/2012/05/23/enabling-neo4j-web-admin-tool-on-the-embedded-server-using-spring-data/

Migrating .NET Database to Shared Hosting

Built an app locally with an EF code-first database - not sure how to upload it to a shared hosting environment such as GoDaddy. It makes sense that something would be amiss because on the shared hosting your code can't just go create a database, but on the flip side I can't find anything to copy the CREATE sql and create it on the server like you would with MySQL
Feel a little silly because I've been using .NET for over a year now but at work the databases are already set up and we have full control over our environments.
If the database has no data that you need to preserve the easiest method is just to install the app on the new host and set the connection string to your new database on the host. On the first attempt to load a page accessing the database, the database will automatically be created (note that you need to load a page which hits the database - sometimes the home page is not sufficient).
This method is a lot more straightforward than generating SQL and then executing it on the production database.
If there is data that you need to preserve then the best method will be taking a backup and installing the backup on the host. In SSMS simply right-click the database in the left pane, then Tools > Backup... To restore on the server connect to the server in SSMS and right-click the 'Database' node in the left panel and select 'Restore Database...' I'm not sure if the host provides a direct connection from SSMS but they should at a minimum have a mechanism to restore a .bak file.
Going forward you should ensure that you can execute SQL on your database as a very convenient method for deploying EF Migrations is to generate the SQL update script on the development server and then deploy this by executing it in production.
Depending on your web host, you may be able to restore the database. If this is an option, simply back up your database on your local machine and restore it on the server via the management console.
You can back up your local database using SQL Server Management Console. This works well even for larger databases as you can directly restore all your data, your schema, etc.
I've had experience with three different hosts so far and all of them have this as an option. You'll usually find this under the Database tab for the web site. The rest from there is up to you because it's usually different across the various hosts.

Resources