Create Neo4j database dump with JQAssistant - neo4j

I want to create a dump of the database that JQAssistant creates with a scan. So far i have tried to do this with the integrated server and by connecting jqassistant to a running database.
The problem with the integrated database is that i can't access a shell and therefore i don't know how i could create the dump.
Connecting to the running database also didn't work. I assume the problem here is the encryption, my server is running local and trying to connect to it with
jqassistant.sh scan -f my-project.jar -storeUri bolt://localhost:7687 -storeUsername neo4j -storePassword secret
which is the example from the jqa tutorial throws the error:
javax.net.ssl.SSLHandshakeException: General SSLEngine problem
so i assume i can't connect without ssl encryption.
I am using Neo4j server 3.5.15 and JQAssistant Commandline Tool version 1.9 which uses an integrated Neo4j 3.5.14 server.
If you can give me an new idea how to create a data dump out of the scan or how to fix one of the two given problems i would appreciate that a lot!
Thanks in advance!

I couldn't figure out a way to export the database with the commandline tool, but with the maven plugin. If you setup a maven project and include jqassistant as a plugin it offers you the option "export-database" which creates a Cypher script.

Related

how to run neo4j source code and support remote debug?

I want to use driver to connect the neo4j server, and debug the code of server part.
I have add the "dbms.jvm.additional=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" in neo4j.conf, and then how to run the source code?
After configuring the server for remote debugging, just run the server using the appropriate instructions for the server's environment.

Have both Gremlin-Server AND NEO4J Server running at the same time

Current it seems we cannot run both Neo4J Server and Gremlin Server at the same time. Is there any way to have run both?
NEO4J is running and I try to start to Gremlin Server then I get the following error
java.lang.RuntimeException: GraphFactory could not instantiate this
Graph implementation [class
org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph].......................(truncated)
Gremlin Server is running and I try to start NEO4J Server then I get the following error
Caused by: org.neo4j.kernel.StoreLockException: Store and its lock
file has been locked by another process:
/home/galaxia/Documents/neo4j-gremlin/data/databases/graph.db/store_lock.
Please ensure no other process is using this database, and that the
directory is writable (required even for read-only access)
Versions
Neo4J 3.3.1
Gremlin 3.3.1
I realize it has been a while, but I finally figured this out and thought others should know. As Stephen Mallette said, you can use the Bolt implementation. To configure this for Gremlin Server, use the included gremlin-server-neo4j.yaml file and make the following change:
graphs: {
graph: conf/neo4j-bolt.properties}
Then create the neo4j-bolt.properties file with this content:
gremlin.graph=com.steelbridgelabs.oss.neo4j.structure.Neo4JGraph
#neo4j.graph.name=graph.db
neo4j.identifier=dummy
neo4j.url=bolt://localhost:7687
neo4j.username=neo4j
neo4j.password=<password>
neo4j.readonly=false
neo4j.vertexIdProvider=com.steelbridgelabs.oss.neo4j.structure.providers.Neo4JNativeElementIdProvider
neo4j.edgeIdProvider=com.steelbridgelabs.oss.neo4j.structure.providers.Neo4JNativeElementIdProvider
Remember to replace the password, and any other property with the correct values.
You cannot run them together that way (i.e. embedded mode), but it should be possible to run them together, if you either:
Configure the Neo4j graph in Gremlin Server to use HA mode as described here
Configure the Neo4j graph in Gremlin Server to use the Bolt implementation found here
Enable the Bolt protocol in the Neo4j properties file provided to Gremlin Server.
As an example of the third option, given the default Gremlin Server packaged configuration files for Neo4j, you can edit conf/neo4j-empty.properties to include:
gremlin.graph=org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph
gremlin.neo4j.directory=/tmp/neo4j
gremlin.neo4j.conf.dbms.connector.0.type=BOLT
gremlin.neo4j.conf.dbms.connector.0.enabled=true
gremlin.neo4j.conf.dbms.connector.0.address=localhost:7687
and then start Gremlin Server with bin/gremlin-server.sh conf/gremlin-server-neo4j.yaml at which point you can use standard TinkerPop drivers as well as standard Bolt connectivity against the same graph instance.

accessing neo4j database in DigitalOcean droplet

I followed this tutorial for setting up a neo4j database on digital ocean: https://www.digitalocean.com/community/tutorials/how-to-install-neo4j-on-an-ubuntu-vps, which basically amounts to apt-get install neo4j.
How can I access the browser for this database?
Once you've successfully installed neo4j on the server make sure that the server configuration allows connection to the web console on all ips (remote, local). You can achieve that by editing the file located at:
/etc/neo4j/neo4j-server.properties
and making sure that this line looks like the following one:
org.neo4j.server.webserver.address=0.0.0.0
save the file and restart the neo4j server and from your browser:
http://YOUR_SERVER_IP:7474

spring data neo4j, how to access database by broswer when database is loaded by tomcat

I use <neo4j:config storeDirectory="/neo4j/target/data/db"> to config my neo4j database path,
and when tomcat started, the database files are locked by tomcat, and I can't start it using Neo4j official start tool, so how can I access my database in broswer like localhost:7474, or can spring connect a lunched neo4j server like mysql? and then I can access it through broswer.
You can work with one graph instance from one place only. If you are using it via tomcat in your code you wont be able to start it from the community tool. You would need to stop your tomcat and then run the tool to view it in the browser.

