[% USE Koha %] [% USE Branches %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Import patrons [% IF ( uploadborrowers ) %]› Results[% END %] [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] [% INCLUDE 'calendar.inc' %]

Import patrons

[% IF ( uploadborrowers ) %]
Import results :
  • [% imported %] imported records [% IF ( lastimported ) %](last was [% lastimported %])[% END %]
  • [% overwritten %] overwritten [% IF ( lastoverwritten ) %](last was [% lastoverwritten %])[% END %]
  • [% alreadyindb %] not imported because already in borrowers table and overwrite disabled [% IF ( lastalreadyindb ) %](last was [% lastalreadyindb %])[% END %]
  • [% invalid %] not imported because they are not in the expected format [% IF ( lastinvalid ) %](last was [% lastinvalid %])[% END %]
  • [% total %] records parsed
  • Back to Tools
[% IF ( FEEDBACK ) %]

Feedback:
[% END %] [% IF ( ERRORS ) %]

Error analysis:
    [% FOREACH ERROR IN ERRORS %] [% IF ( ERROR.badheader ) %]
  • Header row could not be parsed
  • [% END %] [% FOREACH missing_critical IN ERROR.missing_criticals %]
  • Line [% missing_critical.line %] [% IF ( missing_critical.badparse ) %] could not be parsed! [% ELSIF ( missing_critical.bad_date ) %] has "[% missing_critical.key %]" in unrecognized format: "[% missing_critical.value %]" [% ELSE %] Critical field "[% missing_critical.key %]" [% IF ( missing_critical.branch_map ) %]has unrecognized value "[% missing_critical.value %]" [% ELSIF ( missing_critical.category_map ) %]has unrecognized value "[% missing_critical.value %]" [% ELSE %]missing [% END %] (borrowernumber: [% missing_critical.borrowernumber %]; surname: [% missing_critical.surname %]). [% END %]
    [% missing_critical.lineraw %]
  • [% END %] [% IF ERROR.invalid_cardnumber %]
  • Cardnumber [% ERROR.cardnumber %] is not a valid cardnumber [% IF ERROR.borrowernumber %] (for patron with borrowernumber [% ERROR.borrowernumber %])[% END %]
  • [% END %] [% IF ERROR.duplicate_userid %]
  • Userid [% ERROR.userid %] is already used by another patron.
  • [% END %] [% END %]
[% END %] [% ELSE %]
  • Select a file to import into the borrowers table.
  • If a cardnumber exists in the table, you can choose whether to ignore the new one or overwrite the old one.
Import into the borrowers table
Field to use for record matching
Default values
    [% FOREACH borrower_field IN borrower_fields %] [% SWITCH borrower_field.field %] [% CASE 'branchcode' %]
  1. [% borrower_field.field %]
  2. [% CASE 'categorycode' %]
  3. [% borrower_field.field %]
  4. [% CASE %]
  5. [% borrower_field.field %]
  6. [% END %] [% END %] [% IF ( Koha.Preference('ExtendedPatronAttributes') == 1 ) %]
  7. patron_attributes
  8. [% END %]
If matching record is already in the borrowers table:
[% IF ( Koha.Preference('ExtendedPatronAttributes') == 1 ) %]
Patron attributes
[% END %]
[% END %]

Notes:

  • Header: The first line in the file must be a header row defining which columns you are supplying in the import file.
  • Separator: Values are comma-separated.
  • Starter CSV: Koha provides a starter CSV with all the columns.
  • Field list: Alternatively, you can create your own CSV and choose which fields you want to supply from the following list:
    • [% FOREACH columnkey IN borrower_fields %]'[% columnkey.field %]', [% END %]
  • [% IF ( Koha.Preference('ExtendedPatronAttributes') == 1 ) %]
  • Extended patron attributes: If loading patron attributes, the 'patron_attributes' field should contain a comma-separated list of attribute types and values. The attribute type code and a colon should precede each value.
    • Example 1: INSTID:12345,LANG:fr
    • Example 2: STARTDATE:January 1 2010,TRACK:Day
    If an input record has more than one attribute, the fields should either be entered as an unquoted string (previous examples), or with each field wrapped in separate double quotes and delimited by a comma:
    • Example 3: "STARTDATE:January 1, 2010","TRACK:Day"
    The second syntax would be required if the data might have a comma in it, like a date string.
  • [% END %]
  • Required fields: The fields 'branchcode' and 'categorycode' are required and must match valid entries in your database.
  • Password: Values for the field 'password' should be stored in plaintext, and will be converted to a Bcrypt hash (if your passwords are already encrypted, talk to your system administrator about options).
  • Date formats: Date values should match your system preference, and must be zero-padded.
    • Example: '01/02/2008'
    Alternatively, you can supply dates in ISO format.
    • Example: '2010-10-28'
[% INCLUDE 'tools-menu.inc' %]
[% INCLUDE 'intranet-bottom.inc' %]