remove tool dirctories - these have been moved to a new github dirctory
[working/Evergreen.git] / 1.6 / admin / Upgrading-Evergreen_1.6.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">\r
4         <info>\r
5                 <title>Upgrading Evergreen to 1.6.1</title>\r
6                 <abstract>\r
7                         <para>This Chapter will explain the step-by-step process of upgrading <application>Evergreen\r
8                         </application> to 1.6.1, 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</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:</para>\r
51 <screen><userinput>\r
52 wget http://open-ils.org/downloads/opensrf-1.6.3.tar.gz\r
53 tar xzf opensrf-1.6.3.tar.gz\r
54 </userinput></screen>\r
55                                 <para>A new directory opensrf-1.6.3 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.3\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                                         <listitem>\r
71                                                 <para><option>debian-etch</option> for <systemitem class="osname">Debian Etch (4.0)</systemitem>\r
72                                                 <indexterm><primary>Linux</primary><secondary>Debian</secondary></indexterm></para>\r
73                                         </listitem>\r
74                                         <listitem>\r
75                                                 <para><option>debian-lenny</option> for <systemitem class="osname">Debian Lenny (5.0)</systemitem></para>\r
76                                         </listitem>\r
77                                         <listitem>\r
78                                         <para><option>ubuntu-hardy</option> for <systemitem class="osname">Ubuntu Hardy Heron (8.04)</systemitem>\r
79                                         <indexterm><primary>Linux</primary><secondary>Ubuntu</secondary></indexterm></para>\r
80                                         </listitem>\r
81                                         <listitem>\r
82                                                 <para><option>ubuntu-intrepid</option> for <systemitem class="osname">Ubuntu Intrepid Ibex \r
83                                                 (8.10)</systemitem></para>\r
84                                         </listitem>\r
85                                         <listitem>\r
86                                                 <para><option>ubuntu-jaunty</option> for <systemitem class="osname">Ubuntu Jaunty Jackalope \r
87                                                 (9.04)</systemitem></para>\r
88                                         </listitem>\r
89                                         <listitem>\r
90                                                 <para><option>ubuntu-karmic</option> for <systemitem class="osname">Ubuntu Karmic Koala \r
91                                                 (9.10)</systemitem></para>\r
92                                         </listitem>\r
93                                         <listitem>\r
94                                                 <para><option>ubuntu-lucid</option> for <systemitem class="osname">Ubuntu Lucid Lynx\r
95                                                 (10.04)</systemitem></para>\r
96                                         </listitem>\r
97                                         <listitem>\r
98                                                 <para><option>centos</option> for <systemitem class="osname">CentOS 5</systemitem></para>\r
99                                         </listitem>\r
100                                 </itemizedlist>\r
101 <screen><userinput>\r
102 cd /path/to/OpenSRF\r
103 make -f src/extras/Makefile.install [distribution]\r
104 </userinput></screen>\r
105                                 <para>This will install a number of packages required by OpenSRF on your system, \r
106                                 including some Perl modules from <systemitem class="resource">CPAN</systemitem><indexterm><primary>Perl</primary><secondary>CPAN</secondary>\r
107                                 </indexterm>. You can type <userinput>no</userinput> to the initial <systemitem class="resource">CPAN</systemitem> \r
108                                 configuration prompt to allow it to automatically configure itself to download \r
109                                 and install Perl modules from <systemitem class="resource">CPAN</systemitem>. The <systemitem class="resource">CPAN</systemitem> installer will ask you a number of \r
110                                 times whether it should install prerequisite modules - type <userinput>yes</userinput>.</para>\r
111                         </step>\r
112                         <step>  \r
113                                 <para>As the <systemitem class="username">opensrf</systemitem> user, configure and compile OpenSRF:</para> \r
114                                 <note>You can include the <option>–enable-python</option> and <option>–enable-java</option> configure options if \r
115                                 you want to include support for Python<indexterm><primary>Python</primary></indexterm> and Java\r
116                                 <indexterm><primary>Java</primary></indexterm>, respectively.</note>\r
117 <screen><userinput>\r
118 cd /home/opensrf/opensrf-1.6.3\r
119 ./configure --prefix=/openils --sysconfdir=/openils/conf\r
120 make\r
121 </userinput></screen>           \r
122                         </step>\r
123                         <step>  \r
124                                 <para>As the <systemitem class="username">root</systemitem> user, return to your OpenSRF build directory and install \r
125                                 OpenSRF:</para>\r
126 <screen><userinput>\r
127 cd /home/opensrf/opensrf-1.6.3\r
128 make install\r
129 </userinput></screen>\r
130                         </step>\r
131                         <step>\r
132                                 <para>As the <systemitem class="username">root</systemitem> user, change the ownership of the installed files to the \r
133                                 <systemitem class="username">opensrf</systemitem> user:</para>\r
134                                 <screen><userinput>chown -R opensrf:opensrf /openils</userinput></screen>\r
135                         </step>\r
136                         <step>\r
137                                 <para>Restart and Test OpenSRF</para>\r
138 <screen><userinput>\r
139 osrf_ctl.sh -l -a start_all\r
140 /openils/bin/srfsh\r
141 srfsh#  request opensrf.math add 2 2\r
142 </userinput></screen>\r
143                                 <para>You should see output such as:</para>\r
144 <screen>\r
145 Received Data: 4\r
146 \r
147 ------------------------------------\r
148 Request Completed Successfully\r
149 Request Time in seconds: 0.007519\r
150 ------------------------------------\r
151 \r
152 srfsh#\r
153 </screen>       \r
154                                 <para>If test completed successfully move onto the next section. \r
155                                 Otherwise, refer to the <link linkend="troubleshooting">troubleshooting</link> chapter \r
156                                 of this documentation.</para> \r
157                         </step> \r
158                 </procedure>    \r
159         </section>\r
160         <section xml:id="upgradingevergreen-upgrading_from_1.4_to_1.6.1">\r
161                 <title>Upgrade <application>Evergreen</application> from 1.4 to 1.6.1</title>\r
162                 <procedure>\r
163                         <step>\r
164                                 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract <application>Evergreen 1.6.1.8</application>\r
165                                 </para>\r
166 <screen><userinput>\r
167 wget http://open-ils.org/downloads/Evergreen-ILS-1.6.1.8.tar.gz\r
168 tar xzf Evergreen-ILS-1.6.1.8.tar.gz\r
169 </userinput></screen>\r
170                                 <note><para>For the latest edition of Evergreen check the Evergreen download page at\r
171                                 <ulink url="http://www.open-ils.org/downloads.php" /> and adjust upgrading instructions accordingly.</para></note>\r
172                         </step>\r
173                         <step>\r
174                                 <para>As the <systemitem class="username">root</systemitem> user, install the prerequisites:</para> \r
175                                 <screen><userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.8</userinput></screen>  \r
176                                 <para>On the next command, replace <option>[distribution]</option> with one of \r
177                                 these values for your distribution of Debian or Ubuntu:</para>\r
178                                 <itemizedlist>\r
179                                         <listitem>\r
180                                                 <para><option>debian-etch</option> for <systemitem class="osname">Debian Etch (4.0)</systemitem></para><indexterm><primary>Linux</primary><secondary>Debian</secondary></indexterm>\r
181                                         </listitem>\r
182                                         <listitem>\r
183                                                 <para><option>debian-lenny</option> for <systemitem class="osname">Debian Lenny (5.0)</systemitem></para>\r
184                                         </listitem>\r
185                                         <listitem>\r
186                                                 <para><option>ubuntu-hardy</option> for <systemitem class="osname">Ubuntu Hardy Heron \r
187                                                 (8.04)</systemitem></para><indexterm><primary>Linux</primary><secondary>Ubuntu</secondary></indexterm>\r
188                                         </listitem>\r
189                                         <listitem>\r
190                                                 <para><option>ubuntu-intrepid</option> for <systemitem class="osname">Ubuntu Intrepid Ibex \r
191                                                 (8.10)</systemitem></para>\r
192                                         </listitem>\r
193                                         <listitem>\r
194                                                 <para><option>ubuntu-jaunty</option> for <systemitem class="osname">Ubuntu Jaunty Jackalope \r
195                                                 (9.04)</systemitem></para>\r
196                                         </listitem>\r
197                                         <listitem>\r
198                                                 <para><option>ubuntu-karmic</option> for <systemitem class="osname">Ubuntu Karmic Koala \r
199                                                 (9.10)</systemitem> or <systemitem class="osname">Ubuntu Lucid Lynx \r
200                                                 (10.04)</systemitem></para>\r
201                                         </listitem>\r
202                                 </itemizedlist>\r
203                                 <screen><userinput>make -f Open-ILS/src/extras/Makefile.install <option>[distribution]</option></userinput></screen>\r
204                         </step>\r
205                         <step>\r
206                                 <para>As the <systemitem class="username">opensrf</systemitem> user, configure and compile \r
207                                 <application>Evergreen</application>:</para>\r
208                                 <screen><userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.8</userinput></screen>\r
209                                 <screen><userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput></screen>\r
210                                 <screen><userinput>make</userinput></screen>\r
211                         </step>\r
212                         <step>\r
213                                 <para>As the <systemitem class="username">root</systemitem> user, install \r
214                                 <application>Evergreen</application>:</para>\r
215                                 <screen><userinput>make STAFF_CLIENT_BUILD_ID=rel_1_6_1_8 install</userinput></screen>\r
216                         </step>\r
217                         <step>\r
218                                 <para>Change to the <application>Evergreen</application> installation \r
219                                 directory:</para>\r
220                                 <screen><userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.8</userinput></screen>\r
221                         </step>\r
222                         <step>\r
223                                 <para>As the <emphasis>root</emphasis> user, change all files to be owned by the \r
224                                 <emphasis>opensrf</emphasis> user and group:</para>\r
225                                 <screen><userinput>chown -R opensrf:opensrf /openils</userinput></screen>\r
226                         </step>                 \r
227                         <step>\r
228                                 <para>As the <systemitem class="username">root</systemitem> user, build <filename>live-db-setup.pl</filename> for the cgi-bin \r
229                                 bootstrapping scripts and <filename>offline-config.pl</filename> for the offline staff client data uploader:</para>\r
230 <screen><userinput>\r
231 cd /home/opensrf/Evergreen-ILS-1.6.1.8\r
232 perl Open-ILS/src/support-scripts/eg_db_config.pl --create-bootstrap --create-offline \ \r
233 --user evergreen --password evergreen --hostname localhost --port 5432 \\r
234 --database evergreen\r
235 </userinput></screen>\r
236                         </step>\r
237                         <step>\r
238                                 <para>As the <systemitem class="username">opensrf</systemitem> user, update server symlink in <filename class="directory">/openils/var/web/xul/</filename>:</para>\r
239 <screen><userinput>\r
240 cd /openils/var/web/xul/\r
241 rm server\r
242 ln -s rel_1_6_1_8/server\r
243 </userinput></screen>\r
244                         </step>\r
245                         <step>\r
246                                 <para>Update the Evergreen database:</para>\r
247                                 <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
248 <screen>\r
249 <userinput>\r
250 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.4.0.5-1.6.0.0-upgrade-db.sql evergreen\r
251 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.0.0-1.6.0.1-upgrade-db.sql evergreen\r
252 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.0.1-1.6.0.2-upgrade-db.sql evergreen\r
253 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.0.2-1.6.0.3-upgrade-db.sql evergreen \r
254 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.0.3-1.6.0.4-upgrade-db.sql evergreen\r
255 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.0.4-1.6.1.0-upgrade-db.sql evergreen\r
256 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.0-1.6.1.1-upgrade-db.sql evergreen\r
257 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.1-1.6.1.2-upgrade-db.sql evergreen\r
258 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.2-1.6.1.3-upgrade-db.sql evergreen\r
259 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.3-1.6.1.4-upgrade-db.sql evergreen\r
260 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.4-1.6.1.5-upgrade-db.sql evergreen\r
261 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.5-1.6.1.6-upgrade-db.sql evergreen\r
262 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.6-1.6.1.7-upgrade-db.sql evergreen\r
263 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.8-1.6.1.8-upgrade-db.sql evergreen\r
264 </userinput>\r
265 </screen>       \r
266                         </step>\r
267                         <step>\r
268                                 <para>As the <systemitem class="username">opensrf</systemitem> user, \r
269                                 copy <filename>/openils/conf/oils_web.xml.example</filename> to <filename>/openils/conf/oils_web.xml</filename>\r
270                                 <indexterm><primary>configuration files</primary><secondary>oils_web.xml</secondary></indexterm>\r
271                                 (needed for acquisitions templates).</para>\r
272                                 <screen><userinput>cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml</userinput></screen>\r
273                         </step>\r
274                         <step>\r
275                                 <para>Update <filename>opensrf_core.xml</filename> and <filename>opensrf.xml</filename> by copying the new example files \r
276                                 (<filename>/openils/conf/opensrf_core.xml.example</filename> and <filename>/openils/conf/opensrf.xml</filename>).</para>\r
277                                 <indexterm><primary>configuration files</primary><secondary>opensrf.xml</secondary></indexterm>\r
278                                 <screen><userinput>cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml</userinput></screen>\r
279                                 <indexterm><primary>configuration files</primary><secondary>opensrf_core.xml</secondary></indexterm>\r
280                                 <screen><userinput>cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml</userinput></screen>\r
281                         </step>\r
282                         <step>\r
283                                 <para>Update <filename>opensrf.xml</filename> with the database connection info:</para>\r
284 <screen><userinput>\r
285 perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config --service all --user evergreen \\r
286 --password evergreen --hostname localhost --port 5432 --database evergreen\r
287 </userinput></screen>\r
288                         </step>\r
289                         <step>\r
290                                 <para>Update /etc/apache2/startup.pl by copying the example from \r
291                                 Open-ILS/examples/apache/startup.pl.</para><indexterm><primary>configuration files</primary><secondary>startup.pl</secondary></indexterm>\r
292                         </step>\r
293                         <step>\r
294                                 <para>Update /etc/apache2/eg_vhost.conf by copying the example from \r
295                                 Open-ILS/examples/apache/eg_vhost.conf.</para><indexterm><primary>configuration files</primary><secondary>eg_vhost.conf</secondary></indexterm>\r
296                         </step>\r
297                         <step>\r
298                         <para>Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/\r
299                         examples/apache/eg.conf.</para><indexterm><primary>configuration files</primary><secondary>eg.conf</secondary></indexterm>\r
300                         </step>\r
301                         <step>\r
302                                 <para>Recover customizations you have made to the <application>Apache</application><indexterm><primary>Apache</primary></indexterm> \r
303                                 configuration files. For example, if you purchased an SSL certificate, you \r
304                                 will need to edit <filename>eg.conf</filename> to point to the appropriate SSL certificate files.</para>\r
305                                 <indexterm><primary>SSL</primary><secondary>certificates</secondary></indexterm>\r
306                         </step> \r
307                 </procedure>    \r
308         </section>\r
309         <section xml:id="upgradingevergreen_1.6.0_to_1.6.1">\r
310                 <title>Upgrade <application>Evergreen</application> from 1.6.0 to 1.6.1</title>\r
311                 <procedure>\r
312                         <step>\r
313                                 <para>Follow steps 1-8 of the <link linkend="upgradingevergreen-upgrading_from_1.4_to_1.6.1">instructions for upgrading Evergreen from 1.4</link></para> \r
314                                 \r
315                         </step>\r
316                         <step>\r
317                                 <para>Update the Evergreen database:</para>\r
318                                 <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
319 <screen>\r
320 <userinput>\r
321 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.0.4-1.6.1.0-upgrade-db.sql evergreen\r
322 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.0-1.6.1.1-upgrade-db.sql evergreen\r
323 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.1-1.6.1.2-upgrade-db.sql evergreen\r
324 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.2-1.6.1.3-upgrade-db.sql evergreen\r
325 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.3-1.6.1.4-upgrade-db.sql evergreen\r
326 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.4-1.6.1.5-upgrade-db.sql evergreen\r
327 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.5-1.6.1.6-upgrade-db.sql evergreen\r
328 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.6-1.6.1.7-upgrade-db.sql evergreen\r
329 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.7-1.6.1.8-upgrade-db.sql evergreen\r
330 </userinput>\r
331 </screen>       \r
332                         </step>\r
333                         <step>\r
334                                 <para>Follow steps 10-16 of the <link linkend="upgradingevergreen-upgrading_from_1.4_to_1.6.1">instructions for upgrading Evergreen from 1.4</link></para>\r
335                                 \r
336                         \r
337                         </step>\r
338                 </procedure>    \r
339         </section>\r
340         <section xml:id="testing_after_upgrade">\r
341                 <title>Restart Evergreen and Test</title>\r
342                 <procedure>\r
343                         <step>\r
344                                 <para>As the <systemitem class="username">opensrf</systemitem> user, start all \r
345                                 <application>Evergreen</application> and <application>OpenSRF</application> \r
346                                 services:</para>\r
347                                 <screen><userinput>osrf_ctl.sh -l -a start_all</userinput></screen>\r
348                         </step>\r
349                         <step>\r
350                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run <command>autogen</command> to refresh the static \r
351                                 organizational data files:</para><indexterm><primary>autogen</primary></indexterm>\r
352 <screen><userinput>\r
353 cd /openils/bin\r
354 ./autogen.sh -c /openils/conf/opensrf_core.xml -u\r
355 </userinput></screen>\r
356                                         \r
357                         </step>\r
358                         <step>\r
359                                 <para>Start <command>srfsh</command> and try logging in  using your <application>Evergreen</application>\r
360                                 username and password:</para>\r
361 <screen>\r
362 <userinput>/openils/bin/srfsh</userinput>\r
363 <prompt>srfsh%</prompt> <userinput>login <option>username</option> <option>password</option></userinput>\r
364 </screen> \r
365                         </step> \r
366                         <step>\r
367                                 <para>Start the <application>Apache</application> web server.</para>\r
368                         </step>\r
369                 </procedure>\r
370                 <note>\r
371                         <para>If you encounter errors, refer to the <link linkend="troubleshooting">troubleshooting \r
372                         section</link> of this documentation for tips \r
373                         on finding solutions and seeking further assistance from the Evergreen community.</para>  \r
374                 </note>\r
375         </section>\r
376         <section xml:id="upgrading_Postgresqlto8.4">\r
377                 <title>Upgrading PostgreSQL from 8.2 to 8.4</title>\r
378                 <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
379                 <note><para>The order of the following steps is very important.</para></note><indexterm><primary>databases</primary><secondary>PostgreSQL</secondary></indexterm>\r
380                 <procedure>\r
381                         <step>\r
382                                 <para>As <systemitem class="username">opensrf</systemitem>, stop the evergreen and opensrf services:</para>\r
383                                 <screen><userinput>osrf_ctl.sh -l -a stop_all</userinput></screen>\r
384                         </step>                 \r
385                         <step>\r
386                                 <para><link linkend="backingup">Backup the Evergreen database data</link></para>\r
387                         </step>\r
388                         <step>\r
389                                 <para>Upgrade to Postgresql 8.4 by removing old version and installing Postgresql 8.4</para>\r
390                         </step>\r
391                         <step>                  \r
392                                 <para>Create an empty Evergreen database in postgresql 8.4 by issuing the following commands as the postgres user:</para>\r
393 <screen>\r
394 <userinput>\r
395 createdb -E UNICODE evergreen\r
396 createlang plperl   evergreen\r
397 createlang plperlu  evergreen\r
398 createlang plpgsql  evergreen\r
399 psql -f /usr/share/postgresql/8.4/contrib/tablefunc.sql evergreen\r
400 psql -f /usr/share/postgresql/8.4/contrib/tsearch2.sql evergreen\r
401 psql -f /usr/share/postgresql/8.4/contrib/pgxml.sql evergreen\r
402 </userinput>\r
403 </screen>               \r
404                         </step>\r
405                         <step>\r
406                                 <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
407                                 <screen><userinput>createuser -P -s evergreen</userinput></screen>\r
408                                 <para>Enter the password for the new PostgreSQL superuser (<systemitem class="username">evergreen</systemitem>)</para>  \r
409                         </step>                 \r
410                         <step>\r
411                                 <para>Restore data from backup created in step 1.</para>\r
412                         </step>\r
413                         <step>\r
414                                 <para>To point tsearch2 to proper function names in 8.4, run the SQL script \r
415                                 <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
416                                 <screen><userinput>cd /home/opensrf/Evergreen-ILS*</userinput></screen>\r
417                                 <screen><userinput>psql -f /Open-ILS/src/sql/Pg/000.english.pg84.fts-config.sql evergreen</userinput></screen>\r
418                         </step>\r
419                         <step>\r
420                                 <para><link linkend="startingopensrf">Restart Evergreen and OpenSRF services</link></para>\r
421                         </step>\r
422                         <step>\r
423                                 <para>For additional information regarding upgrading PostgreSQL, see the following documentation in PostgreSQL:</para>\r
424                                 <para><ulink url="http://www.postgresql.org/docs/8.4/static/install-upgrading.html" /></para>\r
425                                 <para><ulink url="http://www.postgresql.org/docs/8.4/interactive/textsearch-migration.html" /> \r
426                                 </para>\r
427                                 <para><ulink url="http://www.postgresql.org/docs/current/static/tsearch2.html#AEN102824" /></para>\r
428                         </step>\r
429                 </procedure>\r
430         </section>\r
431 </chapter>\r