[Koha] Migration problem

Przemek Kosiński p.kosinski at biblioteka24.eu
Wed Jun 13 01:57:28 NZST 2018


Hi Jonathan,
In version 17.11.05 there was no problem when I tried to import the 
base. Everthing was ok.

The problem appeared in 17.11.06. The solution proposed by Jon Turner 
works very well:
Execute two queries in mysql:

CREATE TABLE IF NOT EXISTS club_enrollments (
           id int(11) NOT NULL AUTO_INCREMENT,
           club_id int(11) NOT NULL,
           borrowernumber int(11) NOT NULL,
           date_enrolled timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
           date_canceled timestamp NULL DEFAULT NULL,
           date_created timestamp NULL DEFAULT NULL,
           date_updated timestamp NULL DEFAULT NULL,
           branchcode varchar(10) NULL DEFAULT NULL,
           PRIMARY KEY (id),
           KEY club_id (club_id),
           KEY borrowernumber (borrowernumber),
           KEY branchcode (branchcode),
           CONSTRAINT club_enrollments_ibfk_1 FOREIGN KEY (club_id) 
REFERENCES clubs (id) ON DELETE CASCADE ON UPDATE CASCADE,
           CONSTRAINT club_enrollments_ibfk_2 FOREIGN KEY 
(borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE 
ON UPDATE CASCADE,
           CONSTRAINT club_enrollments_ibfk_3 FOREIGN KEY (branchcode) 
REFERENCES branches (branchcode) ON DELETE SET NULL ON UPDATE CASCADE
         ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS club_enrollment_fields (
               id int(11) NOT NULL AUTO_INCREMENT,
                club_enrollment_id int(11) NOT NULL,
                club_template_enrollment_field_id int(11) NOT NULL,
                `value` text NOT NULL,
                PRIMARY KEY (id),
                KEY club_enrollment_id (club_enrollment_id),
                KEY club_template_enrollment_field_id 
(club_template_enrollment_field_id),
                CONSTRAINT club_enrollment_fields_ibfk_1 FOREIGN KEY 
(club_enrollment_id) REFERENCES club_enrollments (id) ON DELETE CASCADE 
ON UPDATE CASCADE,
                CONSTRAINT club_enrollment_fields_ibfk_2 FOREIGN KEY 
(club_template_enrollment_field_id) REFERENCES 
club_template_enrollment_fields (id) ON DELETE CASCADE ON UPDATE CASCADE
              ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

With the koha schema update there were no problems or errors.

I have'nt any tables with club*

Migrate was very simple - on old server I dump with koha-dump data from 
database koha 3.20  -> on new server (Ubuntu 16.04) I cerated new 
instance koha and import from file database.sql to new base.
Then I run koha-update-schema and run koha-rebulid-zebra. That's all. In 
koha 17.11.05 work without problems in 17.11.06 two trys and two failed.


Redgards,
Przemek
W dniu 12.06.2018 o 14:52, Jonathan Druart pisze:
> Hi,
> 
> The table club_enrollments has been added in 16.12.00.027
> Do you have other tables with names starting with club_*?
> 
> How did you migrate? Are you sure there were no errors during the DB 
> upgrade process?
> 
> Regards,
> Jonathan
> 
> 
> On Tue, 12 Jun 2018 at 06:48 Przemek Kosiński 
> <p.kosinski at biblioteka24.eu <mailto:p.kosinski at biblioteka24.eu>> wrote:
> 
>     Hi everyone,
> 
>     I tried to do a base migration from 3.20 to 17.11.06. The conversion of
>     the database to the new schema and indexation has gone ok - everything
>     works except the possibility of a full preview of the patron - after
>     choosing one they receive such an error:
> 
>     Template process failed: undef error -
>     DBIx::Class::Storage::DBI::_dbh_execute(): Table
>     'koha_biblio-main.club_enrollments' doesn't exist at
>     /usr/share/koha/lib/Koha/Objects.pm line 269
> 
>     I did two attempts and this problem appeared every time.
> 
>     System: Ubuntu 16.04LTS
>     DataBase: MariaDB 10.0.34
>     Plack not enabled - when enable plack I get an error: Internal
>     Server Error
> 
>     In the version of koha 17.11.05 there was no such error - the earlier
>     attempt to migrate to this version was successful.
> 
>     I have a question about what I can do about it.
>     Alternatively, how to withdrawal to an earlier version 17.11.05 to
>     check
>     whether this error can be invoked.
> 
>     Best regards
>     Przemek Kosiński
> 
>     -- 
>     *************************************************
>     Powiatowa i Miejska Biblioteka
>     Publiczna w Skarżysku-Kamiennej
>     www: www.biblioteka24.eu <http://www.biblioteka24.eu>
>     mail: p.kosinski at biblioteka24.eu <mailto:p.kosinski at biblioteka24.eu>
>     *************************************************
>     _______________________________________________
>     Koha mailing list http://koha-community.org
>     Koha at lists.katipo.co.nz <mailto:Koha at lists.katipo.co.nz>
>     https://lists.katipo.co.nz/mailman/listinfo/koha
> 


-- 
*************************************************
Powiatowa i Miejska Biblioteka
Publiczna w Skarżysku-Kamiennej
www: www.biblioteka24.eu
mail: p.kosinski at biblioteka24.eu
*************************************************


More information about the Koha mailing list