How to restore the deleted records [Command line method]


When you delete a record, Koha doesn't immediately erase it from the database; it moves it to a deleted table. These are the tables where deleted records are stored:
deletedbiblio, deletedbiblio_metadata, deletedbiblioitems, and deleteditems.

Find the deleted Information

Since the records are no longer in the main catalogue, you need to look in the trash tables. The best way to do this is to run a simple report.

Go to Reports > Guided Reports > Create from SQL.

Give it a name like Find Deleted Records.

Paste this SQL query to see everything in the trash: 

SELECT biblionumber, title, author FROM deletedbiblio

Run the report and find the biblionumber of the records you deleted. Only a few numbers, write those numbers down.

Koha is running in CGI mode. This is a security issue!


Koha is running in CGI mode. This is a security issue! Run Koha using Plack for CSRF (cross-site request forgery) protection. More information: koha-plack --help.

This warning message appears in the Koha > About > Server Information section. Here is the reason to show the message and the solution to fix it.

Essentially, your library system is telling you that its engine is outdated and vulnerable to hackers.

The Problem

Koha is currently running on CGI. Think of CGI like an old-fashioned clerk who has to restart their entire computer every time a customer asks a single question. It’s slow, but more importantly, it lacks the security guards needed to verify that a request is legitimate.

Because of this, your system is at risk for CSRF (Cross-Site Request Forgery). This is a trick where a hacker sends a fake link that, if clicked by a librarian, could force the system to delete books or change settings without anyone realising it.

The Solution: Plack

The error message is telling you to switch to Plack. Plack is like a modern, 24/7 security team that stays "awake" and checks every visitor’s ID to make sure they aren't being tricked by a hacker.

How to fix it

Need to switch from CGI to Plack. Here are the commands to enable Plack. Here library instance name is library.

sudo koha-plack --enable library
sudo a2enmod headers proxy_http
sudo koha-plack --start library
sudo service apache2 restart

The error message will vanish, your staff pages will load much faster, and your data will be much safer from web-based attacks.

How to read Koha error logs using the Tail command

If you manage a Koha Library Management System, you will eventually run into a "500 Internal Server Error" or a screen that simply won't load. When this happens, the Koha error logs are the best assistant. The Linux system records events like a personal diary. It tells exactly what went wrong and where.

The most efficient way to watch these errors in real time is to use the tail command in the Linux terminal. Here are simple instructions on how to do it.


Location of the log files

In a standard Koha installation (on Debian or Ubuntu), the logs are stored in /var/log/koha/. Inside that folder, each "instance" (your library's specific setup) has its own directory.
The most important log file is usually plack-error.log or koha-error.log.
The general path looks like this: /var/log/koha/instancename/plack-error.log
Before using the command, find the Koha instance name. The following command will help you find the instance name.

sudo koha-list

Using the tail command

The tail command shows you the last few lines of a file. This is perfect for logs because the newest errors are always added to the bottom.

To see the last 20 lines
If you just want a quick snapshot of the recent activity, type: 

sudo tail -n 20 /var/log/koha/library/plack-error.log

To watch errors live (The "-f" switch)
This is the most helpful tool for troubleshooting. The -f stands for follow. It keeps the file open and updates your screen the exact second a new error occurs.

sudo tail -f /var/log/koha/library/plack-error.log

While this command is running, go to your Koha staff interface and refresh the page that is causing the error. You will see the technical details pop up instantly in your terminal.

When you are finished reading the logs and want to go back to the regular command prompt, simply press Ctrl + C

Reading logs might seem confusing at first, but it is the fastest way to fix Koha issues. Instead of guessing why a page isn't working, use tail -f and let the system tell you exactly what is broken.

Excel to MARC Converter Online

Transform your Excel spreadsheets into standard MARC format. Developed by Shivam Moradia, College Librarian, St. Xavier's College (Autonomous), Ahmedabad, under the guidance of project mentor Dr. Meghna Vyas, Associate Professor, PG Department of Library and Information Science, Sardar Patel University, Vallabh Vidyanagar.

Here is the link.

https://excel-to-marc-convetor-online.netlify.app

Configure SMTP server to send emails through Koha

Now, it's easy to configure an SMTP-based email account for Koha and send emails for various occasions. Koha provides a GUI for SMTP server configuration. Forget about cumbersome email server configuration using Exim and Postfix. Here are the steps to configure the SMTP server using Gmail. Gmail is accessible for most of the users. Other SMTP-based email users can directly go to Step 2 for configuration. The process involves two steps; creating an app password for a Google account and adding the server details to the Koha ILS.

Email sending limits in Gmail: Reasons to hire a transactional email service

Many libraries started to use SMTP-based email services in Koha. Koha provides SMTP server configuration from Administration > SMTP servers > New SMTP server. Such libraries use Gmail free account as the email service provider. Gmail allow you to send 100 emails per day. Users can't send new messages for up to 24 hours if the number of messages exceeds the limit. Google says, "If a user exceeds their sending limits, their account might be suspended". Another drawback of using an ordinary Gmail account is that libraries can't add their domain to the email ID. Sending emails from an ordinary Gmail account is a non-professional approach.

What's the solution?

Libraries can use a dedicated email service to deliver emails. Hiring an SMTP email service to work with Koha is a good idea. Libraries can choose email services from an array of service providers. Such services enable sending, receiving, and tracking emails. Netcore, MailGun, and Mailchimp are examples of transactional email service providers. Libraries can subscribe to the plan based on the number of transactions per day. Email services give the SMTP server settings details to configure with Koha.

Search for data inconsistencies

 


It's a script which searches for data inconsistencies.  The result shows the following inconsistencies in data;

items without a home or holding library
items without item type or with invalid item type
bibliographic records without item type or with invalid item type
bibliographic records with invalid MARCXML
bibliographic records without biblionumber or biblioitemnumber in MARCXML
bibliographic records without title
invalid values in fields where the framework limits to an authorized value category
authority records without authority type or with invalid authority type
patrons who are too old or too young for their category

The above-mentioned inconsistencies create problems in circulation and cataloguing searches.

Apply the following commands individually to get the information on data inconsistencies.

Load environmental variables

sudo su
export PERL5LIB="/usr/share/koha/lib"
export KOHA_CONF="/etc/koha/sites/library/koha-conf.xml"

Enter into the folder where the data inconsistencies script is located.

cd /usr/share/koha/bin/maintenance

Apply the command to run the script.

./search_for_data_inconsistencies.pl

Reference