Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neo4j 2.0, java - Failed to start Neo4j with an older data store version

Tags:

java

maven

neo4j

I used to use neo4j-community-1.9.4 with my java maven project. I switched to version 2.0 and made completly new db in 2.0. When I run the same java code, I get error:

Exception in thread "main" org.neo4j.kernel.impl.storemigration.UpgradeNotAllowedByConfigurationException: Failed to start Neo4j with an older data store version. To enable automatic upgrade, please set configuration parameter "allow_store_upgrade=true"
at org.neo4j.kernel.impl.storemigration.ConfigMapUpgradeConfiguration.checkConfigurationAllowsAutomaticUpgrade(ConfigMapUpgradeConfiguration.java:39)
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.attemptUpgrade(StoreUpgrader.java:64)
at org.neo4j.kernel.impl.nioneo.store.StoreFactory.tryToUpgradeStores(StoreFactory.java:104)
at org.neo4j.kernel.impl.nioneo.store.StoreFactory.newNeoStore(StoreFactory.java:86)
at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.<init>(NeoStoreXaDataSource.java:232)
at org.neo4j.kernel.InternalAbstractGraphDatabase.create(InternalAbstractGraphDatabase.java:423)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:226)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:79)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:70)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:205)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:56)
at tools.Import.main(Import.java:32)

Any idea? Thank you.

like image 617
EdWood Avatar asked Jan 28 '14 22:01

EdWood


3 Answers

Neo4j 2.0 requires an explicit store upgrade, because older versions will no longer be able to run on the upgraded store. The exception mentions this:

Failed to start Neo4j with an older data store version. To enable automatic upgrade, please set configuration parameter "allow_store_upgrade=true"

Simply add allow_store_upgrade=true to your neo4j.properties file, and start the database again. Then it should do the upgrade. You can read more about this here:

http://docs.neo4j.org/chunked/stable/deployment-upgrading.html#explicit-upgrade

like image 101
Chris Vest Avatar answered Nov 19 '22 06:11

Chris Vest


Solved, I replaced dependency from spring:

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>2.3.3.RELEASE</version>
</dependency>

By this:

<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>2.0.0</version>
</dependency>
like image 1
EdWood Avatar answered Nov 19 '22 06:11

EdWood


For community edition on windows,

  • click on Options, Database Configuration, Edit
  • look for allow_store_upgrade

enter image description here

enter image description here

like image 1
Vijay Vepakomma Avatar answered Nov 19 '22 05:11

Vijay Vepakomma