Neo4j graph to cypher conversion
This has already been answered in stackoverflow. There is no need to save the queries you used to populate the database, you only need to dump the contents of the database to a file:

db1/neo4j-shell -path db1/data/graph.db/ -c dump &gt; export_data.cypher


In order to load the database dump into another database, you just supply it to neo4j shell through the standard intput:

db2/bin/neo4j-shell -path db2/data/graph.db/ &lt; export_data.cypher