Neo4j restore asks for DB upgrade - neo4j

I have an instance in AWS hosting a Neo4j DB.
The version im using is 2.3.1.
I backed it up using "neo4j-backup".
I then zipped the files and uploaded to an external storage.
I wanted to restore the DB to another instance I have using the same version (2.3.1), so I copied the files to the same folder the 1st instance is using.
When I run the neo4j console command it states:
ERROR Neo4j cannot be started, because the database files require upgrading and upgrades are disabled in configuration. Please set 'allow_store_upgrade' to 'true' in your configuration file and try again.
Of course the "allow_store_upgrade" is commented out,
Do I have to do the upgrade when restoring?
How can I find the DB version?

If you're using the same version you shouldn't need to comment it out. Though I don't think it would harm anything if you do (especially if you still have that backup somewhere else).
You should be able to find the version of Neo4j in the CHANGES.txt / README.txt files. It should also output the version in data/graph.db/messages.log when you start up the server. Also if you go to the web console (at http://localhost:7474 by default) it will show you the version.

Related

neo4j browser can not start database (version 1.3.5)

I'm using windows 10. Neo4j browser update to version 1.3.5. After that I always get an error saying
"Database failed to start: Database process terminated, see logs..
Check the logs"
When I check the folder logs I see nothing. Please help
I checked the logs there %USERPROFILE%.Neo4jDesktop\log.log They say they can not read somewhere in AppData folder.
After I uninstalled and deleted some folder inside somewhere AppData\Local manually and then reinstalling Neo4j Desktop, it worked fine.
I deleted some folders inside somewhere AppData manually. I think, when I uninstall Neo4j Desktop and check to delete all the folders, it should have deleted them but it didn't.
It is very strange that when I check the newest version on the website I see 1.3.4. But somehow my neo4j desktop suggested 1.3.5 and installed it.

uninstall and reinstall neo4j

On ubuntu 16.04, when trying to uninstall neo4j I typed:
sudo apt-get purge neo4j*
However, the neo4j folder and all of the data still exist in
/var/lib/neo4j
Secondly, I tried to just install the newest version using:
sudo apt-get install neo4j
and when I checked the version from the commandline I got:
neo4j 3.3.4
This is what I want, but when I start the service and check the version in the web application (http://localhost:7474/browser/), it says that the neo4j version is still 3.1.4.
So, basically I would like to completely remove neo4j, and download the newest version. What is the recommended way of doing this in ubuntu 16.04.
I'm new to neo4j, so I'm sure I'm missing something. Thanks for your help.
I followed the instructions here and they really helped.
Specifically, I deleted my old neo4j folder located in /var/lib/, and in it's place, I put the new version (which was downloaded from the link above and the top folder was renamed "neo4j"). I'm rebuilding my database from scratch, so I wasn't concerned about keeping any of the data I had previously (although maybe you could just copy it over to the new neo4j folder, I don't know).
I started the neo4j service by typing
/var/lib/neo4j/bin/neo4j start
and everything was brand new and seemed to be working. Part of the reason I did a fresh install was because I could not understand how to upgrade based on the documentation. I'll have to look into that more.
I also added the jar file for the corresponding apoc procedures to my plugins folder (/var/lib/neo4j/plugins), and adjusted the neo4j conf file (var/lib/neo4j/conf/neo4j.conf) accordingly:
dbms.security.procedures.unrestricted=apoc.*
and apoc procedures are now being recognized, which is fantastic.
Perhaps there is a better way to have done this, but things seem to be working so far. My database is small right now, so I can build it from scratch easily. Let me know if there is a better way to go about it.
well, I have tried the method above and it did not work. Since the main purpose is to use the verison 4.x.x of neo4j, I tried anothor way to reach the same effect.
At first, download the neo4j-community-4.x.x and put it in someplace where you want, then open the config/neo4j.conf file and change some configuration as follows:
dbms.connector.bolt.listen_address=:7688
dbms.connector.http.listen_address=:7475
After that, start the neo4j by running neo4j start and you shall access the neo4j from browser at localhost:7475, it did work for me. As for the old version, just let it go.

Neo4j Upgradation from 2.1 to 2.3

The following points are taken from the Up gradation Link
1. Cleanly shut down the older version of Neo4j, if it is running.
2. Install Neo4j 2.1.5, and set it up to use the same database store directory (typically data/graph.db).
3. Set the Neo4j configuration parameter allow_store_upgrade=true in your conf/neo4j.properties file. Neo4j will fail to start without this configuration set.
4. Start up Neo4j.
5. The database store upgrade will occur during startup.
6. The allow_store_upgrade configuration parameter should be removed, set to false or commented out.
7. Information about the upgrade and a progress indicator are logged into the messages.log file, inside the database store directory.
The sixth point, After starting the higher version of neo4j, should we again set allow_store_upgrade=false.
I have followed the same steps, but the older database which was 10gb after upgrading to new version, database size is only 1.7gb.
I am worried, all my relations that are imported in older version can be seen in newer version?
Any suggestions.
You're mentioning "from 2.1 to 2.3". Please note that as of today there's just a milestone build from 2.3 M01 available. Upgrading a database from a milestone version is not guaranteed, see release notes.
Aside from your graph data itself the graph.db directory contains (depending on your config) transaction logs. These might be a large fraction of the complete directory.
To be sure that your datastore is consistent, use the consistency checker, see http://www.markhneedham.com/blog/2014/01/22/neo4j-backup-store-copy-and-consistency-check/.
Yes, you should complete step #6 after you have successfully started up the new version once (which is what triggers the upgrade). Perhaps a slightly more detailed process could be written as:
4. Start up Neo4j.
5. The database store upgrade will occur during startup.
6. Review information about the upgrade contained in the messages.log file, inside the database store directory.
7. After a successful upgrade:
7a. Shut down Neo4j
7b. Remove, comment out or set to false the allow_store_upgrade configuration parameter.
7c. Start up Neo4j.

Error moving Neo4J database when upgrading from 1.9.4 to 2.0.1

I just upgraded my Neo4J from 1.9.4 to 2.0.1 newest stable release.
The upgrade instructions say that you can just start the new Neo4J with the old database provided that
allow_store_upgrade=true
which is exactly what I did.
However, when I copied my old graph.db folder (which contains all data) into the data folder of the new installation and tried to run neo4j for the first time, it didn't work. The error message I got in terminal upon neo4j start was
Using additional JVM arguments: -server -XX:+DisableExplicitGC -
Dorg.neo4j.server.properties=conf/neo4j-server.properties -
Djava.util.logging.config.file=conf/logging.properties -
Dlog4j.configuration=file:conf/log4j.properties -XX:+UseConcMarkSweepGC -
XX:+CMSClassUnloadingEnabled
Starting Neo4j Server...WARNING: not changing user
process [462]... waiting for server to be ready... Failed to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.
When I removed the graph.db folder from the new installation and ran neo4j start once again, it all started fine, but with a new clean database, of course.
FIY I run it on Mac OS X 10.9, the newest Java 1.7.0_51-b13 SDK installed.
Does anybody know what I did wrong? Thank you!
Ok, I found a solution. The upgrade instructions say that you should uncomment this string in conf/neo4j.properties:
#allow_store_upgrade=true
But what they don't say is that you should uncomment is in the OLD database BEFORE you shut it down the one last time in the old version.
Then, when you install the new database, just copy the graph.db folder into the /data folder of the new 2.0.1 Neo4J, then, before launching it, go to /conf folder of the NEW database, find that same neo4j.properties file, UNCOMMENT that same line:
allow_store_upgrade=true
Then launch the new 2.0.1 Neo4J database for the first time, make sure the data is all fine.
Don't forget to then comment that option once you shut down the database.
A bit of a complicated way to update, would be great if Neo4J provided a better and more streamlined way to do that...

java database installation directory location & database location

java database installation directory location & database location
I am trying to get my Java DB setup correctly with NetBeans 6.9.1 to start building databases.
When I right-click on Java DB every option is greyed out except for Properties. There is no sample databases or anything else
when selected, a popup appears requesting
Java DB Installation:
Database Location:
and an info line saying
Please enter the Java DB installation directory.
can anyone tell me where the installation directory (and driver associated with it) is located and how to get past this screen and begin database creation.
Normally JavaDB should be installed as part of the JDK, in a subdirectory called db of the JDK installation directory. However, I just noticed that the JDK6 I have here doesn't have this directory, but the JDK7 installation does. And Netbeans is using the JavaDB installation that came with a Glassifsh appserver I have as well...
You could look for a file called ij (the command line tool that comes with JavaDB, and apparently even on Windows system the shellscript call ij is installed) somewhere on your system, that name is unique enough to avoid false positives.
If you don't find any JavaDB installation, as you can point Netbeans to any Derby install you can find, you could install a fresh copy of Apache Derby, they're a number of versions ahead of the official JavaDB distribution.

Resources