<section xml:id="migratingpatrons">\r
<title>Migrating Patron Data</title>\r
<para>\r
- This section will explain the task of migrating your patron datas from Comma Delimited Files into Evergreen. It does not deal with the process of exporting from the non-Evergreen \r
+ This section will explain the task of migrating your patron data from Comma Delimited Files into Evergreen. It does not deal with the process of exporting from the non-Evergreen \r
system since this process may vary depending on where you are extracting your patron records. Patron could come from an ILS or it could come from a student database in the case of \r
academic records. \r
</para>\r
<para>\r
- This section will explain the task of migrating your patron datas from Comma Delimited Files into Evergreen. It does not deal with the process of exporting from the non-Evergreen \r
+ This section will explain the task of migrating your patron data from Comma Delimited Files into Evergreen. It does not deal with the process of exporting from the non-Evergreen \r
system since this process may vary depending on where you are extracting your patron records. Patron could come from an ILS or it could come from a student database in the case of \r
- academic records.The Comma Delimited File usod for importing the records should use Unicode (UTF8) character encoding. \r
+ academic records.The Comma Delimited File used for importing the records should use Unicode (UTF8) character encoding. \r
</para>\r
- <para>When importing records into Evergreen you will need to populate 3 tables in your Evergreen databas:</para>\r
+ <para>When importing records into Evergreen you will need to populate 3 tables in your Evergreen database:</para>\r
<itemizedlist>\r
<listitem><link linkend="actor.table.usr">actor.usr</link> - This is the main table for user data</listitem>\r
<listitem><link linkend="actor.table.card">actor.card</link> - Stores the barcode for users. Users can have more than 1 card but only 1 can be active at a given time.</listitem>\r
country text, postal_code text, phone text, profile int, ident_type int, home_ou int, claims_returned_count int DEFAULT 0, usrname text, net_access_level int DEFAULT 2, password text\r
); \r
</programlisting>\r
- <para>Note the <varname>DEFAULT</varname> variables. These allow you to set default for your library or to pulate required fields if you data allows NULL values where \r
+ <para>Note the <varname>DEFAULT</varname> variables. These allow you to set default for your library or to populate required fields if you data allows NULL values where \r
fields are required in Evergreen.</para>\r
</step>\r
<step>\r
- <para>Formatting of some fields to fit Evergreen filed foprmatting may be required. Here is an example of sql to adjust phone numbers in the staging \r
+ <para>Formatting of some fields to fit Evergreen filed formatting may be required. Here is an example of sql to adjust phone numbers in the staging \r
table top fit the evergreen field:</para>\r
<programlisting language="sql">\r
UPDATE students phone = replace(replace(replace(rpad(substring(phone from 1 for 9), 10, '-') || substring(phone from 10), '(', ''), ')', ''), ' ', '-');\r
</programlisting>\r
- <para>Data <quote>masaging</quote> may be required to fit formats used in Evergreen.</para>\r
+ <para>Data <quote>massaging</quote> may be required to fit formats used in Evergreen.</para>\r
</step>\r
<step>\r
<para>Insert records from the staging table into the <link linkend="actor.table.usr">actor.usr</link> Evergreen table:</para>\r
INNER JOIN actor.usr \r
ON students.usrname = actor.usr.usrname;\r
</programlisting> \r
- <para>This assumes a one to one card patron relationship. If your patron data import has multible cards assined to one patron more complex import scripts may be required which look for inactive or active flags.</para> \r
+ <para>This assumes a one to one card patron relationship. If your patron data import has multiple cards assigned to one patron more complex import scripts may be required which look for inactive or active flags.</para> \r
</step>\r
<step>\r
<para>Update actor.usr.card field with actor.card.id to associate active card with the user:</para>\r
</programlisting> \r
</step>\r
<step>\r
- <para>Insert records into actor.usr_address to add address inforamation for users:</para>\r
+ <para>Insert records into actor.usr_address to add address information for users:</para>\r
<programlisting language="sql">\r
INSERT INTO actor.usr_address (usr, street1, street2, city, state, country, post_code) \r
SELECT actor.usr.id, students.street1, students.street2, students.city, students.province, students.country, students.postal_code \r
<programlisting>\r
BEGIN;\r
\r
--- Create stagig table.\r
+-- Create staging table.\r
CREATE TABLE students (\r
student_id int, barcode text, last_name text, first_name text, program_number text, program_name text, email text, address_type text, street1 text, street2 text, city text, province text, \r
country text, postal_code text, phone text, profile int, ident_type int, home_ou int, claims_returned_count int DEFAULT 0, usrname text, net_access_level int DEFAULT 2, password text\r
COMMIT;\r
</programlisting>\r
<para>Placing the sql statements between <code>BEGIN;</code> and <code>COMMIT;</code> creates a transaction block so that if any statements fail, the \r
- entire process is cancelled and the database is rolled back to its original state. Lines beginning with <emphasis>--</emphasis> are comments to let you you what \r
+ entire process is canceled and the database is rolled back to its original state. Lines beginning with <emphasis>--</emphasis> are comments to let you you what \r
each sql statement is doing and are not processed.</para> \r
</step>\r
</procedure>\r
<para>For academic libraries, doing batch updates to add new patrons to the Evergreen database is a critical task. The above procedures and \r
import script can be easily adapted to create an update script for importing new patrons from external databases. If the data import file contains only new patrons, then, \r
the above procedures will work well to insert those patrons. However, if the data load contains all patrons, a second staging table and a procedure to remove existing patrons from that second staging table may be required before importing the new patrons. Moreover, additional steps to update address information and perhaps delete \r
- inactive patrons may also be desired depending on the requirements of the intstitution.</para>\r
+ inactive patrons may also be desired depending on the requirements of the institution.</para>\r
<para>After developing the scripts to import and update patrons have been created, another important task of library staff is to develop an strategy and schedule \r
which suits the needs of the library. This could be determined by registration dates of your institution in the case of academic libraries. It is important to balance \r
the convenience of patron loads and the cost of processing these loads vs staff adding patrons as needed.</para> \r