[Koha] Koha VS Home-grown software/database

Bill Benedetto bbenedetto at goodyear.com
Fri Aug 6 08:45:16 NZST 2004


Good day.

I have what I think is a somewhat unusual question about Koha.

A couple of years ago my daughter and I created a Library
Database for our grade school library (Kindergarten through 8th
grade).

Since I'm fairly well-versed in the land of Linux, here's the
infrastructure that we came up with:

  Debian (Woody)
  MySQL
  Perl

The librarian just wanted something to catalog the books.  She
didn't want to do check-in/check-out.  Nor did she want anything
more than Title, Author, Keywords, Section (of the library).  She
also just wanted to do the Fiction part of the library so
CallNumber was pretty basic (something like "TWA 3").

During this library-system creation, I stumbled across Koha.  I
thought that Koha would be a much better choice than rolling my
own.  Consequently, I spent a fair amount of time trying to
figure out how to convert my MySQL DB into Koha's.

Unfortunately, I couldn't figure out how to map from my table
layout to Koha's table layout.

Now, time has passed, the Library DB is all created and in use.
(And the librarian really likes it!)  Now, of course, the
librarian wants a check-in/checkout system.  I may be up to the
task of modifying my DB and scripts to do this but it seems kind
of silly to roll my own when a great system like Koha already
exists.

So, here's my question, finally.....

Is it possible for me to take my data and map it to the Koha
layout?  That is, if I start with a mysqldump of my data, can I
use Perl to mangle it into a mysqldump of data suitable for
importing into Koha?

Yeah, yeah.  I know.  *ANYTHING'S* possible.  But could someone
possibly provide me with enough guidance (or documentation) so
that I could do the job?

Here's my table layout:

  CREATE TABLE catalog (
    bookidnum smallint(6) NOT NULL auto_increment,
    title varchar(75) NOT NULL default '',
    author varchar(30) NOT NULL default '',
    keywords varchar(50) NOT NULL default '',
    numcopies tinyint(4) NOT NULL default '1',
    callnumber varchar(10) NOT NULL default '',
    hard_paperback char(1) NOT NULL default 'H',
    section varchar(30) NOT NULL default '',
    PRIMARY KEY  (bookidnum),
    UNIQUE KEY bookidnum (bookidnum)
  ) TYPE=MyISAM;

Notes:

 o The bookidnum has nothing to do with the physical book.  It's
   just basically the record number in the DB.

 o keywords consists of a string that looks something like "cats
   christmas" or "mississippi" or "berenstain bears" or
   "dinosaurs holidays".  We would really like to keep these
   keywords because that's one of the ways that the
   librarian/user can search for books.

 o numcopies is misnamed and is actually the copy number.  The
   first book is copy #1.  The second is copy #2.  And so on.

 o hard_paperback is just "H" or "P".

 o section looks like one of these:
     Fiction
     Easy Fiction
     Intermediate Fiction
     Non-Fiction
     Easy Non-Fiction
     Intermediate Non-Fiction
     Biography
     Easy Holidays
     YA
     Caldecott
     Newbery

I realize that I'm asking a lot here.  What I'm really looking
for is some kind of one-to-one mapping that says something like
this:

  "Your 'bookidnum' field is really field 'bookno' in table 'booktable'"

so that I might be able to mangle the data from my output to a
new input for Koha (rather than have to re-enter all of this
data).  FWIW, we have around 6000 books in this DB.

I appreciate any guidance that I can get!

Thanks!

- Bill Benedetto



More information about the Koha mailing list