Import/export automatic structure generation with Cypher

Not sure it is the right forum as I saw more import/export data from the DB but did not find one appropriate I think.
Feel free to let me know and I will move the post to the appropriate forum.

I have currently a schema created in my neo4J DB and I would like to have the cypher script created automatically ( backup, create another instance for other tests...etc..)
How can I perform this ?
To anticipate the question, of course we had the different cypher queries we used but as we worked at 3 together making different changes, it's a mess... now it is finalized and would be keen to have something clean !

Let me clarify - you want to create a backup of your database, and be able to restore that to a new / different database, so that you can have multiple environments for testing?

If I have understood that right, you can do that like this. You don't need cypher at all.

Hi David.
Not really, it was the exemple
I would like to get the cypher script which will recreate the nodes and relationships that are currently existing in my DB. am I more clear ?

You can use apoc.export.cypher and friends for that use-case


and then import that script e.g. with cypher-shell

Thanks Michael, I sued your solution which worked like a charm and fit 100% of my needs !
@ll , note that you need to install APOC if you are not using the desktop version
Thanks Michael