[Koha] Importing Koha Database to a new install
Robin Sheat
robin at catalyst.net.nz
Fri Jan 3 13:43:16 NZDT 2014
Please reply to the list, so that other people with the same problem in
the future can see information on it.
Phillip Ponchot schreef op do 02-01-2014 om 15:48 [-0800]:
> After I install Koha and do everything mentioned before importing my
> database, do I log into the staff koha web interface and setup the
> database like set language to en, choose marc21 records etc.
No, I always start from a clean database and import my database directly
into there.
> all one line:
> (I assume this is clearing the database)
> mysql -u koha_library -p xxxxxxxxxxxxxx -Nse 'show tables'
> koha_library | while read table; do mysql -u koha_library
> -p xxxxxxxxxxxxxxxxxxxx -e "drop table $table" koha_library ; done
That will go some way to clearing the database, but I would expect you
get a lot of errors about foreign relationships, if so, run it multiple
times until you get no errors. Best just start from an empty database
though.
> (the data imports just fine)
> 5. sudo koha-mysql library < backedup.sql
This will abort if there is any error, so that it doesn't is a good
sign.
However, you say that it imports just fine. How do you know? That there
are no errors isn't good enough. Did you look in the tables and count
the records to make sure the right number are there? Did you have a look
in backedup.sql to make sure that it's got the right data in it? Did you
compare some things between them. I think that there is something going
wrong around here.
> (seems to work but does this extremely fast, I figured it would take
> longer)
> 6. sudo koha-upgrade-schema library
It should _definitely_ take some time. I think the fact that it's not is
the primary symptom of the issue. Is there any output at all? There
should be heaps of it, stuff like "Upgrade to version 3.12.34 done (Add
widget to foobar)" type things.
At this point, what I think is happening is that you are adding sample
data into the database, and when you think you are importing your real
data over the top of it, you actually aren't.
I don't know where it's going, your steps look correct, but I suspect
that the reason that it's going fast is because it's looking at the
database and saying "oh, already at the latest version, let's do
nothing" because you have your sample data still there rather than real
data.
> (if I run this I get a complaint that ean and agerestriction is not in
> biblioitems. If I create these tables in biblioitems, it takes about
> an hour so upgrade all 37400 records.
> 7. sudo koha-upgrade-to-3.4 library
Yeah, it'll be expecting a more modern schema. For 37,400 records, I
would consider an hour to be roughly right. It's been a long while since
I've had to run that though.
ean and agerestriction came in in 3.09, so that they're not there
suggests that something before this step is definitely wrong.
> (during the upgrade zebra rebuild is run, but I've run it just in case
> since it is in the instructions)
> 8. ran zebra rebuild - koha-rebuild-zebra -v -f library
My rule of thumb is to run this after anything significant has happened.
It doesn't hurt, and is the first port of call when something weird is
happening.
> I try to login to the web interface as the old staff user (in the
> database) but it does not work.
Don't say "doesn't work." What actually happens? What I would expect,
given the apparent failure of step 6, is that it redirects you do the
web installer and says "upgrading to version 3.12.whatever" or something
along those lines. If it says that, what does it actually say? If it
doesn't say that, what does it actually say? Details are vital here.
I would fully expect that login to not work in this case though, you
should be using the database username/password for the schema upgrade.
> I log into the web interface with the koha_library account and I can
> get into Koha but there is just mylibrary and several other samples.
So, are these the samples you created when you installed it the first
time?
> After I install Koha, do I immediate login as Koha_library with the
> supplied password do the setup (set english, set marc21) etc.
No.
> After I import data, fix the schema, upgrade to 3.4 and rebuild zebra,
> how to I setup the web interface to see the my library's data.
You don't, it just works.
Provide the result of doing all this with the "script" command, there
may be clues in there.
--
Robin Sheat
Catalyst IT Ltd.
✆ +64 4 803 2204
GPG: 5FA7 4B49 1E4D CAA4 4C38 8505 77F5 B724 F871 3BDF
More information about the Koha
mailing list