Drupal - Is it possible to restore a deleted node?

If you have a database backup (which you should ;) you can restore an old copy of the site and retrieve it that way.

Drupal does give users quite a clear warning that deleting a node is final, and there is a confirmation dialog.


What Chris says. The code reads

    db_query('DELETE FROM {node} WHERE nid = %d', $node->nid);
    db_query('DELETE FROM {node_revisions} WHERE nid = %d', $node->nid);

...so deleted really means deleted.

To prevent accidents like this, you may want to restrict user permissions so users cannot delete, but only unpublish nodes. Unpublished nodes will not show up on your site (assuming that your site is built correctly) but they remain available in the database.


Yes there are several solutions for this.

  • The first one is using full backups which has already been mentioned by Chris here. this is the most difficult one specially if the node contains complex fields.
  • Using https://drupal.org/project/recover module, which monitors
  • Using https://drupal.org/project/entity_soft_delete module. It created sort of a recycle/trashbin for nodes/entities so when a particular node gets deleted, it won't be removed from the database only its status changes to deleted. So the admin can still see or even use it and if required change its status back to normal or delete it permanently

Tags:

Database

Nodes