Delete records in Koha

In certain occasions need to empty bibliographic, patron and transaction details from Koha database and clean the installation to start the process again. The user has to go to Koha database and empty the concerned tables.

Log into MySQL
Apply following commands to login to the MySQL database;

sudo su
mysql -uroot -p
use koha_library;



Delete all bibliographic details
Apply following commands one by one.

SET FOREIGN_KEY_CHECKS=0;

TRUNCATE items; 
TRUNCATE deleteditems;

TRUNCATE biblioitems; 
TRUNCATE biblio; 
TRUNCATE deletedbiblioitems; 
TRUNCATE deletedbiblio; 

Delete transactions (Issue, return)

TRUNCATE old_issues; 
TRUNCATE issues; 

Delete borrowers details

TRUNCATE borrowers; 
TRUNCATE deletedborrowers;

SET FOREIGN_KEY_CHECKS=1;


quit

Certain tables have changes in name in latest versions. Please verify the name of tables by visiting Koha Database Schemas.


Information courtesy
Robin Sheat

1 comment: