Hi Philippe Many thanks! You wrote:
Ok, let's cheat. You have very few rules, and most of the info has been moved already. So just comment the lines 20734 to 20746 and run updatedatabase.pl again.
OR modify the version to move ahead.
update systempreferences set value = '19.1200018' where variable = 'version';
Then you can drop the issuingrules table later, when you're satisfied with everything. Note that you'll need to update the rules manually in the staff interface to add back the issue length and renewal count/period...
I have modified the version and then moved ahead... unfortunately there is another duplicate entry in another table and the script aborted again: Upgrade to 19.12.00.029 [15:13:32]: Bug 17702 - Add column account_credit_types.archived {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry '0' for key 'PRIMARY' at /usr/share/perl5/DBIx/Class/Schema.pm line 1118. DBIx::Class::Schema::throw_exception(Koha::Schema=HASH(0x5598ef055ba8), "DBI Exception: DBD::mysql::db do failed: Duplicate entry '0' "...) called at /usr/share/perl5/DBIx/Class/Storage.pm line 113 DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::mysql=HASH(0x5598f4639198), "DBI Exception: DBD::mysql::db do failed: Duplicate entry '0' "...) called at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1623 DBIx::Class::Storage::DBI::__ANON__("DBD::mysql::db do failed: Duplicate entry '0' for key 'PRIMARY'", DBI::db=HASH(0x5598f4e19490), undef) called at /usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl line 20966 How should I proceed? Is there a way how I can check the original database for duplicate entries so the update process won't abort? Best wishes: Michael -- Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz T 0041 (0)61 261 55 61 · E mik@adminkuhn.ch · W www.adminkuhn.ch
On 2024-07-10 08:10, Michael Kuhn wrote:
Hi Philippe
You wrote:
updatedatabase.pl line 20736
It's the conversion from issuingrules to circulation_rules. What's the state of your DB right now? Has it started to convert?
The script stopped just after giving the shown message.
How many circ rules already created? I suspect it's 0, but it's worth asking.
In the database I find 13 rules:
MariaDB [koha_bib]> select * from circulation_rules; +----+------------+--------------+----------+-------------------+------------+ | id | branchcode | categorycode | itemtype | rule_name | rule_value | +----+------------+--------------+----------+-------------------+------------+ | 2 | NULL | NULL | NULL | refund | 1 | | 16 | NULL | DIENST | NULL | maxissueqty | 9999 | | 17 | NULL | DIENST | NULL | maxonsiteissueqty | 9999 | | 18 | NULL | ARCHIV | NULL | maxissueqty | 200 | | 19 | NULL | ARCHIV | NULL | maxonsiteissueqty | 200 | | 20 | NULL | ARCHBE | NULL | maxissueqty | 50 | | 21 | NULL | ARCHBE | NULL | maxonsiteissueqty | 50 | | 22 | NULL | ARCHPR | NULL | maxissueqty | 200 | | 23 | NULL | ARCHPR | NULL | maxonsiteissueqty | 200 | | 26 | NULL | INSTIT | NULL | maxonsiteissueqty | 0 | | 27 | NULL | INSTIT | NULL | maxissueqty | 0 | | 28 | NULL | INSTMI | NULL | maxonsiteissueqty | 200 | | 29 | NULL | INSTMI | NULL | maxissueqty | 200 | +----+------------+--------------+----------+-------------------+------------+ 13 rows in set (0,000 sec)
Considering the id is an autoincrement, and it not moved from one table to the other, I fail to see how you could have two "0"... (even one, actually).
The Auto_increment value for table "issuingrules" is NULL:
MariaDB [koha_bib]> SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'koha_bib' AND TABLE_NAME = 'issuingrules'; +----------------+ | AUTO_INCREMENT | +----------------+ | NULL | +----------------+
I'm also sending you the output of "select * from issuingrules" in the attached file. Maybe it shows something to you that I don't see?
I don't know how to continue with this update?
Best wishes: Michael