Bug 5600 - Bulk MARC biblio export script
Summary: Bulk MARC biblio export script
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: 3.10
Hardware: All All
: P5 - low enhancement
Assignee: Julian Maurice
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks: 7986
  Show dependency treegraph
 
Reported: 2011-01-08 22:01 UTC by Ian Walls
Modified: 2013-12-05 19:53 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 5600: Command line interface for tools/export.pl (14.73 KB, patch)
2012-06-06 13:52 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 5600: Command line interface for tools/export.pl (14.66 KB, patch)
2012-06-11 13:19 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 5600: Command line interface for tools/export.pl (18.85 KB, patch)
2012-07-06 12:26 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 5600: Command line interface for tools/export.pl (18.95 KB, patch)
2012-07-06 15:06 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 5600: Command line interface for tools/export.pl (19.13 KB, patch)
2012-07-18 13:55 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 5600: Command line interface for tools/export.pl (19.19 KB, patch)
2012-07-19 09:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 5600: Command line interface for tools/export.pl (19.06 KB, patch)
2012-07-24 09:11 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 5600 follow-up: Fix commandline check in order to work under Plack (1.69 KB, patch)
2012-08-03 14:32 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 5600: very tiny follow-up to pass perlcritic (683 bytes, patch)
2012-08-03 15:01 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Walls 2011-01-08 22:01:18 UTC
Koha does not currently have a bulk MARC biblio export script; there is one for authorities, and rebuild_zebra.pl can be used if one wants to do a reindex along with the export, but otherwise there is no commandline script for exporting the MARC biblios.

This script should be able to output both ISO 2709 and MARCXML.
Comment 1 claire.hernandez@biblibre.com 2012-05-29 14:33:45 UTC
(En réponse au commentaire 0)
> otherwise there is no commandline script for exporting the MARC biblios.

We (BibLibre) have a developpment to provide.

It gives the ability to tools/export.pl to manage options described here: http://wiki.koha-community.org/wiki/Export_Biblio_RFC

We will attach patch sooner on this bz I think.
Comment 2 Julian Maurice 2012-06-06 13:52:12 UTC Comment hidden (obsolete)
Comment 3 Jared Camins-Esakov 2012-06-06 13:55:52 UTC
This patch seems to eliminate the ability to export from the staff client. Wouldn't it be better to either make the script so that it can be accessed via CGI or command-line, or add a second script (which I think may have been what Ian and Paul agreed was the best option for this sort of script)?
Comment 4 Matthias Meusburger 2012-06-07 12:56:50 UTC
Jared, it's the case: the script tools/export.pl is accessible via CGI and command-line.

I've tested this patch and both command-line and CGI worked for me.

Can you give us more information about how it did not work for you ?
Comment 5 Jared Camins-Esakov 2012-06-07 13:00:34 UTC
Matthias,

(In reply to comment #4)
> Jared, it's the case: the script tools/export.pl is accessible via CGI and
> command-line.
> 
> I've tested this patch and both command-line and CGI worked for me.
> 
> Can you give us more information about how it did not work for you ?

I did not try the patch yet. I was going to test it, but when I took a look at the patch to see what it did, it looked like it turned the CGI script into a command-line script. If I misunderstood what it is supposed to do, that's excellent, and I will test and sign off. Sorry for the confusion!
Comment 6 Jared Camins-Esakov 2012-06-09 19:43:37 UTC
When I apply this patch and try to view tools/export.pl in the web browser, I got the following software error:


Can't use an undefined value as a HASH reference at /home/jcamins/kohaclone/tools/export.pl line 99.
Comment 7 Julian Maurice 2012-06-11 13:19:17 UTC Comment hidden (obsolete)
Comment 8 Jared Camins-Esakov 2012-07-06 11:25:53 UTC
There are a lot conflicts between the current version of tools/export.pl and this patch.
Comment 9 Julian Maurice 2012-07-06 12:26:11 UTC Comment hidden (obsolete)
Comment 10 Jared Camins-Esakov 2012-07-06 15:06:56 UTC Comment hidden (obsolete)
Comment 11 Jonathan Druart 2012-07-16 12:31:19 UTC
CONFLICT (content): Merge conflict in tools/export.pl
Comment 12 Julian Maurice 2012-07-18 13:55:28 UTC Comment hidden (obsolete)
Comment 13 Jonathan Druart 2012-07-19 09:02:30 UTC
This one is already signed off by Jared
Comment 14 Jonathan Druart 2012-07-19 09:02:41 UTC
QA Comments:

Nothing to say, seems to work as expected.

Marking Passed QA.
Comment 15 Jonathan Druart 2012-07-19 09:05:39 UTC Comment hidden (obsolete)
Comment 16 Paul Poulain 2012-07-24 08:53:51 UTC
QA comment:
 * unconditionnal warn inside =
+warn $backupdir;
Comment 17 Julian Maurice 2012-07-24 09:11:38 UTC
Created attachment 11099 [details] [review]
Bug 5600: Command line interface for tools/export.pl

Removed unconditionnal warn.
Comment 18 Paul Poulain 2012-08-01 14:39:30 UTC
QA comment: running this script under plack, on the web interface does not work at all.

I get a nasty:
An Error Occurred

500 Internal Server Error 

In the log, I can see:
Variable "$backupdir" is not available at /home/paul/koha.dev/koha-community/tools/export.pl line 452.
Unknown option: port
Unknown option: i
Unknown option: i
Unknown option: e
Unknown option: reload

Trying to reload the page result in CPU being 100% used, Firefox waiting for a long long time, 
There is no problem in CGI mode
Comment 19 Jared Camins-Esakov 2012-08-01 14:41:33 UTC
(In reply to comment #18)
> QA comment: running this script under plack, on the web interface does not
> work at all.
> 
> I get a nasty:
> An Error Occurred
> 
> 500 Internal Server Error 
> 
> In the log, I can see:
> Variable "$backupdir" is not available at
> /home/paul/koha.dev/koha-community/tools/export.pl line 452.
> Unknown option: port
> Unknown option: i
> Unknown option: i
> Unknown option: e
> Unknown option: reload
> 
> Trying to reload the page result in CPU being 100% used, Firefox waiting for
> a long long time, 
> There is no problem in CGI mode

There is a patch to fix this on another bug.
Comment 20 Jonathan Druart 2012-08-02 12:47:17 UTC
(In reply to comment #19)
> There is a patch to fix this on another bug.

See Bug 8437
Comment 21 Julian Maurice 2012-08-03 14:32:27 UTC
Created attachment 11331 [details] [review]
Bug 5600 follow-up: Fix commandline check in order to work under Plack

With plackup, @ARGV can contains elements so we can't check the size of
@ARGV to tell whether we are in command line mode or not.
Instead we check environment variable GATEWAY_INTERFACE.

Also fix the use of a global variable in a subroutine
Comment 22 Julian Maurice 2012-08-03 14:34:00 UTC
The follow-up needs a signoff here.
Comment 23 Julian Maurice 2012-08-03 15:01:36 UTC
Created attachment 11334 [details] [review]
Bug 5600: very tiny follow-up to pass perlcritic

open was called with 2 arguments instead of 3
Comment 24 Paul Poulain 2012-08-03 15:04:20 UTC
QA comment:
 * the 1st follow-up fixes the Plack problem, well done
 * the 2nd follow-up makes perlcritc happy

No reason not to pass QA. So... follow-up signed-off & everything passed QA !
Comment 25 Julian Maurice 2012-08-10 13:51:00 UTC
Ok in master.