Koha How-To

Accidentally Delete a Report? No Worries!

Accidentally Delete a Report? No Worries!

When you embark on your spring weeding of reports you might delete a rarely used report to two only to find out that those reports were precious to someone. Do not panic! In a few simple steps you can undo that delete!

First, before you start cleaning up your reports, it's a good idea to enable the Reports Log in your system preferences, if isn't already turned on. This helpful log tracks the creation, edits, and deletions of reports and who made the changes. Here's what that looks like in your system preferences.

Next let's swing over to the Reports Module to delete those bad, unused reports! Here I have put reports that have never been run into a tab called Spring Weeding. My colleagues and I have agreed that we never use these reports and it's time to delete them!

Let's click those check boxes and delete these reports. Who needs them?

Well... As it turns out... someone did need that report. Eleanor, who'd been on vacation last week, was working hard on that report and is very displeased that her report "Show me all system preferences!" was deleted. Nobody wants Eleanor upset, but how do you fix it?

Since you enabled the Reports Log it's a breeze to recover that report!

Start by going to Home › Tools › Logs

In the Modules box choose Reports. In the Display From/Display To you can zero in on the date range when deleted the report. With those parameters selected hit that Submit button.

There! You've found the log from when you deleted the "Show me all system preferences!" report! It contains the title and the SQL statement from the report just as it was before being deleted.

You can now Copy and Paste that SQL from the Log into a fresh SQL report. Remember to let Eleanor know her report is back safe and sound!

Now, you may be the 'Eleanor' of your own report woes. Editing SQL, editing the wrong report, accidentally deleting a saved report; let these troubles be a thing of the past. Enable your Reports Log and let it have your back.