How to re-generate Node Object from database stored Serialized Node Data .. and then Save as New Node? In Drupal 7, for some reason, i am storing some serialize($node) objects into Database. So these data in the database (in text column) are storing like:

O:8:"stdClass":47:{s:3:"vid";s:5:"78629";s:3:"uid";s:3:"523";s:5:"title";s:12:"Sync Node #6";s:6:"status";i:1;s:3:"nid";s:5:"77429";s:4:"type";s:4:"page";s:8:"language"; ..... etc



Now how can i transform these data back into Drupal $node Object please?
Then how can i node_save($node) (as new node) upon them? (What tricks will i need?)


Any idea please?
Now how can i transform these data back into Drupal $node Object please?


As said you can use the following code,

$node = unserialize($data);





  Then how can i node_save($node) (as new node) upon them? (What tricks will i need?)


You can null the nid, vid and use node_save to save it as a new node like this:

$node-&gt;nid = NULL;
$node-&gt;vid = NULL;
node_save($node);