[Koha] painful upgrade from 2.25 to 3.0.1: incomplete tables

ghenry ghenry at cmi.univ-mrs.fr
Thu Mar 19 23:32:18 NZDT 2009


hello all,

i'm following the document:
http://wiki.koha.org/doku.php?id=22_to_30

and it's failing when executing the script 
koha-3.00.01-stable/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl
Creating/updating field 100 if needed
DBD::mysql::st execute failed: Unknown column 'done' in 'where clause' 
at /usr/local/koha/lib/C4/Biblio.pm line 2299.
DBD::mysql::st fetchrow_array failed: fetch() without execute() at 
/usr/local/koha/lib/C4/Biblio.pm line 2300.
Use of uninitialized value in numeric eq (==) at 
/usr/local/koha/lib/C4/Biblio.pm line 2302.
...

the reason is that the zebraqueue table isn't as expected:
CREATE TABLE `zebraqueue` (
   `id` int(11) NOT NULL auto_increment,
   `biblio_auth_number` int(11) NOT NULL default '0',
   `operation` char(20) NOT NULL default '',
   `server` char(20) NOT NULL default '',
   `done` int(11) NOT NULL default '0',
   `time` timestamp NOT NULL default CURRENT_TIMESTAMP,
   PRIMARY KEY  (`id`),
   KEY `zebraqueue_lookup` (`server`, `biblio_auth_number`, `operation`, 
`done`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


but my actual table looks like:
CREATE TABLE `zebraqueue` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `biblio_auth_number` int(11) NOT NULL DEFAULT '0',
   `operation` char(20) NOT NULL DEFAULT '',
   `server` char(20) NOT NULL DEFAULT '',
   PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9555 DEFAULT CHARSET=utf8;

as you can see, done and time are missing, so my guess is that something 
was wrong during the script execution, update22to30.pl ?
The only errors i had are:
090319  9:23:24 [Warning] option 'thread_stack': unsigned value 65536 
adjusted to 131072

DBD::mysql::db do failed: Cannot add or update a child row: a foreign 
key constraint fails (`BDkoha4_test`.`#sql-455b_55bd`, CONSTRAINT 
`#sql-455b_55bd_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES 
`branches` (`branchcode`) ON UPDATE CASCADE) at 
/home/henry/koha-3.00.01-stable/installer/data/mysql/update22to30.pl 
line 3442.
====================
     An error occured during :
         alter table items ADD FOREIGN KEY holdingbranch (holdingbranch) 
REFERENCES branches (branchcode) on update CASCADE on delete RESTRICT
     It probably means there is something wrong in your DB : a row 
(items.holdingbranch) refers to a value in branches.branchcode that does 
not exist. solve the problem and run updater again (or just the previous 
SQL statement).
     You can find those values with select
         items.* from items where holdingbranch not in (select 
branchcode from branches)
     ====================

the last error is easily corrected, but for the first one, i have no 
idea if it's related to the uncomplete table?

and how can i verify if others tables where affected during the update 
process?

thanks in advance for reply,

gerard



More information about the Koha mailing list