284723e34458b6bc25618a0dcf3da522cd1f7faa
[working/Evergreen.git] / 2.0 / admin / Upgrading-Evergreen-2.0.xml
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
4         <info>\r
5                 <title>Upgrading Evergreen to 2.0</title>\r
6                 <abstract>\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
11                 </abstract>\r
12         </info>    \r
13                 <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem>  or <systemitem class="username">opensrf</systemitem> user.</para>\r
14                 <itemizedlist>\r
15                         <listitem>Debian: To become the <systemitem class="username">root</systemitem> user, issue the <command>su</command> command and enter the password of the \r
16                         <systemitem class="username">root</systemitem> user.</listitem>\r
17                         <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
18                 </itemizedlist>\r
19                 <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
20                 <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
21                 <para>In the following instructions, <filename class='directory'>/path/to/OpenSRF/</filename> represents the path to the OpenSRF source directory.</para>\r
22         <section xml:id="upgradingevergreen-stop_evergreen">\r
23                 <title>Backing Up Data</title>\r
24                 <procedure>\r
25                         <step>\r
26                                 <para>As <systemitem class="username">root</systemitem>, stop the <application>Apache</application> \r
27                                 web server<indexterm><primary>web server</primary><secondary>Apache</secondary></indexterm>.</para>\r
28                         </step>\r
29                         <step>\r
30                                 <para>As the <systemitem class="username">opensrf</systemitem> user, stop all \r
31                                 <application>Evergreen</application>\r
32                                 and <application>OpenSRF</application> services:</para>\r
33                                 <screen><userinput>osrf_ctl.sh -l -a stop_all</userinput></screen>\r
34                         </step>\r
35                         <step>\r
36                                 <para>Back up of the <filename class='directory'>/openils</filename> \r
37                                 directory.</para>\r
38                         </step>\r
39                         <step>\r
40                                 <para><link linkend="backingup">Back up the <application>evergreen\r
41                                 </application> database</link>.</para>\r
42                         </step>\r
43                 </procedure>\r
44         </section>\r
45         <section xml:id="upgradingevergreen-upgradingOpenSRF">\r
46                 <title>Upgrading OpenSRF to 1.6.2</title><indexterm><primary>OpenSRF</primary></indexterm>\r
47                 <procedure>\r
48                         <step>\r
49                                 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract the source files for <application>OpenSRF</application> \r
50                                 1.6.2:</para>\r
51 <screen><userinput>\r
52 wget http://open-ils.org/downloads/OpenSRF-1.6.2.tar.gz\r
53 tar xzf OpenSRF-1.6.2.tar.gz\r
54 </userinput></screen>\r
55                                 <para>A new directory OpenSRF-1.6.2 is created.</para>\r
56                                 <note><para>For the latest edition of OpenSRF, check the Evergreen download page at \r
57                                 <ulink url="http://www.open-ils.org/downloads.php" />.\r
58                                 </para></note>\r
59                         </step>\r
60                         <step>  \r
61                                 <para>As the <systemitem class="username">root</systemitem> user, install the software prerequisites using the automatic \r
62                                 prerequisite installer.</para> \r
63 <screen><userinput>\r
64 aptitude install make\r
65 cd /home/opensrf/OpenSRF-1.6.2\r
66 </userinput></screen>           \r
67                                 <para>Replace <option>[distribution]</option> below with the following value \r
68                                 for your distribution:</para>\r
69                                 <itemizedlist>\r
70                                         \r
71                                         <listitem>\r
72                                                 <para><option>debian-lenny</option> for <systemitem class="osname">Debian Lenny (5.0)</systemitem></para>\r
73                                         </listitem>\r
74                                         <listitem>\r
75                                                 <para><option>debian-squeeze</option> for <systemitem class="osname">Debian Squeeze (6.0)</systemitem>\r
76                                                 <indexterm><primary>Linux</primary><secondary>Debian</secondary></indexterm></para>\r
77                                         </listitem>\r
78                                         <listitem>\r
79                                         <para><option>ubuntu-hardy</option> for <systemitem class="osname">Ubuntu Hardy Heron (8.04)</systemitem>\r
80                                         <indexterm><primary>Linux</primary><secondary>Ubuntu</secondary></indexterm></para>\r
81                                         </listitem>\r
82                                         <listitem>\r
83                                                 <para><option>ubuntu-lucid</option> for <systemitem class="osname">Ubuntu Lucid Lynx\r
84                                                 (10.04)</systemitem></para>\r
85                                         </listitem>\r
86                                         <listitem>\r
87                                                 <para><option>centos</option> for <systemitem class="osname">CentOS 5</systemitem></para>\r
88                                         </listitem>\r
89                                         <listitem>\r
90                                                 <para><option>rhel</option> for <systemitem class="osname">Red Hat Enterprise Linux 5</systemitem></para>\r
91                                         </listitem>\r
92                                 </itemizedlist>\r
93 <screen><userinput>\r
94 cd /path/to/OpenSRF\r
95 make -f src/extras/Makefile.install [distribution]\r
96 </userinput></screen>\r
97                                 <para>This will install a number of packages required by OpenSRF on your system, \r
98                                 including some Perl modules from <systemitem class="resource">CPAN</systemitem><indexterm><primary>Perl</primary><secondary>CPAN</secondary>\r
99                                 </indexterm>. You can type <userinput>no</userinput> to the initial <systemitem class="resource">CPAN</systemitem> \r
100                                 configuration prompt to allow it to automatically configure itself to download \r
101                                 and install Perl modules from <systemitem class="resource">CPAN</systemitem>. The <systemitem class="resource">CPAN</systemitem> installer will ask you a number of \r
102                                 times whether it should install prerequisite modules - type <userinput>yes</userinput>.</para>\r
103                         </step>\r
104                         <step>  \r
105                                 <para>As the <systemitem class="username">opensrf</systemitem> user, configure and compile OpenSRF:</para> \r
106                                 <note>You can include the <option>–enable-python</option> and <option>–enable-java</option> configure options if \r
107                                 you want to include support for Python<indexterm><primary>Python</primary></indexterm> and Java\r
108                                 <indexterm><primary>Java</primary></indexterm>, respectively.</note>\r
109 <screen><userinput>\r
110 cd /home/opensrf/OpenSRF-1.6.2\r
111 ./configure --prefix=/openils --sysconfdir=/openils/conf\r
112 make\r
113 </userinput></screen>           \r
114                         </step>\r
115                         <step>  \r
116                                 <para>As the <systemitem class="username">root</systemitem> user, return to your OpenSRF build directory and install \r
117                                 OpenSRF:</para>\r
118 <screen><userinput>\r
119 cd /home/opensrf/OpenSRF-1.6.2\r
120 make install\r
121 </userinput></screen>\r
122                         </step>\r
123                         <step>\r
124                                 <para>As the <systemitem class="username">root</systemitem> user, change the ownership of the installed files to the \r
125                                 <systemitem class="username">opensrf</systemitem> user:</para>\r
126                                 <screen><userinput>chown -R opensrf:opensrf /openils</userinput></screen>\r
127                         </step>\r
128                         <step>\r
129                                 <para>Restart and Test OpenSRF</para>\r
130 <screen><userinput>\r
131 osrf_ctl.sh -l -a start_all\r
132 /openils/bin/srfsh\r
133 srfsh#  request opensrf.math add 2 2\r
134 </userinput></screen>\r
135                                 <para>You should see output such as:</para>\r
136 <screen>\r
137 Received Data: 4\r
138 \r
139 ------------------------------------\r
140 Request Completed Successfully\r
141 Request Time in seconds: 0.007519\r
142 ------------------------------------\r
143 \r
144 srfsh#\r
145 </screen>       \r
146                                 <para>If test completed successfully move onto the next section. \r
147                                 Otherwise, refer to the <link linkend="troubleshooting">troubleshooting</link> chapter \r
148                                 of this documentation.</para> \r
149                         </step> \r
150                 </procedure>    \r
151         </section>\r
152         <section xml:id="upgradingevergreen-upgrading_from_1.6_to_2.0">\r
153                 <title>Upgrade <application>Evergreen</application> from 1.6.1 to 2.0</title>\r
154                 <procedure>\r
155                         <step>\r
156                                 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract <application>Evergreen 2.0</application>\r
157                                 </para>\r
158 <screen><userinput>\r
159 wget http://www.open-ils.org/downloads/exit\r
160 uEvergreen-ILS-2.0.1.tar.gz\r
161 tar xzf Evergreen-ILS-2.0.1.tar.gz\r
162 </userinput></screen>\r
163                                 <note><para>For the latest edition of Evergreen 2.0, check the Evergreen download page at\r
164                                 <ulink url="http://www.open-ils.org/downloads.php" /> and adjust upgrading instructions accordingly.</para></note>\r
165                         </step>\r
166                         <step>\r
167                                 <para>As the <systemitem class="username">root</systemitem> user, install the prerequisites:</para> \r
168                                 <screen><userinput>cd /home/opensrf/Evergreen-ILS-2.0.1</userinput></screen>    \r
169                                 <para>On the next command, replace <option>[distribution]</option> with one of \r
170                                 these values for your distribution of Debian or Ubuntu:</para>\r
171                                 <itemizedlist>\r
172                                         \r
173                                         <listitem>\r
174                                                 <para><option>debian-squeeze</option> for <systemitem class="osname">Debian Squeeze (6.0)</systemitem></para>\r
175                                         </listitem>\r
176                                         \r
177                                         <listitem>\r
178                                                 <para><option>ubuntu-lucid</option> for  <systemitem class="osname">Ubuntu Lucid Lynx \r
179                                                 (10.04)</systemitem></para>\r
180                                         </listitem>\r
181                                 </itemizedlist>\r
182                                 <screen><userinput>make -f Open-ILS/src/extras/Makefile.install <option>[distribution]</option></userinput></screen>\r
183                         </step>\r
184                         <step>\r
185                                 <para>As the <systemitem class="username">opensrf</systemitem> user, configure and compile \r
186                                 <application>Evergreen</application>:</para>\r
187                                 <screen><userinput>cd /home/opensrf/Evergreen-ILS-2.0.1</userinput></screen>\r
188                                 <screen><userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput></screen>\r
189                                 <screen><userinput>make</userinput></screen>\r
190                         </step>\r
191                         <step>\r
192                                 <para>As the <systemitem class="username">root</systemitem> user, install \r
193                                 <application>Evergreen</application>:</para>\r
194                                 <screen><userinput>make STAFF_CLIENT_BUILD_ID=rel_2_0_1 install</userinput></screen>\r
195                         </step>\r
196                         <step>\r
197                                 <para>Change to the <application>Evergreen</application> installation \r
198                                 directory:</para>\r
199                                 <screen><userinput>cd /home/opensrf/Evergreen-ILS-2.0.1</userinput></screen>\r
200                         </step>\r
201                         <step>\r
202                                 <para>As the <emphasis>root</emphasis> user, change all files to be owned by the \r
203                                 <emphasis>opensrf</emphasis> user and group:</para>\r
204                                 <screen><userinput>chown -R opensrf:opensrf /openils</userinput></screen>\r
205                         </step>                 \r
206                         <step>\r
207                                 <para>As the <systemitem class="username">root</systemitem> user, build <filename>live-db-setup.pl</filename> for the cgi-bin \r
208                                 bootstrapping scripts and <filename>offline-config.pl</filename> for the offline staff client data uploader:</para>\r
209 <screen><userinput>\r
210 cd /home/opensrf/Evergreen-ILS-2.0.1\r
211 perl Open-ILS/src/support-scripts/eg_db_config.pl --create-bootstrap --create-offline \ \r
212 --user evergreen --password evergreen --hostname localhost --port 5432 \\r
213 --database evergreen\r
214 </userinput></screen>\r
215                         </step>\r
216                         <step>\r
217                                 <para>As the <systemitem class="username">opensrf</systemitem> user, update server symlink in <filename class="directory">/openils/var/web/xul/</filename>:</para>\r
218 <screen><userinput>\r
219 cd /openils/var/web/xul/\r
220 rm server\r
221 ln -s rel_1_6_1_5/server\r
222 </userinput></screen>\r
223                         </step>\r
224                         <step>\r
225                                 <para>Update the Evergreen database:</para>\r
226                                 <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
227 <screen>\r
228 <userinput>\r
229 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql evergreen\r
230 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.0-2.0.1-upgrade-db.sql evergreen\r
231 </userinput>\r
232 </screen>       \r
233                         </step>\r
234 <step>\r
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 \r
236                                 <database>evergreen<batabase> database. This is required to make the new facet sidebar in OPAC search results work and to upgrade the keyword indexes to use \r
237                                 the revised NACO normalization routine</para>\r
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 \r
239                                 may take several hours.</para></note>\r
240 <screen><userinput>perl Open-ILS/src/sql/Pg/reingest-1.6-2.0.pl</userinput></screen>\r
241 <screen><userinput>psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/reingest-1.6-2.0.sql evergreen</userinput></screen>\r
242                         </step>\r
243                         <step>\r
244                                 <para>As the <systemitem class="username">opensrf</systemitem> user, \r
245                                 copy <filename>/openils/conf/oils_web.xml.example</filename> to <filename>/openils/conf/oils_web.xml</filename>\r
246                                 <indexterm><primary>configuration files</primary><secondary>oils_web.xml</secondary></indexterm>\r
247                                 (needed for acquisitions templates).</para>\r
248                                 <screen><userinput>cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml</userinput></screen>\r
249                         </step>\r
250                         <step>\r
251                                 <para>Update <filename>opensrf_core.xml</filename> and <filename>opensrf.xml</filename> by copying the new example files \r
252                                 (<filename>/openils/conf/opensrf_core.xml.example</filename> and <filename>/openils/conf/opensrf.xml</filename>).</para>\r
253                                 <indexterm><primary>configuration files</primary><secondary>opensrf.xml</secondary></indexterm>\r
254                                 <screen><userinput>cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml</userinput></screen>\r
255                                 <indexterm><primary>configuration files</primary><secondary>opensrf_core.xml</secondary></indexterm>\r
256                                 <screen><userinput>cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml</userinput></screen>\r
257                         </step>\r
258                         <step>\r
259                                 <para>Update <filename>opensrf.xml</filename> with the database connection info:</para>\r
260 <screen><userinput>\r
261 perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config --service all --user evergreen \\r
262 --password evergreen --hostname localhost --port 5432 --database evergreen\r
263 </userinput></screen>\r
264                         </step>\r
265                         <step>\r
266                                 <para>Update /etc/apache2/startup.pl by copying the example from \r
267                                 Open-ILS/examples/apache/startup.pl.</para><indexterm><primary>configuration files</primary><secondary>startup.pl</secondary></indexterm>\r
268                         </step>\r
269                         <step>\r
270                                 <para>Update /etc/apache2/eg_vhost.conf by copying the example from \r
271                                 Open-ILS/examples/apache/eg_vhost.conf.</para><indexterm><primary>configuration files</primary><secondary>eg_vhost.conf</secondary></indexterm>\r
272                         </step>\r
273                         <step>\r
274                         <para>Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/\r
275                         examples/apache/eg.conf.</para><indexterm><primary>configuration files</primary><secondary>eg.conf</secondary></indexterm>\r
276                         </step>\r
277                         <step>\r
278                                 <para>Recover customizations you have made to the <application>Apache</application><indexterm><primary>Apache</primary></indexterm> \r
279                                 configuration files. For example, if you purchased an SSL certificate, you \r
280                                 will need to edit <filename>eg.conf</filename> to point to the appropriate SSL certificate files.</para>\r
281                                 <indexterm><primary>SSL</primary><secondary>certificates</secondary></indexterm>\r
282                         </step> \r
283                 </procedure>    \r
284         </section>\r
285         <section xml:id="testing_after_upgrade">\r
286                 <title>Restart Evergreen and Test</title>\r
287                 <procedure>\r
288                         <step>\r
289                                 <para>As the <systemitem class="username">opensrf</systemitem> user, start all \r
290                                 <application>Evergreen</application> and <application>OpenSRF</application> \r
291                                 services:</para>\r
292                                 <screen><userinput>osrf_ctl.sh -l -a start_all</userinput></screen>\r
293                         </step>\r
294                         <step>\r
295                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run <command>autogen</command> to refresh the static \r
296                                 organizational data files:</para><indexterm><primary>autogen</primary></indexterm>\r
297 <screen><userinput>\r
298 cd /openils/bin\r
299 ./autogen.sh -c /openils/conf/opensrf_core.xml -u\r
300 </userinput></screen>\r
301                                         \r
302                         </step>\r
303                         <step>\r
304                                 <para>Start <command>srfsh</command> and try logging in  using your <application>Evergreen</application>\r
305                                 username and password:</para>\r
306 <screen>\r
307 <userinput>/openils/bin/srfsh</userinput>\r
308 <prompt>srfsh%</prompt> <userinput>login <option>username</option> <option>password</option></userinput>\r
309 </screen> \r
310                         </step> \r
311                         <step>\r
312                                 <para>Start the <application>Apache</application> web server.</para>\r
313                         </step>\r
314                 </procedure>\r
315                 <note>\r
316                         <para>If you encounter errors, refer to the <link linkend="troubleshooting">troubleshooting \r
317                         section</link> of this documentation for tips \r
318                         on finding solutions and seeking further assistance from the Evergreen community.</para>  \r
319                 </note>\r
320         </section>\r
321         <section xml:id="upgrading_Postgresqlto8.4">\r
322                 <title>Upgrading PostgreSQL from 8.2 to 8.4 (if required)</title>\r
323                 <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>\r
324                 <note><para>The order of the following steps is very important.</para></note><indexterm><primary>databases</primary><secondary>PostgreSQL</secondary></indexterm>\r
325                 <procedure>\r
326                         <step>\r
327                                 <para>As <systemitem class="username">opensrf</systemitem>, stop the evergreen and opensrf services:</para>\r
328                                 <screen><userinput>osrf_ctl.sh -l -a stop_all</userinput></screen>\r
329                         </step>                 \r
330                         <step>\r
331                                 <para><link linkend="backingup">Backup the Evergreen database data</link></para>\r
332                         </step>\r
333                         <step>\r
334                                 <para>Upgrade to Postgresql 8.4 by removing old version and installing Postgresql 8.4</para>\r
335                         </step>\r
336                         <step>                  \r
337                                 <para>Create an empty Evergreen database in postgresql 8.4 by issuing the following commands as the postgres user:</para>\r
338 <screen>\r
339 <userinput>\r
340 createdb -E UNICODE evergreen\r
341 createlang plperl   evergreen\r
342 createlang plperlu  evergreen\r
343 createlang plpgsql  evergreen\r
344 psql -f /usr/share/postgresql/8.4/contrib/tablefunc.sql evergreen\r
345 psql -f /usr/share/postgresql/8.4/contrib/tsearch2.sql evergreen\r
346 psql -f /usr/share/postgresql/8.4/contrib/pgxml.sql evergreen\r
347 </userinput>\r
348 </screen>               \r
349                         </step>\r
350                         <step>\r
351                                 <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>\r
352                                 <screen><userinput>createuser -P -s evergreen</userinput></screen>\r
353                                 <para>Enter the password for the new PostgreSQL superuser (<systemitem class="username">evergreen</systemitem>)</para>  \r
354                         </step>                 \r
355                         <step>\r
356                                 <para>Restore data from backup created in step 1.</para>\r
357                         </step>\r
358                         <step>\r
359                                 <para>To point tsearch2 to proper function names in 8.4, run the SQL script \r
360                                 <filename>/home/opensrf/Evergreen-ILS*/Open-ILS/src/sql/Pg/000.english.pg84.fts-config.sql</filename> using the <command>psql</command> command.</para>\r
361                                 <screen><userinput>cd /home/opensrf/Evergreen-ILS*</userinput></screen>\r
362                                 <screen><userinput>psql -f /Open-ILS/src/sql/Pg/000.english.pg84.fts-config.sql evergreen</userinput></screen>\r
363                         </step>\r
364                         <step>\r
365                                 <para><link linkend="upgraderestart">Restart Evergreen and OpenSRF services</link></para>\r
366                         </step>\r
367                         <step>\r
368                                 <para>For additional information regarding upgrading PostgreSQL, see the following documentation in PostgreSQL:</para>\r
369                                 <para><ulink url="http://www.postgresql.org/docs/8.4/static/install-upgrading.html" /></para>\r
370                                 <para><ulink url="http://www.postgresql.org/docs/8.4/interactive/textsearch-migration.html" /> \r
371                                 </para>\r
372                                 <para><ulink url="http://www.postgresql.org/docs/current/static/tsearch2.html#AEN102824" /></para>\r
373                         </step>\r
374                 </procedure>\r
375         </section>\r
376 </chapter>\r