Restore deleted data

OpenSpecimen has the option to delete any data in case of user-added erroneous data. When a user deletes from the interface or API, the data is never hard deleted i.e. the data still exists in the database with a 'Delete' flag. Currently, there is no option to retrieve deleted data from the interface. 

OpenSpecimen takes care that the user does not delete any data by mistake:

  1. If a user tries to delete a collection protocol with data, it asks the user to type 'DELETE ANYWAY' so that admin does not click delete by mistake
  2. If the user wants to delete the participant, they have first to delete the specimen and visit under it.
  3. Before deleting any data, the system warns and confirms the deletion.

To retrieve the data, the database administrator can activate the record back by running SQL. Every record has an 'activity_status', which is updated to 'Disabled' for deleted records. To activate this, run an SQL to update 'activity_status' to 'Active'. There are dependent data in some cases, and there might be multiple tables that need to be updated. If you need further help, contact us at forums.openspecimen.org.