Reputation: 20604
I started to use neo4j with its Java API to store and retrieve graph oriented data.
Now I came to a point where I have to add a label, a constraint or remove a node attribute.
Using relational databases I used liquibase to migrate a database to the next version.
What would be the best way to migrate a neo4j database? Are there any libraries supporting this?
I use neo4j 2
Upvotes: 4
Views: 1508
Reputation: 5147
There is a tool out there being worked on, which copies the concepts of liquibase called Liquigraph. The source github page here: https://github.com/liquigraph/liquigraph.
Although the tool is still quite young the author is very receptive to feedback and is actively working on the tool.
Upvotes: 3
Reputation: 41706
Unfortunately not yet.
I'm in discussion with Axel Fontaine of FlyWayDB to add support for Neo4j.
As stefan said, You can use Cypher statements to migrate data.
Please note that you might have to batch operations if there is a lot of data in your database.
e.g. batching in 100k chunks to migrate a type property to a Label.
MATCH (n) WHERE has(n.type) AND n.type = "User"
WITH n
LIMIT 100000
SET n:User
REMOVE n.type
Upvotes: 3