[Koha] export_records.pl

Thomas Klausner domm at plix.at
Sat Feb 15 00:46:18 NZDT 2025


Hi!

On Fri, Feb 14, 2025 at 10:11:18AM +0000, Сычев Игорь Алексеевич wrote:
> How do I find these records?

I assume you want to find the IDs of those records in your Koha DB?

This SQL should list the 10 biblios with the largest metadata (i.e. MARC data):

   select biblionumber,length(metadata) from biblio_metadata order by 2 desc limit 10;

But: depending on your setup etc biblio_metadata.metadata might be MARCXML or USMARC (or maybe something else) (check biblio_metadata.format).

MARCXML doesn't have this size limit, but USMARC does (and this causes the most funny bugs...)

And MARCXML takes much more space than USMARC (because of all the XML fluff), so you might get different lengths from the DB. But I would assume that the longer the MARCXML content is, the longer the USMARC will be.

> root at koha:~# /usr/share/koha/bin/export_records.pl --record-type=bibs --filename=koha-bibs.mrc

Do you need to export as USMARC? It is (IMO) a very horrible format, and MARCXML (while also horrible) is less so.

Greetings,
domm

-- 
Thomas Klausner               domm                  https://domm.plix.at
Just another ( Perl | Postgres | Bicycle | Food | Photo | Vinyl ) Hacker

Demo against the upcoming rightwing government in .at, on the same date as 25 years earlier when ÖVP invited FPÖ (back then with Haider) into government.
[ 2025-02-04 10:00 > https://domm.plix.at/potd/2025-02-04.html ]

Today I wanted to transfer two ~100GB postgres dumps (of decommissioned Cloud SQL instances, which we moved to our own PG cluster) from a Google Cloud Storage bucket to a Google Drive (for easier long term backup). Instead of downloading to my machine and uploading again, I followed these instructions using Google Colab, which mostly worked (I had to zip the files before uploading, so I added a step) https://medium.lies.io/transferring-data-from-google-drive-to-google-cloud-storage-using-google-colab-96e088a8c041
Quite amazing, esp all the authorizing worked like a charm and without a hitch.
[ 2025-02-13 12:01 > https://domm.plix.at/microblog.html ]


More information about the Koha mailing list