Restore the default Marc Framework
Hello, how to restore the default Marc Framework to the original pattern? koha version 22.05.05 ubuntu 20 Thanks, Victor
The easiest way I can think of is to import the framework from another Koha instance. We're on 22.05.09; I can send you a copy of ours if you'd like one. Fred King, MSLS, AHIP Medical Librarian, MedStar Washington Hospital Center fred.king@medstar.net 202-877-6670 ORCID 0000-0001-5266-0279 MedStar Authors Catalog: http://medstarauthors.org You know it's cold outside when you go outside and it's cold. --NPS Twitter -----Original Message----- From: Koha <koha-bounces@lists.katipo.co.nz> On Behalf Of Victor Barroso Oliveira Sent: Thursday, March 30, 2023 1:28 PM To: Koha <koha@lists.katipo.co.nz> Subject: [EXTERNAL] [Koha] Restore the default Marc Framework **ATTENTION: This email originated from outside the MedStar Health network. ** DO NOT CLICK links or attachments unless you recognize the sender and know the content is safe. Hello, how to restore the default Marc Framework to the original pattern? koha version 22.05.05 ubuntu 20 Thanks, Victor _______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha ---------------------------------------------------------------------- MedStar Health is a not-for-profit, integrated healthcare delivery system, the largest in Maryland and the Washington, D.C., region. Nationally recognized for clinical quality in heart, orthopedics, cancer and GI. IMPORTANT: This e-mail (including any attachments) may contain information that is private, confidential, or protected by attorney-client or other privilege. If you received this e-mail in error, please delete it from your system without copying it and notify sender by reply e-mail, so that our records can be corrected... Thank you. Help conserve valuable resources - only print this email if necessary.
Hi Victor, It's a bit convoluted, but here's what I usually do if I need to do this. In the database, I delete the default and acq framework. DELETE FROM marc_subfield_structure WHERE framework IN ('', 'ACQ'); DELETE FROM marc_tag_structure WHERE framework IN ('', 'ACQ'); Then, I reload the original YAML file ./misc/load_yaml.pl --load --file installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml I hope this helps. Caroline On 2023-03-30 13:27, Victor Barroso Oliveira wrote:
Hello, how to restore the default Marc Framework to the original pattern? koha version 22.05.05 ubuntu 20 Thanks, Victor _______________________________________________
Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
Caroline Cyr-La-Rose, M.L.I.S. (she/her) Librarian | Product Manager 1-833-INLIBRO (465-4276), ext. 221 caroline.cyr-la-rose@inlibro.com https://www.inLibro.com
Hi Caroline We need to get rid of a corrupt standard framework and load a correct version of it. In the staff client we tried to import correct versions of the framework via Koha menu "Administration > MARC bibliographic frameworks" but it won't import the correct framework (I resign going into details). However I found your message from 1 April 2023 and deleted frameworks '' and 'ACQ' like this: DELETE FROM marc_subfield_structure WHERE frameworkcode IN ('', 'ACQ'); DELETE FROM marc_tag_structure WHERE frameworkcode IN ('', 'ACQ'); After doing this I still see the framework codes ('' and 'ACQ') in Koha menu "Administration > MARC bibliographic frameworks". Also in Koha menu "Cataloging > New record" the framework names are still visible - though when clicking them no framework is shown. So I tried to reload the framewroks using this command ("koha" is the instance name): $ sudo koha-shell -c "/usr/share/koha/bin/load_yaml.pl --load --file /usr/share/koha/intranet/cgi-bin/installer/data/mysql/de-DE/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml" koha C4::Installer::load_sql returned the following errors while attempting to load /usr/share/koha/intranet/cgi-bin/installer/data/mysql/de-DE/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml: DBD::mysql::db do failed: Duplicate entry 'ACQ' for key 'PRIMARY' at /usr/share/koha/lib/C4/Installer.pm line 577. After this both frameworks '' (the standard framework) and 'ACQ' seem to be loaded but I'm not sure about the error message. Do you happen to know what the message is trying to tell me? 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 Am 31.03.23 um 15:04 schrieb Caroline Cyr La Rose:
Hi Victor,
It's a bit convoluted, but here's what I usually do if I need to do this.
In the database, I delete the default and acq framework.
DELETE FROM marc_subfield_structure WHERE framework IN ('', 'ACQ');
DELETE FROM marc_tag_structure WHERE framework IN ('', 'ACQ');
Then, I reload the original YAML file
./misc/load_yaml.pl --load --file installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml
I hope this helps.
Caroline
On 2023-03-30 13:27, Victor Barroso Oliveira wrote:
Hello, how to restore the default Marc Framework to the original pattern? koha version 22.05.05 ubuntu 20 Thanks, Victor _______________________________________________
Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
Caroline Cyr-La-Rose, M.L.I.S. (she/her) Librarian | Product Manager
1-833-INLIBRO (465-4276), ext. 221 caroline.cyr-la-rose@inlibro.com https://www.inLibro.com
_______________________________________________
Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
Hi Michael! The reason why you still see the framework names in the staff interface after the DELETE is because the sql commands only remove the marc structures, not the actual frameworks. They are in separate tables: - biblio_framework (https://schema.koha-community.org/24_05/tables/biblio_framework.html) contains the framework name and description (what you can edit if you click on Actions > Edit next to the framework name) - marc_tag_structure (https://schema.koha-community.org/24_05/tables/marc_tag_structure.html) contains the MARC fields and labels, and whether they are repeatable/mandatory/important (what you can edit when you click Actions
MARC structure, then Actions > Edit tag)
- marc_subfield_structure (https://schema.koha-community.org/24_05/tables/marc_subfield_structure.html) contains the MARC subfields and labels, whether they are repeatable/mandatory/important and all the other information about the subfield (what you can edit when you click Actions > MARC structure, then Actions > Edit subfield) As you can see, the DELETE commands only remove the marc_tag_structure and marc_subfield_structure, but not biblio_framework. As for the error message, my best guess is that the ACQ framework is created in the installer file you loaded (marc21_framework_DEFAULT.yml), and when it tries to create it, it sees that it's already there. Fortunately, it didn't seem to stop the whole process (I know SQL INSERT commands will stop when they run into an error, but YAML is probably different, I'm not sure). I guess to make absolutely sure you get NO errors, you could also delete the biblio_framework entries (DELETE FROM biblio_framework WHERE frameworkcode IN ('', 'ACQ')). This way it will recreate everything and not run into duplicates. I'm glad you were able to get the defaults back! I don't know if you saw the discussions and bug around framework updates (https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37738)? This bug is specifically for getting the MARC21 updates, but I'd love if we could have something to "revert" the default framework to its default state. Anyway, if you have any input, please comment! Best regards, Caroline P.S. I'd still be curious to know what problems you ran into when trying to import the frameworks, it was my (non-tested) suggested workaround to get the default back for people who do not have database access. But if it doesn't work, that means there is no way to do it other than drastically deleting the frameworks... On 2024-09-03 16:33, Michael Kuhn wrote:
Hi Caroline
We need to get rid of a corrupt standard framework and load a correct version of it. In the staff client we tried to import correct versions of the framework via Koha menu "Administration > MARC bibliographic frameworks" but it won't import the correct framework (I resign going into details). However I found your message from 1 April 2023 and deleted frameworks '' and 'ACQ' like this:
DELETE FROM marc_subfield_structure WHERE frameworkcode IN ('', 'ACQ'); DELETE FROM marc_tag_structure WHERE frameworkcode IN ('', 'ACQ');
After doing this I still see the framework codes ('' and 'ACQ') in Koha menu "Administration > MARC bibliographic frameworks". Also in Koha menu "Cataloging > New record" the framework names are still visible - though when clicking them no framework is shown.
So I tried to reload the framewroks using this command ("koha" is the instance name):
$ sudo koha-shell -c "/usr/share/koha/bin/load_yaml.pl --load --file /usr/share/koha/intranet/cgi-bin/installer/data/mysql/de-DE/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml" koha
C4::Installer::load_sql returned the following errors while attempting to load /usr/share/koha/intranet/cgi-bin/installer/data/mysql/de-DE/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml: DBD::mysql::db do failed: Duplicate entry 'ACQ' for key 'PRIMARY' at /usr/share/koha/lib/C4/Installer.pm line 577.
After this both frameworks '' (the standard framework) and 'ACQ' seem to be loaded but I'm not sure about the error message.
Do you happen to know what the message is trying to tell me?
Best wishes: Michael
Hi Caroline Many thanks for your e-mail! You wrote today:
As you can see, the DELETE commands only remove the marc_tag_structure and marc_subfield_structure, but not biblio_framework.
As for the error message, my best guess is that the ACQ framework is created in the installer file you loaded (marc21_framework_DEFAULT.yml), and when it tries to create it, it sees that it's already there. Fortunately, it didn't seem to stop the whole process (I know SQL INSERT commands will stop when they run into an error, but YAML is probably different, I'm not sure).
I guess to make absolutely sure you get NO errors, you could also delete the biblio_framework entries (DELETE FROM biblio_framework WHERE frameworkcode IN ('', 'ACQ')). This way it will recreate everything and not run into duplicates.
Unfortunately in both tables https://schema.koha-community.org/24_05/tables/marc_tag_structure.html and https://schema.koha-community.org/24_05/tables/marc_subfield_structure.html field "frameworkcode" is shown as a foreign key but it doesn't say it stems from table "biblio_framework". However I did just what you proposed and so executed these SQL commands: DELETE FROM biblio_framework WHERE frameworkcode IN ('', 'ACQ'); DELETE FROM marc_subfield_structure WHERE frameworkcode IN ('', 'ACQ'); DELETE FROM marc_tag_structure WHERE frameworkcode IN ('', 'ACQ'); Interestingly the standard framework never shows up in table "biblio_framework" even if it seems to have a name ("Default framework"), neither before deleting it nor after loading it via "marc21_framework_DEFAULT.yml". After that I reloaded the frameworks using this command ("koha" is the instance name) and there was no more error message: $ sudo koha-shell -c "/usr/share/koha/bin/load_yaml.pl --load --file /usr/share/koha/intranet/cgi-bin/installer/data/mysql/de-DE/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.yml" koha Thanks for the hint!
P.S. I'd still be curious to know what problems you ran into when trying to import the frameworks, it was my (non-tested) suggested workaround to get the default back for people who do not have database access. But if it doesn't work, that means there is no way to do it other than drastically deleting the frameworks...
Well, this seems to be ugly but since you asked... I tested this in my own demo installation (Koha 24.05.00) and also in a productive installation (Koha 24.05.01); both installation were set up using language de-DE: 1. In Koha menu "Administration > MARC bibliographic framework > Actions" when trying to delete one of the example frameworks it says the following (NOT showing the correct frameworkcode): Confirm deletion of framework '' ()? * Yes, delete this framework * No, not delete After clicking "Yes" it says: An error occurred when deleting this framework. Check the logs for details. The framework is not deleted and I cannot find anything in any log file under "/var/log/koha/koha", also there is no hint in Koha menu "Tools > Log viewer" when displaying ALL actions. 2. In Koha menu "Administration > MARC bibliographic framework > Actions" I was able to export the default framework as a CSV file but when trying to import it again (with no changes) it asks: Are you sure you want to replace the fields and subfields for the default framework structure? The existing structure will be overwritten! For safety reasons, it is recommended to use the export option to make a backup first. * Abort * OK After clicking OK it says: Importing to framework: default. Importing from file: export_default_test.csv. Then it takes some time to import and then shows a screen saying: Default MARC bibliographic framework * Create framework for () using: Default / OK I click on OK and it it just says: Default MARC bibliographic framework When I check the current framework it appears the imported default framework has not loaded. However, I think these problems can be solved using the mentioned DELETE commands provided by you, for all unwanted frameworks. 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
participants (4)
-
Caroline Cyr La Rose -
King, Fred -
Michael Kuhn -
Victor Barroso Oliveira