1 <?xml version='1.0' encoding='UTF-8'?>
\r
2 <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"
\r
3 xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:id="upgradingevergreen-2.0">
\r
5 <title>Upgrading Evergreen to 2.0</title>
\r
7 <para>This Chapter will explain the step-by-step process of upgrading <application>Evergreen
\r
8 </application> to 2.0, including steps to upgrade <application>OpenSRF</application>. Before
\r
9 upgrading, it is important to carefully plan an upgrade strategy to minimize system downtime and
\r
10 service interruptions. All of the steps in this chapter are to be completed from the command line.</para>
\r
14 <para>Evergreen 2.0 has several software requirements:</para>
\r
16 <listitem>PostgreSQL: Version 8.4 is the minimum supported version of PostgreSQL. </listitem>
\r
17 <listitem>Linux: Evergreen 2.0 has been tested on Debian Squeeze (6.0) and Ubuntu Lucid Lynx (10.04). If you are runnung an older version of these distributions,
\r
18 you may want to upgrade befor installing Evergreen 2.0. For instructions on upgrading these distributions, visit the
\r
19 <ulink url="http://www.debian.org/releases/squeeze/">Debian</ulink> or <ulink url="https://help.ubuntu.com/community/LucidUpgrades">Ubuntu</ulink> websites.</listitem>
\r
21 <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem> or
\r
22 <systemitem class="username">opensrf</systemitem> user.</para>
\r
24 <listitem>Debian: To become the <systemitem class="username">root</systemitem> user, issue the <command>su</command> command and enter the password of the
\r
25 <systemitem class="username">root</systemitem> user.</listitem>
\r
26 <listitem>Ubuntu: To become the <systemitem class="username">root</systemitem> user, issue the <command>sudo su</command> command and enter the password of your current user.</listitem>
\r
28 <para>To switch from the <systemitem class="username">root</systemitem> user to a different user, issue the <command>su - [user]</command> command; for example,
\r
29 <command>su - opensrf</command>. Once you have become a non-root user, to become the <systemitem class="username">root</systemitem> user again simply issue the exit command.</para>
\r
30 <para>In the following instructions, <filename class='directory'>/path/to/OpenSRF/</filename> represents the path to the OpenSRF source directory.</para>
\r
31 <section xml:id="upgradingevergreen-stop_evergreen">
\r
32 <title>Backing Up Data</title>
\r
35 <para>As <systemitem class="username">root</systemitem>, stop the <application>Apache</application>
\r
36 web server<indexterm><primary>web server</primary><secondary>Apache</secondary></indexterm>.</para>
\r
39 <para>As the <systemitem class="username">opensrf</systemitem> user, stop all
\r
40 <application>Evergreen</application>
\r
41 and <application>OpenSRF</application> services:</para>
\r
42 <screen><userinput>osrf_ctl.sh -l -a stop_all</userinput></screen>
\r
45 <para>Back up of the <filename class='directory'>/openils</filename>
\r
49 <para><link linkend="backingup">Back up the <application>evergreen
\r
50 </application> database</link>.</para>
\r
54 <section xml:id="upgradingevergreen-upgradingOpenSRF">
\r
55 <title>Upgrading OpenSRF to 1.6.3</title><indexterm><primary>OpenSRF</primary></indexterm>
\r
58 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the source files for <application>OpenSRF</application>
\r
61 wget http://open-ils.org/downloads/OpenSRF-1.6.3.tar.gz
\r
62 tar xzf OpenSRF-1.6.3.tar.gz
\r
63 </userinput></screen>
\r
64 <para>A new directory OpenSRF-1.6.3 is created.</para>
\r
65 <note><para>For the latest edition of OpenSRF, check the Evergreen download page at
\r
66 <ulink url="http://www.open-ils.org/downloads.php" />.
\r
70 <para>As the <systemitem class="username">root</systemitem> user, install the software prerequisites using the automatic
\r
71 prerequisite installer.</para>
\r
73 aptitude install make
\r
74 cd /home/opensrf/OpenSRF-1.6.3
\r
75 </userinput></screen>
\r
76 <para>Replace <option>[distribution]</option> below with the following value
\r
77 for your distribution:</para>
\r
80 <para><option>debian-squeeze</option> for <systemitem class="osname">Debian Squeeze (6.0)</systemitem>
\r
81 <indexterm><primary>Linux</primary><secondary>Debian</secondary></indexterm></para>
\r
84 <para><option>fedora13</option> for <systemitem class="osname">Fedora 13</systemitem>
\r
85 <indexterm><primary>Linux</primary><secondary>Fedora</secondary></indexterm></para>
\r
88 <para><option>ubuntu-lucid</option> for <systemitem class="osname">Ubuntu Lucid Lynx
\r
89 (10.04)</systemitem><indexterm><primary>Linux</primary><secondary>Ubuntu</secondary></indexterm></para>
\r
92 <para><option>centos</option> for <systemitem class="osname">CentOS 5</systemitem>
\r
93 <indexterm><primary>Linux</primary><secondary>CentOS</secondary></indexterm></para>
\r
96 <para><option>rhel</option> for <systemitem class="osname">Red Hat Enterprise Linux 5</systemitem>
\r
97 <indexterm><primary>Linux</primary><secondary>Red Hat</secondary></indexterm></para>
\r
100 <screen><userinput>
\r
101 cd /path/to/OpenSRF
\r
102 make -f src/extras/Makefile.install [distribution]
\r
103 </userinput></screen>
\r
104 <para>This will install a number of packages required by OpenSRF on your system,
\r
105 including some Perl modules from <systemitem class="resource">CPAN</systemitem><indexterm><primary>Perl</primary><secondary>CPAN</secondary>
\r
106 </indexterm>. You can type <userinput>no</userinput> to the initial <systemitem class="resource">CPAN</systemitem>
\r
107 configuration prompt to allow it to automatically configure itself to download
\r
108 and install Perl modules from <systemitem class="resource">CPAN</systemitem>. The <systemitem class="resource">CPAN</systemitem> installer will ask you a number of
\r
109 times whether it should install prerequisite modules - type <userinput>yes</userinput>.</para>
\r
112 <para>As the <systemitem class="username">opensrf</systemitem> user, configure and compile OpenSRF:</para>
\r
113 <note>You can include the <option>–enable-python</option> and <option>–enable-java</option> configure options if
\r
114 you want to include support for Python<indexterm><primary>Python</primary></indexterm> and Java
\r
115 <indexterm><primary>Java</primary></indexterm>, respectively.</note>
\r
116 <screen><userinput>
\r
117 cd /home/opensrf/OpenSRF-1.6.3
\r
118 ./configure --prefix=/openils --sysconfdir=/openils/conf
\r
120 </userinput></screen>
\r
123 <para>As the <systemitem class="username">root</systemitem> user, return to your OpenSRF build directory and install
\r
125 <screen><userinput>
\r
126 cd /home/opensrf/OpenSRF-1.6.3
\r
128 </userinput></screen>
\r
131 <para>As the <systemitem class="username">root</systemitem> user, change the ownership of the installed files to the
\r
132 <systemitem class="username">opensrf</systemitem> user:</para>
\r
133 <screen><userinput>chown -R opensrf:opensrf /openils</userinput></screen>
\r
136 <para>Restart and Test OpenSRF</para>
\r
137 <screen><userinput>
\r
138 osrf_ctl.sh -l -a start_all
\r
140 srfsh# request opensrf.math add 2 2
\r
141 </userinput></screen>
\r
142 <para>You should see output such as:</para>
\r
146 ------------------------------------
\r
147 Request Completed Successfully
\r
148 Request Time in seconds: 0.007519
\r
149 ------------------------------------
\r
153 <para>If test completed successfully move onto the next section.
\r
154 Otherwise, refer to the <link linkend="troubleshooting">troubleshooting</link> chapter
\r
155 of this documentation.</para>
\r
159 <section xml:id="upgradingevergreen-upgrading_from_1.6_to_2.0">
\r
160 <title>Upgrade <application>Evergreen</application> from 1.6.1 to 2.0</title>
\r
162 <para>PostgreSQL 8.4 is the minimum supported version of PostgreSQL.</para>
\r
163 <para>Evergreen 2.0 has been tested on Debian Squeeze (6.0) and Ubuntu Lucid (10.04). If you are runnung an older version of
\r
164 these distributions, you may want to upgrade befor installing Evergreen 2.0. For instructions on upgrading these distribuitions, visit the
\r
165 <ulink url="http://www.debian.org/releases/squeeze/">Debian</ulink> or <ulink url="https://help.ubuntu.com/community/LucidUpgrades">Ubuntu</ulink> websites.</para>
\r
169 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract <application>Evergreen 2.0</application>
\r
171 <screen><userinput>
\r
172 wget http://www.open-ils.org/downloads/Evergreen-ILS-2.0.5.tar.gz
\r
173 tar xzf Evergreen-ILS-2.0.5.tar.gz
\r
174 </userinput></screen>
\r
175 <note><para>For the latest edition of Evergreen 2.0, check the Evergreen download page at
\r
176 <ulink url="http://www.open-ils.org/downloads.php" /> and adjust upgrading instructions accordingly.</para></note>
\r
179 <para>As the <systemitem class="username">root</systemitem> user, install the prerequisites:</para>
\r
180 <screen><userinput>cd /home/opensrf/Evergreen-ILS-2.0.5</userinput></screen>
\r
181 <para>On the next command, replace <option>[distribution]</option> with one of
\r
182 these values for your distribution of Debian or Ubuntu:</para>
\r
186 <para><option>debian-squeeze</option> for <systemitem class="osname">Debian Squeeze (6.0)</systemitem></para>
\r
190 <para><option>ubuntu-lucid</option> for <systemitem class="osname">Ubuntu Lucid Lynx
\r
191 (10.04)</systemitem></para>
\r
194 <screen><userinput>make -f Open-ILS/src/extras/Makefile.install <option>[distribution]</option></userinput></screen>
\r
197 <para>As the <systemitem class="username">opensrf</systemitem> user, configure and compile
\r
198 <application>Evergreen</application>:</para>
\r
199 <screen><userinput>cd /home/opensrf/Evergreen-ILS-2.0.5</userinput></screen>
\r
200 <screen><userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput></screen>
\r
201 <screen><userinput>make</userinput></screen>
\r
204 <para>As the <systemitem class="username">root</systemitem> user, install
\r
205 <application>Evergreen</application>:</para>
\r
206 <screen><userinput>make STAFF_CLIENT_BUILD_ID=rel_2_0_5 install</userinput></screen>
\r
209 <para>Change to the <application>Evergreen</application> installation
\r
211 <screen><userinput>cd /home/opensrf/Evergreen-ILS-2.0.5</userinput></screen>
\r
214 <para>As the <emphasis>root</emphasis> user, change all files to be owned by the
\r
215 <emphasis>opensrf</emphasis> user and group:</para>
\r
216 <screen><userinput>chown -R opensrf:opensrf /openils</userinput></screen>
\r
219 <para>As the <systemitem class="username">opensrf</systemitem> user, update server symlink in <filename class="directory">/openils/var/web/xul/</filename>:</para>
\r
220 <screen><userinput>
\r
221 cd /openils/var/web/xul/
\r
223 ln -s rel_2_0_5/server
\r
224 </userinput></screen>
\r
227 <para>Update the <database>evergreen</database> database:</para>
\r
228 <note><para>It is recommended that you <link linkend="backingup">back up your Evergreen database</link> in order to restore your data if anything goes wrong.</para></note>
\r
229 <note><para>The <filename>1.6.1-2.0-upgrade-db.sql</filename> upgrade script may take a long time (hours) to process
\r
230 on larger systems.</para></note>
\r
233 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql evergreen
\r
234 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.0-2.0.1-upgrade-db.sql evergreen
\r
235 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.1-2.0.2-upgrade-db.sql evergreen
\r
236 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.1-2.0.2-upgrade-db.sql evergreen
\r
237 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.2-2.0.3-upgrade-db.sql evergreen
\r
238 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.3-2.0.4-upgrade-db.sql evergreen
\r
239 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.4-2.0.5-upgrade-db.sql evergreen
\r
245 <para>Run the <filename>reingest-1.6-2.0.pl</filename> script to generate an sql script. Then use the sql file to reingest bib records into your
\r
246 <database>evergreen</database> database. This is required to make the new facet sidebar in OPAC search results work and to upgrade the keyword indexes to use
\r
247 the revised NACO normalization routine.</para>
\r
248 <note><para>If you are running a large Evergreen installation, it is recommend that you examine the script first. Reingesting a large number of bibliographic records
\r
249 may take several hours.</para></note>
\r
250 <screen><userinput>perl Open-ILS/src/sql/Pg/reingest-1.6-2.0.pl</userinput></screen>
\r
251 <screen><userinput>psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/reingest-1.6-2.0.sql evergreen</userinput></screen>
\r
254 <para>As the <systemitem class="username">opensrf</systemitem> user,
\r
255 copy <filename>/openils/conf/oils_web.xml.example</filename> to <filename>/openils/conf/oils_web.xml</filename>
\r
256 . (If upgrading from 1.6.1.x, <filename>oils_web.xml</filename> should already exist.)</para>
\r
257 <indexterm><primary>configuration files</primary><secondary>oils_web.xml</secondary></indexterm>
\r
258 <screen><userinput>cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml</userinput></screen>
\r
261 <para>Update <filename>opensrf_core.xml</filename> and <filename>opensrf.xml</filename> by copying the new example files
\r
262 (<filename>/openils/conf/opensrf_core.xml.example</filename> and <filename>/openils/conf/opensrf.xml</filename>).</para>
\r
263 <indexterm><primary>configuration files</primary><secondary>opensrf.xml</secondary></indexterm>
\r
264 <screen><userinput>cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml</userinput></screen>
\r
265 <indexterm><primary>configuration files</primary><secondary>opensrf_core.xml</secondary></indexterm>
\r
266 <screen><userinput>cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml</userinput></screen>
\r
267 <caution><para>Copying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying
\r
268 them.</para></caution>
\r
271 <para>Update <filename>opensrf.xml</filename> with the database connection info:</para>
\r
272 <screen><userinput>
\r
273 perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
\r
274 --service all --create-offline --user evergreen --password evergreen \
\r
275 --hostname localhost --port 5432 --database evergreen
\r
276 </userinput></screen>
\r
279 <para>Update /etc/apache2/startup.pl by copying the example from
\r
280 Open-ILS/examples/apache/startup.pl.</para><indexterm><primary>configuration files</primary><secondary>startup.pl</secondary></indexterm>
\r
283 <para>Update /etc/apache2/eg_vhost.conf by copying the example from
\r
284 Open-ILS/examples/apache/eg_vhost.conf.</para><indexterm><primary>configuration files</primary><secondary>eg_vhost.conf</secondary></indexterm>
\r
287 <para>Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/
\r
288 examples/apache/eg.conf.</para><indexterm><primary>configuration files</primary><secondary>eg.conf</secondary></indexterm>
\r
291 <para>Copying these Apache configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying
\r
292 them. For example, if you purchased an SSL certificate, you
\r
293 will need to edit <filename>eg.conf</filename> to point to the appropriate SSL certificate files.</para>
\r
294 <indexterm><primary>SSL</primary><secondary>certificates</secondary></indexterm>
\r
298 <section xml:id="testing_after_upgrade">
\r
299 <title>Restart Evergreen and Test</title>
\r
302 <para>As the <systemitem class="username">opensrf</systemitem> user, start all
\r
303 <application>Evergreen</application> and <application>OpenSRF</application>
\r
305 <screen><userinput>osrf_ctl.sh -l -a start_all</userinput></screen>
\r
308 <para>As the <systemitem class="username">opensrf</systemitem> user, run <command>autogen</command> to refresh the static
\r
309 organizational data files:</para><indexterm><primary>autogen</primary></indexterm>
\r
310 <screen><userinput>
\r
312 ./autogen.sh -c /openils/conf/opensrf_core.xml -u
\r
313 </userinput></screen>
\r
317 <para>Start <command>srfsh</command> and try logging in using your <application>Evergreen</application>
\r
318 username and password:</para>
\r
320 <userinput>/openils/bin/srfsh</userinput>
\r
321 <prompt>srfsh%</prompt> <userinput>login <option>username</option> <option>password</option></userinput>
\r
325 <para>Start the <application>Apache</application> web server.</para>
\r
329 <para>If you encounter errors, refer to the <link linkend="troubleshooting">troubleshooting
\r
330 section</link> of this documentation for tips
\r
331 on finding solutions and seeking further assistance from the Evergreen community.</para>
\r
334 <section xml:id="upgrading_Postgresqlto9.0">
\r
335 <title>Upgrading PostgreSQL from 8.4 to 9.0</title>
\r
337 <title>Upgrading PostgreSQL on Debian Squeez</title>
\r
340 <para>Stop Evergreen and disconnect clients from database.</para>
\r
343 <para>Add the following line to <filename>/etc/apt/sources.list</filename>:</para>
\r
345 deb http://www.backports.org/debian squeeze-backports main contrib non-free
\r
349 <para>Update the sources list on your server.</para>
\r
350 <screen><userinput>
\r
352 </userinput></screen>
\r
355 <para>Backup your databases</para>
\r
356 <screen><userinput>
\r
357 $ pg_dump [db connect args] [db name] > evergreen-backup.sql
\r
358 </userinput></screen>
\r
361 <para>Install PostgreSQL 9.0 as well as the client, contrib and plperl support packages.</para>
\r
362 <screen><userinput>
\r
363 apt-get -t squeeze-backports install postgresql-9.0 postgresql-client-9.0 postgresql-contrib-9.0 postgresql-plperl-9.0
\r
364 </userinput></screen>
\r
367 <para>Drop the empty 9.0 cluster.</para>
\r
368 <screen><userinput>
\r
369 pg_dropcluster --stop 9.0 main
\r
370 </userinput></screen>
\r
373 <para>Update the 8.4 cluster (with evergreen database) to 9.0</para>
\r
374 <screen><userinput>
\r
375 pg_upgradecluster 8.4 main
\r
376 </userinput></screen>
\r
379 <para>Test by logging into psql, checking the postgrSQL version and running a simple SELECT query.</para>
\r
380 <screen><userinput>
\r
382 evergreen=# select version();
\r
383 evergreen=# select count(*) from biblio.record_entry;
\r
384 </userinput></screen>
\r
387 <para>Restart Evergreen and Apache.</para>
\r
390 <para>Drop old 8.4 cluster (optional).</para>
\r
391 <screen><userinput>
\r
392 pg_dropcluster 8.4 main
\r
393 </userinput></screen>
\r
398 <title>Upgrading PostgreSQL on Ubuntu 10.04</title>
\r
401 <para>Stop Evergreen and disconnect clients from database.</para>
\r
404 <para>Add the backport repository to your repository sources list:</para>
\r
405 <screen><userinput>
\r
406 sudo add-apt-repository ppa:pitti/postgresql
\r
407 </userinput></screen>
\r
410 <para>Update the sources list on your server.</para>
\r
411 <screen><userinput>
\r
413 </userinput></screen>
\r
416 <para>As the <systemitem class="username">postgres</systemitem> user, backup your PostgreSQL databases.</para>
\r
417 <screen><userinput><![CDATA[
\r
419 ]]></userinput></screen>
\r
422 <para>As <systemitem class="username">root</systemitem>, remove PostgreSQL 8.4 and install 9.0.</para>
\r
423 <screen><userinput>
\r
424 aptitude purge postgresql-8.4
\r
425 aptitude install postgresql-9.0 postgresql-client-9.0 postgresql-contrib-9.0 postgresql-plperl-9.0
\r
426 </userinput></screen>
\r
429 <para>as the <systemitem class="username">postgres</systemitem> user, recreate empty evergreen databases with required language supports.</para>
\r
430 <screen><userinput>
\r
432 createdb -T template0 --lc-ctype=C --lc-collate=C -E UNICODE evergreen
\r
433 createlang plperl evergreen
\r
434 createlang plperlu evergreen
\r
435 createlang plpgsql evergreen
\r
436 psql -f /usr/share/postgresql/9.0/contrib/tablefunc.sql evergreen
\r
437 psql -f /usr/share/postgresql/9.0/contrib/tsearch2.sql evergreen
\r
438 psql -f /usr/share/postgresql/9.0/contrib/pgxml.sql evergreen
\r
439 </userinput></screen>
\r
442 <para>Update the 8.4 cluster (with evergreen database) to 9.0.</para>
\r
443 <screen><userinput>
\r
444 pg_upgradecluster 8.4 main
\r
445 </userinput></screen>
\r
448 <para>as the <systemitem class="username">postgres</systemitem> user, load data from backup into PostgreSQL 9.0.</para>
\r
449 <screen><userinput><![CDATA[
\r
451 ]]></userinput></screen>
\r
454 <para>Restart Evergreen and Apache.</para>
\r
457 <para>Test by logging into psql, checking the postgrSQL version and running a simple SELECT query.</para>
\r
458 <screen><userinput>
\r
460 evergreen=# select version();
\r
461 evergreen=# select count(*) from biblio.record_entry;
\r
462 </userinput></screen>
\r