Bug 24572 - Add books from mysql manually
Summary: Add books from mysql manually
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-03 20:10 UTC by Chris Mark
Modified: 2020-11-30 21:44 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Mark 2020-02-03 20:10:10 UTC
Hi everyone,


I'm trying to bulk import book items into Koha database using a custom script that I have created (in python).

Here are some of the mysql commands I use for it:

insert into biblio (title, biblionumber, frameworkcode, datecreated) values('{}',{},'{}',NOW())".format(title, biblionumber, biblio_framework)

so as to create a new book, and then 

insert into biblio_metadata (id, biblionumber, format, marcflavour, metadata) values ({},{},'{}','{}','{}')".format(id, biblionumber, "marcxml", "UNIMARC", meta)

in order to attach metadata to it.


The result is that the sql entries are successfully inserted however I cannot search the book from the basic search at http://192.168.1.12/cgi-bin/koha/opac-main.pl


I guess that some more date need to be populated so as to have the books available from the search bar?

Could you please point me which tables are required to be populated so as to have books listed in searches like the one I described above?

Thank you in advance,
C.
Comment 1 Katrin Fischer 2020-02-03 21:42:25 UTC
Hi,

Koha needs a full valid and well-formed MARC record in metadata (depends on version), I think you'd have much more 'fun' with getting records into Koha using the build in import tools like staged marc impord or bulkmarcimport.pl or one of the available APIs.

Doing things on SQL level you run at a high risk of missing things or importing things that won't fit your configuration later on - like the mappings in your frameworks and keyword to MARC mappings. And as you need a full MARC record in any case, there is no advantage to using SQL over the other available options.

For more help/discussion, please ask on the mailing list - the bug tracker is read only by a few and should be only used for enhancement requests and bugs. koha-devel is read by most of the developers:
https://koha-community.org/support/koha-mailing-lists/