2

I'm trying to upgrade my neo4j store, running on windows, from 2.0.1 to 2.1.3.

What i have done, starting with a working 2.0.1. environment, is the following:

  • .\2.0.1\bin\neo4jinstall.bat remove
  • xcopy .\2.0.1\data\findsi.graphdb .\2.1.3\data\findsi.graphdb
  • .\2.1.3\bin\neo4jinstall.bat install

This will fail with the message: Detected incorrectly shut down database, performing recovery..

My (2.1.3) messages.log file tells me this:

    2014-08-11 09:45:46.352+0000 ERROR [o.n.k.EmbeddedGraphDatabase]: Startup failed: Component 'org.neo4j.kernel.impl.transaction.XaDataSourceManager@3198c7f6' was successfully initialized, but failed to start. Please see attached cause exception.: Component 'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource@4d8088da' was successfully initialized, but failed to start. Please see attached cause exception.: 'neostore.nodestore.db' does not contain a store version, please ensure that the original database was shut down in a clean state.
    2014-08-11 09:45:46.352+0000 INFO  [o.n.k.EmbeddedGraphDatabase]: Shutdown started
    2014-08-11 09:45:46.352+0000 ERROR [o.n.s.e.EnterpriseBootstrapper]: Failed to start Neo Server on port [7474]
    org.neo4j.server.ServerStartupException: Starting Neo4j Server failed: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, C:\NEO4J-~1.3\data\findsi.graphdb
        at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:221) ~[neo4j-server-2.1.3.jar:2.1.3]
        at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:103) [neo4j-server-2.1.3.jar:2.1.3]
        at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:57) [neo4j-server-2.1.3.jar:2.1.3]
    Caused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, C:\NEO4J-~1.3\data\findsi.graphdb
        at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:362) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.kernel.impl.recovery.StoreRecoverer.recover(StoreRecoverer.java:123) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.server.preflight.PerformRecoveryIfNecessary.run(PerformRecoveryIfNecessary.java:65) ~[neo4j-server-2.1.3.jar:2.1.3]
        at org.neo4j.server.preflight.PreFlightTasks.run(PreFlightTasks.java:71) ~[neo4j-server-2.1.3.jar:2.1.3]
        at org.neo4j.server.AbstractNeoServer.runPreflightTasks(AbstractNeoServer.java:357) ~[neo4j-server-2.1.3.jar:2.1.3]
        at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:154) ~[neo4j-server-2.1.3.jar:2.1.3]
        ... 2 common frames omitted
    Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.transaction.XaDataSourceManager@3198c7f6' was successfully initialized, but failed to start. Please see attached cause exception.
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:339) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        ... 8 common frames omitted
    Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource@4d8088da' was successfully initialized, but failed to start. Please see attached cause exception.
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.kernel.impl.transaction.XaDataSourceManager.start(XaDataSourceManager.java:164) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        ... 10 common frames omitted
    Caused by: org.neo4j.kernel.impl.storemigration.StoreUpgrader$UpgradingStoreVersionNotFoundException: 'neostore.nodestore.db' does not contain a store version, please ensure that the original database was shut down in a clean state.
        at org.neo4j.kernel.impl.storemigration.UpgradableDatabase.checkUpgradeable(UpgradableDatabase.java:76) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.kernel.impl.storemigration.StoreMigrator.needsMigration(StoreMigrator.java:103) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.kernel.impl.storemigration.StoreUpgrader.getParticipantsEagerToMigrate(StoreUpgrader.java:241) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrateIfNeeded(StoreUpgrader.java:129) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.start(NeoStoreXaDataSource.java:350) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) ~[neo4j-kernel-2.1.3.jar:2.1.3]
        ... 13 common frames omitted

Now, if i do .\2.0.1\bin\neo4jinstall.bat install everything works fine again, albeit with the old version. My guess is, that it has not to do with the actual database.

As the documentation states, i did setup for an explicit upgrade by setting allow_store_upgrade=true in my 2.1.3 environment.

I'm reluctant to manually change things in my database folder, but i do need the upgrade, as it solves some performance issues i have been struggling with.

Geoffrey Braaf
  • 254
  • 2
  • 12

1 Answers1

2

There might be 2 problems

  1. did you do xcopy /r (i.e. recursively) ?
  2. windows kills the service with a hard kill, i.e. doesn't let it shut down correctly

So on 2.0.1 at startup it always has to perform recovery and 2.0.3 refuses to start on a non-cleanly shut down database.

You can alleviate that by starting the 2.0.1 database once with the

bin\Neo4jShell.bat -path data\findsi.graphdb

with your db and then stopping it cleanly with quit before copying it over.

Ondrej Slinták
  • 31,386
  • 20
  • 94
  • 126
Michael Hunger
  • 41,339
  • 3
  • 57
  • 80
  • i did use `xcopy /r` but failed to properly reproduce that in the question. I understand the problem with the service shutting down, and will give your suggestion a try right away. To be continued ... – Geoffrey Braaf Aug 11 '14 at 10:57
  • i'm afraid i now really messed things up. i followed your steps, but now, when the service starts (either version now works), it states the db is ~350MB ... but empty! And of course i did not create a backup first #fail – Geoffrey Braaf Aug 11 '14 at 11:44
  • ok, i restored an older backup, and the api is back up with minimal data loss, but still running on 2.0.1. – Geoffrey Braaf Aug 11 '14 at 12:58
  • is there not a tool to do the upgrade in a more controlled manner, separate from the process of installing and running the service? – Geoffrey Braaf Aug 11 '14 at 12:59
  • 1
    I eventually managed to fix this by: 1) creating a backup, using `Neo4jBackup.bat` of the running 2.0.1 environment; 2) copied the backup to where i wanted the db to reside; 3) Started neo4j 2.1.3 using `Neo4j.bat`, which caused the upgrade to take place; 4) Closed the window that the batch file had opened; 5) Installed and ran the 2.1.3 service using `Neo4JInstall.bat install` – Geoffrey Braaf Aug 11 '14 at 15:13