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.
Restoring the records
In Koha, a catalogue record is not stored in a single table but is split across several linked tables to separate the general bibliographic details from specific editions and individual physical copies. Here are the primary tables where catalogue record data is stored:biblio (The Core Record): This is the parent table. It stores the primary descriptive information that remains constant across editions and physical copies. It stores: Title, Author, Series title, Notes, and Abstract.
The key field is biblionumber, the unique ID that links all other tables.
biblio_metadata (The MARC Data): This table holds the actual raw MARC (Machine-Readable Cataloguing) record. It stores the full MARCXML structure of the record. This includes all the tags like 245$a (Title), 100$a (Author), and even the hidden 880 tags (Alternate Graphic Representation).
biblioitems (The Edition/Format Layer): This table sits between the general bibliography and the physical items. It defines how the work was published. It stores: ISBN, ISSN, Publication Place, Publisher, Publication Date, Edition statement, and Item Type (e.g., Book, DVD).
items (The Physical Copy Layer): This table stores data for every individual book or piece of media sitting on the shelf. What it stores: Barcode, Call Number, Home Library, Current Location, Cost, Public/Private Notes, and Circulation Status (e.g., Withdrawn, Lost).
The key field is itemnumber.
Since you have been restoring records, remember that if you only restore the biblio table, your catalogue will have the title but no physical books or MARC details. For a broken record to be fully functional again, data must exist in all four of these tables.

