consider to use APOC. Here is how to use.
[on export side]
- enable APOC(Neo4j Desktop is easy to enable)
- set "apoc.export.file.enabled=true" into your database config
- (re)start database
- open Neo4j browser
- call "CALL apoc.export.cypherAll('/usr/tmp/test1.cypher', {format:'plain'})"
merge exported files like this
cat test1.cypher test2.cypher > target.cypher
[on import side]
- enable APOC
- set "apoc.import.file.enabled=true" into your database config
- start database
- open terminal
- run command
cat /usr/tmp/target.cypher | bin/cypher-shell -u yourusername -p yourpassword
This procedure doesn't care about duplicated nodes and relationships. I hope this may helps.
Referneces:
original dock: https://community.neo4j.com/t/how-to-merge-two-databases/4835/2
export, import using apoc: https://neo4j-contrib.github.io/neo4j-apoc-procedures/#export-csv