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-&gt;nid = 81580; //this is the nid of the deleted node
$node_new-&gt;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??
You'll need to change the nid manually in the database.
As far as I know, only the D7 node_save() allows you to specify the nid during initial save (because it allows you to set $node->is_new as well instead of overriding it).

And no version will ever allow you to change the nid in an update.