RoR app deployed on Heroku and working with SQL Server database

Is it feasible to have a Ruby on Rails app, which is:
a) deployed on Heroku, and
b) working with a remote SQL Server database?
I take it that I'll need unixODBC installed on Heroku, but I cannot find a way to do so. Is this possible?
Or, is there any other way (without ODBC?) to accomplish this?
Thank you very much for any guidance or tip.
Updated:
Some info on the subject:
1) Heroku pre-installs both unixODBC and FreeTDS by default, so you already have them.
2) Also, it is possible to run shell commands via Heroku Console in backticks, e.g.:
heroku console
`odbcinst`
(runs "odbcinst" command in Heroku shell and shows the result)
3) You do not have access to filesystem outside of your slice where the packages are installed. If you only need a driver path, Heroku support can provide it (/usr/lib/odbc/libtdsodbc.so in my case).
4) You cannot run sudo commands in Heroku shell.
At the moment, to connect to MS SQL Server you at least need to append ‘freetds.conf’ file. Even when using tinyTDS (there is an open ticket#2 in tinyTDS gitgub issue page). DSN-less connection instructions from "wiki.rubyonrails.org SLASH database-support SLASH ms-sql" didn’t work for me, I guess this connection requires some extra-configuration either.
‘freetds.conf’ cannot be modified without sudo. Therefore, I conclude that currently there is no way to make MS SQL and Heroku work together.
I’ve managed to set up this connection with EngineYard and activerecord-sqlserver-adapter.
I followed these instructions:
https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Platform-Installation---Ubuntu
(there are only some filepath differences, e.g. ‘odbc.ini’ is located in ‘/etc/unicodbc’, not in ‘/etc’ - this is easy to work out).
I installed 'unixODBC' and 'freetds' packages using EY Unix Packages feature, and made all configurations manually through SSH. Sudo is available in EY (no password required). There is also Chef Recepes feature to automate those configurations (seems to be pretty easy, I'm going to try it tomorrow).
Hope this is helpful.
It is possible.
Because Heroku copies/symlinks its own config/database.yml over whatever you supply in your repository, you may need to take additional steps (e.g. in config/environments/production.rb or in config/initializers/remote_mssql_from_heroku.rb) to set up your application appropriately.
You will face the challenge, however, that traffic from Heroku to your MSSQL database will traverse the public internet. By default, this traffic will not be encrypted. Potentially everyone in the world will be able to monitor your traffic between your Heroku application and your database, and even alter the traffic in-flight, whether for benign or malicious purpose, without you being able to detect it. MS SQL offers the capability to connect over SSL. This capability requires explicit configuration in the MSSQL server, so you must be able to access and modify that configuration. Additionally, this configuration requires that your client library be up-to-date and capable of talking with MSSQL over SSL. Note that MSSQL server will enforce that your server certificate list a Common Name or Subject Alternative Name exactly matching or wildcard-matching the server's FQDN (at least, the FQDN that the server knows about), and that the client use an FQDN for the server exactly matching or wildcard-matching one of the names on the certificate.
I've successfully used the following article which uses Heroku's newer buildpack feature to use TinyTDS and connect remotely to SQL Server 2008 R2. I'm still investigating how I could encrypt traffic. Hope this helps others!
http://blog.firmhouse.com/connecting-to-sql-server-from-heroku-with-freetds-here-is-how-on-cedar#
We're having a similar problem where we're needing to import old data from a SQL Server database into our new app. The data isn't a straight table import, but needs to undergo some processing and conversions. We've built an import layer for this which lives in a private gem, so as to not pollute the new app with the old data conversion issues. This approach is also designed to permit incremental updates, as we get closer to launch we'll keep syncing records up to the moment of switch-over.
Heroku told us that it's not trivial to connect to SQLServer, in particular as they don't support FreeTDS. Their support staff recommended to run an instance with the import gem from a laptop in our office and configure it to connect to their database (which requires a dedicated DB, not the free shared one). This sounded like the most palatable approach to us.
Secondly, regarding security that was mentioned by #Justice, we discussed configuring SSL for SQLServer with the hosting company and they pointed out the complexities of this. They recommended VPN as an easier solution. As we don't have office-side VPN hardware, the simplest and free solution proved to be an SSH tunnel.
We've set up an SSH tunnel from the laptop to the SQLServer Windows box. That was straightforward. We had CopSSH installed on Windows (which comes with a Linux shell, by the way) and we were able to simply set up a tunnel, having the laptop talk to localhost for its SQLServer connection, i.e.:
ssh -L 1433:localhost:1433 user#windows_server_name
I did not know Heroku has FreeTDS on it? I was told they did not. TinyTDS if used with FreeTDS 0.91 can have a zero freetds.conf dependency and be driving by runtime connection args. We are looking into building an Ubuntu 10.4 native gem that statically links 0.91 with OpenSSL so you can just drop it into Heroku and us it to connect to Azure and/or you own outside DB.

Resources