Use node_save with a custom nid
سؤال
On our system (D5) two nodes have been deleted (by mistake). I need them back but I can't simply load a backup as there's a lot of new content created. I want to create these two new nodes again, manually, and they will obviously have a bigger nid.
Then, I would like to simply change the nid to the old (the deleted one) nid. This way, all node references will work again. (Node references from other content types).
I tried the following:
//load the newly created node
$node_new = node_load(1234580);
//put the
$node_new->nid = 81580; //this is the nid of the deleted node
$node_new->vid = 81580; //and its vid
node_save($node_new);
And if I print_r $node_new at the end, it says the nid is 81580, but on the database there's no node with that nide.
How can I create a node and specify the nid manually??
لا يوجد حل صحيح
لا تنتمي إلى drupal.stackexchange