1 <?xml version='1.0' encoding='UTF-8'?>
2 <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"
3 xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:id="upgradingevergreen-2.0">
5 <title>Upgrading Evergreen to 2.0</title>
7 <para>This Chapter will explain the step-by-step process of upgrading <application>Evergreen
8 </application> to 2.0, including steps to upgrade <application>OpenSRF</application>. Before
9 upgrading, it is important to carefully plan an upgrade strategy to minimize system downtime and
10 service interruptions. All of the steps in this chapter are to be completed from the command line.</para>
14 <para>Evergreen 2.0 has several software requirements:</para>
16 <listitem>PostgreSQL: Version 8.4 is the minimum supported version of PostgreSQL. </listitem>
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,
18 you may want to upgrade befor installing Evergreen 2.0. For instructions on upgrading these distributions, visit the
19 <ulink url="http://www.debian.org/releases/squeeze/">Debian</ulink> or <ulink url="https://help.ubuntu.com/community/LucidUpgrades">Ubuntu</ulink> websites.</listitem>
21 <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem> or
22 <systemitem class="username">opensrf</systemitem> user.</para>
24 <listitem>Debian: To become the <systemitem class="username">root</systemitem> user, issue the <command>su</command> command and enter the password of the
25 <systemitem class="username">root</systemitem> user.</listitem>
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>
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,
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>
30 <para>In the following instructions, <filename class='directory'>/path/to/OpenSRF/</filename> represents the path to the OpenSRF source directory.</para>
31 <section xml:id="upgradingevergreen-stop_evergreen">
32 <title>Backing Up Data</title>
35 <para>As <systemitem class="username">root</systemitem>, stop the <application>Apache</application>
36 web server<indexterm><primary>web server</primary><secondary>Apache</secondary></indexterm>.</para>
39 <para>As the <systemitem class="username">opensrf</systemitem> user, stop all
40 <application>Evergreen</application>
41 and <application>OpenSRF</application> services:</para>
42 <screen><userinput>osrf_ctl.sh -l -a stop_all</userinput></screen>
45 <para>Back up of the <filename class='directory'>/openils</filename>
49 <para><link linkend="backingup">Back up the <application>evergreen
50 </application> database</link>.</para>
54 <section xml:id="upgradingevergreen-upgradingOpenSRF">
55 <title>Upgrading OpenSRF to 1.6.2</title><indexterm><primary>OpenSRF</primary></indexterm>
58 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the source files for <application>OpenSRF</application>
61 wget http://open-ils.org/downloads/OpenSRF-1.6.2.tar.gz
62 tar xzf OpenSRF-1.6.2.tar.gz
64 <para>A new directory OpenSRF-1.6.2 is created.</para>
65 <note><para>For the latest edition of OpenSRF, check the Evergreen download page at
66 <ulink url="http://www.open-ils.org/downloads.php" />.
70 <para>As the <systemitem class="username">root</systemitem> user, install the software prerequisites using the automatic
71 prerequisite installer.</para>
74 cd /home/opensrf/OpenSRF-1.6.2
76 <para>Replace <option>[distribution]</option> below with the following value
77 for your distribution:</para>
80 <para><option>debian-squeeze</option> for <systemitem class="osname">Debian Squeeze (6.0)</systemitem>
81 <indexterm><primary>Linux</primary><secondary>Debian</secondary></indexterm></para>
84 <para><option>ubuntu-lucid</option> for <systemitem class="osname">Ubuntu Lucid Lynx
85 (10.04)</systemitem><indexterm><primary>Linux</primary><secondary>Ubuntu</secondary></indexterm></para>
88 <para><option>centos</option> for <systemitem class="osname">CentOS 5</systemitem>
89 <indexterm><primary>Linux</primary><secondary>CentOS</secondary></indexterm></para>
92 <para><option>rhel</option> for <systemitem class="osname">Red Hat Enterprise Linux 5</systemitem>
93 <indexterm><primary>Linux</primary><secondary>Red Hat</secondary></indexterm></para>
98 make -f src/extras/Makefile.install [distribution]
100 <para>This will install a number of packages required by OpenSRF on your system,
101 including some Perl modules from <systemitem class="resource">CPAN</systemitem><indexterm><primary>Perl</primary><secondary>CPAN</secondary>
102 </indexterm>. You can type <userinput>no</userinput> to the initial <systemitem class="resource">CPAN</systemitem>
103 configuration prompt to allow it to automatically configure itself to download
104 and install Perl modules from <systemitem class="resource">CPAN</systemitem>. The <systemitem class="resource">CPAN</systemitem> installer will ask you a number of
105 times whether it should install prerequisite modules - type <userinput>yes</userinput>.</para>
108 <para>As the <systemitem class="username">opensrf</systemitem> user, configure and compile OpenSRF:</para>
109 <note>You can include the <option>–enable-python</option> and <option>–enable-java</option> configure options if
110 you want to include support for Python<indexterm><primary>Python</primary></indexterm> and Java
111 <indexterm><primary>Java</primary></indexterm>, respectively.</note>
113 cd /home/opensrf/OpenSRF-1.6.2
114 ./configure --prefix=/openils --sysconfdir=/openils/conf
116 </userinput></screen>
119 <para>As the <systemitem class="username">root</systemitem> user, return to your OpenSRF build directory and install
122 cd /home/opensrf/OpenSRF-1.6.2
124 </userinput></screen>
127 <para>As the <systemitem class="username">root</systemitem> user, change the ownership of the installed files to the
128 <systemitem class="username">opensrf</systemitem> user:</para>
129 <screen><userinput>chown -R opensrf:opensrf /openils</userinput></screen>
132 <para>Restart and Test OpenSRF</para>
134 osrf_ctl.sh -l -a start_all
136 srfsh# request opensrf.math add 2 2
137 </userinput></screen>
138 <para>You should see output such as:</para>
142 ------------------------------------
143 Request Completed Successfully
144 Request Time in seconds: 0.007519
145 ------------------------------------
149 <para>If test completed successfully move onto the next section.
150 Otherwise, refer to the <link linkend="troubleshooting">troubleshooting</link> chapter
151 of this documentation.</para>
155 <section xml:id="upgradingevergreen-upgrading_from_1.6_to_2.0">
156 <title>Upgrade <application>Evergreen</application> from 1.6.1 to 2.0</title>
158 <para>PostgreSQL 8.4 is the minimum supported version of PostgreSQL.</para>
159 <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
160 these distributions, you may want to upgrade befor installing Evergreen 2.0. For instructions on upgrading these distribuitions, visit the
161 <ulink url="http://www.debian.org/releases/squeeze/">Debian</ulink> or <ulink url="https://help.ubuntu.com/community/LucidUpgrades">Ubuntu</ulink> websites.</para>
165 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract <application>Evergreen 2.0</application>
168 wget http://www.open-ils.org/downloads/Evergreen-ILS-2.0.1.tar.gz
169 tar xzf Evergreen-ILS-2.0.1.tar.gz
170 </userinput></screen>
171 <note><para>For the latest edition of Evergreen 2.0, check the Evergreen download page at
172 <ulink url="http://www.open-ils.org/downloads.php" /> and adjust upgrading instructions accordingly.</para></note>
175 <para>As the <systemitem class="username">root</systemitem> user, install the prerequisites:</para>
176 <screen><userinput>cd /home/opensrf/Evergreen-ILS-2.0.1</userinput></screen>
177 <para>On the next command, replace <option>[distribution]</option> with one of
178 these values for your distribution of Debian or Ubuntu:</para>
182 <para><option>debian-squeeze</option> for <systemitem class="osname">Debian Squeeze (6.0)</systemitem></para>
186 <para><option>ubuntu-lucid</option> for <systemitem class="osname">Ubuntu Lucid Lynx
187 (10.04)</systemitem></para>
190 <screen><userinput>make -f Open-ILS/src/extras/Makefile.install <option>[distribution]</option></userinput></screen>
193 <para>As the <systemitem class="username">opensrf</systemitem> user, configure and compile
194 <application>Evergreen</application>:</para>
195 <screen><userinput>cd /home/opensrf/Evergreen-ILS-2.0.1</userinput></screen>
196 <screen><userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput></screen>
197 <screen><userinput>make</userinput></screen>
200 <para>As the <systemitem class="username">root</systemitem> user, install
201 <application>Evergreen</application>:</para>
202 <screen><userinput>make STAFF_CLIENT_BUILD_ID=rel_2_0_1 install</userinput></screen>
205 <para>Change to the <application>Evergreen</application> installation
207 <screen><userinput>cd /home/opensrf/Evergreen-ILS-2.0.1</userinput></screen>
210 <para>As the <emphasis>root</emphasis> user, change all files to be owned by the
211 <emphasis>opensrf</emphasis> user and group:</para>
212 <screen><userinput>chown -R opensrf:opensrf /openils</userinput></screen>
215 <para>As the <systemitem class="username">opensrf</systemitem> user, update server symlink in <filename class="directory">/openils/var/web/xul/</filename>:</para>
217 cd /openils/var/web/xul/
219 ln -s rel_2_0_1/server
220 </userinput></screen>
223 <para>Update the <database>evergreen</database> database:</para>
224 <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>
227 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql evergreen
228 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.0-2.0.1-upgrade-db.sql evergreen
231 <note><para>The <filename>1.6.1-2.0-upgrade-db.sql</filename> upgrade script may take a long time (hours) to process
232 on larger systems.<para></note>
235 <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
236 <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
237 the revised NACO normalization routine.</para>
238 <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
239 may take several hours.</para></note>
240 <screen><userinput>perl Open-ILS/src/sql/Pg/reingest-1.6-2.0.pl</userinput></screen>
241 <screen><userinput>psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/reingest-1.6-2.0.sql evergreen</userinput></screen>
244 <para>As the <systemitem class="username">opensrf</systemitem> user,
245 copy <filename>/openils/conf/oils_web.xml.example</filename> to <filename>/openils/conf/oils_web.xml</filename>
246 . (If upgrading from 1.6.1.x, <filename>oils_web.xml</filename> should already exist.)</para>
247 <indexterm><primary>configuration files</primary><secondary>oils_web.xml</secondary></indexterm>
248 <screen><userinput>cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml</userinput></screen>
251 <para>Update <filename>opensrf_core.xml</filename> and <filename>opensrf.xml</filename> by copying the new example files
252 (<filename>/openils/conf/opensrf_core.xml.example</filename> and <filename>/openils/conf/opensrf.xml</filename>).</para>
253 <indexterm><primary>configuration files</primary><secondary>opensrf.xml</secondary></indexterm>
254 <screen><userinput>cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml</userinput></screen>
255 <indexterm><primary>configuration files</primary><secondary>opensrf_core.xml</secondary></indexterm>
256 <screen><userinput>cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml</userinput></screen>
257 <caution><para>Copying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying
258 them.</para></caution>
261 <para>Update <filename>opensrf.xml</filename> with the database connection info:</para>
263 perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config --service all --create-offline --user evergreen \
264 --password evergreen --hostname localhost --port 5432 --database evergreen
265 </userinput></screen>
268 <para>Update /etc/apache2/startup.pl by copying the example from
269 Open-ILS/examples/apache/startup.pl.</para><indexterm><primary>configuration files</primary><secondary>startup.pl</secondary></indexterm>
272 <para>Update /etc/apache2/eg_vhost.conf by copying the example from
273 Open-ILS/examples/apache/eg_vhost.conf.</para><indexterm><primary>configuration files</primary><secondary>eg_vhost.conf</secondary></indexterm>
276 <para>Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/
277 examples/apache/eg.conf.</para><indexterm><primary>configuration files</primary><secondary>eg.conf</secondary></indexterm>
280 <para>Copying these Apache configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying
281 them. For example, if you purchased an SSL certificate, you
282 will need to edit <filename>eg.conf</filename> to point to the appropriate SSL certificate files.</para>
283 <indexterm><primary>SSL</primary><secondary>certificates</secondary></indexterm>
287 <section xml:id="testing_after_upgrade">
288 <title>Restart Evergreen and Test</title>
291 <para>As the <systemitem class="username">opensrf</systemitem> user, start all
292 <application>Evergreen</application> and <application>OpenSRF</application>
294 <screen><userinput>osrf_ctl.sh -l -a start_all</userinput></screen>
297 <para>As the <systemitem class="username">opensrf</systemitem> user, run <command>autogen</command> to refresh the static
298 organizational data files:</para><indexterm><primary>autogen</primary></indexterm>
301 ./autogen.sh -c /openils/conf/opensrf_core.xml -u
302 </userinput></screen>
306 <para>Start <command>srfsh</command> and try logging in using your <application>Evergreen</application>
307 username and password:</para>
309 <userinput>/openils/bin/srfsh</userinput>
310 <prompt>srfsh%</prompt> <userinput>login <option>username</option> <option>password</option></userinput>
314 <para>Start the <application>Apache</application> web server.</para>
318 <para>If you encounter errors, refer to the <link linkend="troubleshooting">troubleshooting
319 section</link> of this documentation for tips
320 on finding solutions and seeking further assistance from the Evergreen community.</para>
323 <section xml:id="upgrading_Postgresqlto8.4">
324 <title>Upgrading PostgreSQL from 8.2 to 8.4 (if required)</title>
325 <para>Evergreen 1.6.1 supports PostgreSQL version 8.4 and it is recommended that you upgrade PostgreSQL when you upgrade Evergreen to 1.6.</para>
326 <note><para>The order of the following steps is very important.</para></note><indexterm><primary>databases</primary><secondary>PostgreSQL</secondary></indexterm>
329 <para>As <systemitem class="username">opensrf</systemitem>, stop the evergreen and opensrf services:</para>
330 <screen><userinput>osrf_ctl.sh -l -a stop_all</userinput></screen>
333 <para><link linkend="backingup">Backup the Evergreen database data</link></para>
336 <para>Upgrade to Postgresql 8.4 by removing old version and installing Postgresql 8.4</para>
339 <para>Create an empty Evergreen database in postgresql 8.4 by issuing the following commands as the postgres user:</para>
342 createdb -E UNICODE evergreen
343 createlang plperl evergreen
344 createlang plperlu evergreen
345 createlang plpgsql evergreen
346 psql -f /usr/share/postgresql/8.4/contrib/tablefunc.sql evergreen
347 psql -f /usr/share/postgresql/8.4/contrib/tsearch2.sql evergreen
348 psql -f /usr/share/postgresql/8.4/contrib/pgxml.sql evergreen
353 <para>As the <systemitem class="username">postgres</systemitem> user on the PostgreSQL server, create a PostgreSQL user named <systemitem class="username">evergreen</systemitem> for the database cluster:</para>
354 <screen><userinput>createuser -P -s evergreen</userinput></screen>
355 <para>Enter the password for the new PostgreSQL superuser (<systemitem class="username">evergreen</systemitem>)</para>
358 <para>Restore data from backup created in step 1.</para>
361 <para>To point tsearch2 to proper function names in 8.4, run the SQL script
362 <filename>/home/opensrf/Evergreen-ILS*/Open-ILS/src/sql/Pg/000.english.pg84.fts-config.sql</filename> using the <command>psql</command> command.</para>
363 <screen><userinput>cd /home/opensrf/Evergreen-ILS*</userinput></screen>
364 <screen><userinput>psql -f /Open-ILS/src/sql/Pg/000.english.pg84.fts-config.sql evergreen</userinput></screen>
367 <para><link linkend="upgraderestart">Restart Evergreen and OpenSRF services</link></para>
370 <para>For additional information regarding upgrading PostgreSQL, see the following documentation in PostgreSQL:</para>
371 <para><ulink url="http://www.postgresql.org/docs/8.4/static/install-upgrading.html" /></para>
372 <para><ulink url="http://www.postgresql.org/docs/8.4/interactive/textsearch-migration.html" />
374 <para><ulink url="http://www.postgresql.org/docs/current/static/tsearch2.html#AEN102824" /></para>