Search code examples
cassandragremlinjanusgraphgremlin-server

Upgrade janusgraph from 0.2.2 to 0.5.2


I'm new to Janusgraph. I need to upgrade the Janausgraph version from 0.2.2(storage: cassandra, index: es) to the latest stable version (0.5.2). I've gone through the docs/forums how to initiate the process (I've seen only the changelog). I wasn't able to figure out the clear/direct solution. Whether to go for incremental upgrade (0.2.2 > 0.x.x* > 0.5.2) or direct upgrade (install 0.5.2, try to dump the cassandra data some way, iff works)

I've tried the second, downloaded the latest janusgraph (both base and -full dist), installed the latest cassandra(311) and es(6xx,7xx). I've copied the old cassandra data to the latest cassandra (/var/lib/cassandra). I've started both the servers, janusgraph and cassandra, it is up and running. But when I tried to interact with janusgraph(via gremlin server), it gave error like "Gremlin groovy script engine - Illegal Argument exception "

I figured out this is how it should not be done. I need to do an incremental upgrade by proper import/export data.

Can someone help me, how should I proceed further in incremental upgrade. How can I export/import all the janusgraph/gremlin-server data.


Solution

  • I almost forgot to write answer (Late but might be useful).

    Firstly there aren't any incremental upgrades required. We can upgrade with simple "import/export" commands. There are 3 different formats available as of now: json, xml and binary(gryo).

    Gremlin commands (gremlin-cli):

    // Export from *version(0.2.2)*
    graph = JanusGraphFactory.open('conf/gremlin-server/janusgraph-cql-es-server.properties')
    graph.io(IoCore.gryo()).writeGraph('janusgraph_dump_2020_09_30_local.gryo')
    graph.tx().commit()
    // Import to *version(0.5.2)*
    graph = JanusGraphFactory.open('conf/gremlin-server/janusgraph-cql-es-server.properties') 
    graph.io(IoCore.gryo()).readGraph('janusgraph_dump_2020_09_30_local.gryo')
    graph.tx().commit()
    

    This solved my problem.