Koha How-To

Accidentally Delete a Report? These steps will show you how to recover it

Action logs are your friend

In this Koha tutorial we will walk you through recovering a deleted report. Reports in Koha are a way to gather data. Reports are used to generate statistics, member lists, shelving lists, or any list of data in your database.

First, you will want to make sure your system preference to log report changes is turned on. Actions within the Koha system are tracked in log files. Your system preferences can be changed to prevent the logging of different actions. Go to Administration › System preferences › Logs. The ReportsLog must be set to log to track when reports are added, deleted or changed. These logs can be viewed using the Log Viewer Tool.

Next, go to Tools › Log viewer. Select the Reports log, and optionally, depending on how active report usage is in your library, the Delete action. You can add additional parameters like the report ID for the object (if known) or enter a date range if needed to limit results.

The results will appear in the info column where the SQL information is intact:

From there, you can copy the SQL query into a fresh report.

Like all logs, it won't work if you don't have it turned on, so it's better to make sure it's on before you need it rather than finding out it wasn't enabled. In general, it's always good to check periodically on what logs you have enabled, since new logs are developed and added to Koha as the product grows.