How do you recover data after it has been deleted?
Answer:
Recovering Data via the REDCap Database Query Tool
The Database Query Tool is located on the left side of the control panel in REDCap under Dashboards & Activity and can be accessed by REDCap administrators. Four database tables exist to retrieve data from the REDCap database using SQL queries. These tables include ‘redcap_data’, ‘redcap_data2’, redcap_data3’, and redcap_data4.’
To pull data from the database using SQL queries, you can use the following query: select * from redcap_data
To filter data based on variables such as project id or event id, you can append the following onto the initial query:
WHERE project_id = 1
WHERE event_id = 45
Full Query: select * from redcap_data WHERE project_id = 1
To search for data based on event id, you can use the following query:
Full Query: select * from redcap_data WHERE project_id = 1 AND event_id = 12345
These steps will allow you to locate data that exists or previously existed within a project.
Where an event was deleted from a project, you can recover the event from the project with a SQL insert statement:
INSERT INTO redcap_events_metadata (arm_id, day_offset, offset_min, offset_max, descrip)
VALUES (1, 0, 0, 0, 'Event 1');