cancel
Showing results for 
Search instead for 
Did you mean: 

Copy a Node and Relationship to new one

Kailash
Graph Buddy

Hi Team,

I have a person nodes with many records in it and its relationship created.
I have a requirement where i need to copy person node to personbkup node and copy the relationship.

Match (p:person)<-[ac: ACCESSED_BY]-( b: Block)
here person and Block are linked using b.Id and p.PersonId
Now i need to create a personbkup node from result of above query and then create relationship below.
Match (p:personbkup)<-[ac: ACCESSED_BY]-( b: Block)

Later i will detach delete the person node

2 REPLIES 2

Hello Kailash,

What Cypher commands have you attempted, and what errors/problems are you encountering?

-Tony

jaini_kiran
Node Clone

I think you are asking how to change the node label. If that was right, try below

MATCH (p: person)
REMOVE p:person
SET p:personbkup

Hope this helps.