Move PostgreSQL ifnormation from ServersideInstallation to Admin misc.
[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 from 1.4 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> from version 1.4 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 root <systemitem class="username"></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         <simplesect>\r
23                 <title>Stop Evergreen and back 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         </simplesect>\r
45         <simplesect>\r
46                 <title>Upgrading OpenSRF to 1.4</title><indexterm><primary>OpenSRF</primary><secondary>1.2</secondary></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.4:</para>\r
51 <screen><userinput>\r
52 wget http://open-ils.org/downloads/OpenSRF-1.4.0.tar.gz\r
53 tar xzf OpenSRF-1.4.0.tar.gz\r
54 </userinput></screen>\r
55                                 <para>A new directory OpenSRF-1.4.0 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.4.0\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                                 </itemizedlist>\r
98 <screen><userinput>\r
99 cd /path/to/OpenSRF\r
100 make -f src/extras/Makefile.install [distribution]\r
101 </userinput></screen>\r
102                                 <para>This will install a number of packages required by OpenSRF on your system, \r
103                                 including some Perl modules from <systemitem class="resource">CPAN</systemitem><indexterm><primary>Perl</primary><secondary>CPAN</secondary>\r
104                                 </indexterm>. You can type <userinput>no</userinput> to the initial <systemitem class="resource">CPAN</systemitem> \r
105                                 configuration prompt to allow it to automatically configure itself to download \r
106                                 and install Perl modules from <systemitem class="resource">CPAN</systemitem>. The <systemitem class="resource">CPAN</systemitem> installer will ask you a number of \r
107                                 times whether it should install prerequisite modules - type <userinput>yes</userinput>.</para>\r
108                         </step>\r
109                         <step>  \r
110                                 <para>As the <systemitem class="username">opensrf</systemitem> user, configure and compile OpenSRF:</para> \r
111                                 <note>You can include the <option>–enable-python</option> and <option>–enable-java</option> configure options if \r
112                                 you want to include support for Python<indexterm><primary>Python</primary></indexterm> and Java\r
113                                 <indexterm><primary>Java</primary></indexterm>, respectively.</note>\r
114 <screen><userinput>\r
115 cd /home/opensrf/OpenSRF-1.4.0\r
116 ./configure --prefix=/openils --sysconfdir=/openils/conf\r
117 make\r
118 </userinput></screen>           \r
119                         </step>\r
120                         <step>  \r
121                                 <para>As the <systemitem class="username">root</systemitem> user, return to your OpenSRF build directory and install \r
122                                 OpenSRF:</para>\r
123 <screen><userinput>\r
124 cd /home/opensrf/OpenSRF-1.4.0\r
125 make install\r
126 </userinput></screen>\r
127                         </step>\r
128                         <step>\r
129                                 <para>As the <systemitem class="username">root</systemitem> user, change the ownership of the installed files to the \r
130                                 <systemitem class="username">opensrf</systemitem> user:</para>\r
131                                 <screen><userinput>chown -R opensrf:opensrf /openils</userinput></screen>\r
132                         </step>\r
133                         <step>\r
134                                 <para>Restart and Test OpenSRF</para>\r
135 <screen><userinput>\r
136 osrf_ctl.sh -l -a start_all\r
137 /openils/bin/srfsh\r
138 srfsh#  request opensrf.math add 2 2\r
139 </userinput></screen>\r
140                                 <para>You should see output such as:</para>\r
141 <screen>\r
142 Received Data: 4\r
143 \r
144 ------------------------------------\r
145 Request Completed Successfully\r
146 Request Time in seconds: 0.007519\r
147 ------------------------------------\r
148 \r
149 srfsh#\r
150 </screen>       \r
151                                 <para>If test completed successfully move onto the next section. \r
152                                 Otherwise, refer to the <link linkend="troubleshooting">troubleshooting</link> chapter \r
153                                 of this documentation.</para> \r
154                         </step> \r
155                 </procedure>    \r
156         </simplesect>\r
157         <simplesect>\r
158                 <title>Upgrade <application>Evergreen</application> to 1.6.1.2</title>\r
159                 <procedure>\r
160                         <step>\r
161                                 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract <application>Evergreen 1.6.1.2</application>\r
162                                 </para>\r
163 <screen><userinput>\r
164 wget http://open-ils.org/downloads/Evergreen-ILS-1.6.1.2.tar.gz\r
165 tar xzf Evergreen-ILS-1.6.1.2.tar.gz\r
166 </userinput></screen>\r
167                                 <note><para>For the latest edition of Evergreen check the Evergreen download page at\r
168                                 <ulink url="http://www.open-ils.org/downloads.php" /> and adjust upgrading instructions accordingly.</para></note>\r
169                         </step>\r
170                         <step>\r
171                                 <para>As the <systemitem class="username">root</systemitem> user, install the prerequisites:</para> \r
172                                 <screen><userinput>cd /home/opensrf/Evergreen-ILS-1.6.1.2</userinput></screen>  \r
173                                 <para>On the next command, replace <option>[distribution]</option> with one of \r
174                                 these values for your distribution of Debian or Ubuntu:</para>\r
175                                 <itemizedlist>\r
176                                         <listitem>\r
177                                                 <para><option>debian-etch</option> for <systemitem class="osname">Debian Etch (4.0)</systemitem></para>\r
178                                         </listitem>\r
179                                         <listitem>\r
180                                                 <para><option>debian-lenny</option> for <systemitem class="osname">Debian Lenny (5.0)</systemitem></para>\r
181                                         </listitem>\r
182                                         <listitem>\r
183                                                 <para><option>ubuntu-hardy</option> for <systemitem class="osname">Ubuntu Hardy Heron \r
184                                                 (8.04)</systemitem></para>\r
185                                         </listitem>\r
186                                         <listitem>\r
187                                                 <para><option>ubuntu-intrepid</option> for <systemitem class="osname">Ubuntu Intrepid Ibex \r
188                                                 (8.10)</systemitem></para>\r
189                                         </listitem>\r
190                                         <listitem>\r
191                                                 <para><option>ubuntu-jaunty</option> for <systemitem class="osname">Ubuntu Jaunty Jackalope \r
192                                                 (9.04)</systemitem></para>\r
193                                         </listitem>\r
194                                         <listitem>\r
195                                                 <para><option>ubuntu-karmic</option> for <systemitem class="osname">Ubuntu Karmic Koala \r
196                                                 (9.10)</systemitem></para>\r
197                                         </listitem>\r
198                                         <listitem>\r
199                                                 <para><option>ubuntu-lucid</option> for <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.2</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_2 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.2</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.2\r
232 perl Open-ILS/src/support-scripts/eg_db_config.pl --create-bootstrap --create-offline --user evergreen \\r
233 --password evergreen --hostname localhost --port 5432 --database evergreen\r
234 </userinput></screen>\r
235                         </step>\r
236                         <step>\r
237                                 <para>As the <systemitem class="username">opensrf</systemitem> user, update server symlink in <filename class="directory">/openils/var/web/xul/</filename>:</para>\r
238 <screen><userinput>\r
239 cd /openils/var/web/xul/\r
240 rm server\r
241 ln -s rel_1_6_1_2/server\r
242 </userinput></screen>\r
243                         </step>\r
244                         <step>\r
245                                 <para>Update the Evergreen database:</para>\r
246                                 <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
247 <screen>\r
248 <userinput>\r
249 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.4.0.5-1.6.0.0-upgrade-db.sql evergreen\r
250 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.0.0-1.6.0.1-upgrade-db.sql evergreen\r
251 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.0.1-1.6.0.2-upgrade-db.sql evergreen\r
252 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.0.2-1.6.0.3-upgrade-db.sql evergreen \r
253 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.0.3-1.6.0.4-upgrade-db.sql evergreen\r
254 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.0.4-1.6.1.0-upgrade-db.sql evergreen\r
255 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.0-1.6.1.1-upgrade-db.sql evergreen\r
256 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1.1-1.6.1.2-upgrade-db.sql evergreen\r
257 </userinput>\r
258 </screen>       \r
259                         </step>\r
260                         <step>\r
261                                 <para>As the <systemitem class="username">opensrf</systemitem> user, \r
262                                 copy <filename>/openils/conf/oils_web.xml.example</filename> to <filename>/openils/conf/oils_web.xml</filename>\r
263                                 <indexterm><primary>configuration files</primary><secondary>oils_web.xml</secondary></indexterm>\r
264                                 (needed for acquisitions templates).</para>\r
265                                 <screen><userinput>cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml</userinput></screen>\r
266                         </step>\r
267                         <step>\r
268                                 <para>Update <filename>opensrf_core.xml</filename> and <filename>opensrf.xml</filename> by copying the new example files \r
269                                 (<filename>/openils/conf/opensrf_core.xml.example</filename> and <filename>/openils/conf/opensrf.xml</filename>).</para>\r
270                                 <indexterm><primary>configuration files</primary><secondary>opensrf.xml</secondary></indexterm>\r
271                                 <screen><userinput>cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml</userinput></screen>\r
272                                 <indexterm><primary>configuration files</primary><secondary>opensrf_core.xml</secondary></indexterm>\r
273                                 <screen><userinput>cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml</userinput></screen>\r
274                         </step>\r
275                         <step>\r
276                                 <para>Update <filename>opensrf.xml</filename> with the database connection info:</para>\r
277 <screen><userinput>\r
278 perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config --service all --user evergreen \\r
279 --password evergreen --hostname localhost --port 5432 --database evergreen\r
280 </userinput></screen>\r
281                         </step>\r
282                         <step>\r
283                                 <para>Update /etc/apache2/startup.pl by copying the example from \r
284                                 Open-ILS/examples/apache/startup.pl.</para><indexterm><primary>configuration files</primary><secondary>startup.pl</secondary></indexterm>\r
285                         </step>\r
286                         <step>\r
287                                 <para>Update /etc/apache2/eg_vhost.conf by copying the example from \r
288                                 Open-ILS/examples/apache/eg_vhost.conf.</para><indexterm><primary>configuration files</primary><secondary>eg_vhost.conf</secondary></indexterm>\r
289                         </step>\r
290                         <step>\r
291                         <para>Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/\r
292                         examples/apache/eg.conf.</para><indexterm><primary>configuration files</primary><secondary>eg.conf</secondary></indexterm>\r
293                         </step>\r
294                         <step>\r
295                                 <para>Recover customizations you have made to the <application>Apache</application><indexterm><primary>Apache</primary></indexterm> \r
296                                 configuration files. For example, if you purchased an SSL certificate, you \r
297                                 will need to edit <filename>eg.conf</filename> to point to the appropriate SSL certificate files.</para>\r
298                                 <indexterm><primary>SSL</primary><secondary>certificates</secondary></indexterm>\r
299                         </step> \r
300                 </procedure>    \r
301         </simplesect>\r
302         <simplesect xml:id="upgraderestart">\r
303                 <title>Restart Evergreen and Test</title>\r
304                 <procedure>\r
305                         <step>\r
306                                 <para>As the <systemitem class="username">opensrf</systemitem> user, start all \r
307                                 <application>Evergreen</application> and <application>OpenSRF</application> \r
308                                 services:</para>\r
309                                 <screen><userinput>osrf_ctl.sh -l -a start_all</userinput></screen>\r
310                         </step>\r
311                         <step>\r
312                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run <command>autogen</command> to refresh the static \r
313                                 organizational data files:</para><indexterm><primary>autogen</primary></indexterm>\r
314 <screen><userinput>\r
315 cd /openils/bin\r
316 ./autogen.sh -c /openils/conf/opensrf_core.xml -u\r
317 </userinput></screen>\r
318                                         \r
319                         </step>\r
320                         <step>\r
321                                 <para>Start <command>srfsh</command> and try logging in  using your <application>Evergreen</application>\r
322                                 username and password:</para>\r
323 <screen>\r
324 <userinput>/openils/bin/srfsh</userinput>\r
325 <prompt>srfsh%</prompt> <userinput>login <option>username</option> <option>password</option></userinput>\r
326 </screen> \r
327                         </step> \r
328                         <step>\r
329                                 <para>Start the <application>Apache</application> web server.</para>\r
330                         </step>\r
331                 </procedure>\r
332                 <note>\r
333                         <para>If you encounter errors, refer to the <link linkend="troubleshooting">troubleshooting \r
334                         section</link> of this documentation for tips \r
335                         on finding solutions and seeking further assistance from the Evergreen community.</para>  \r
336                 </note>\r
337         </simplesect>\r
338         <simplesect>\r
339                 <title>Upgrading PostgreSQL from 8.2 to 8.4</title>\r
340                 <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
341                 <note><para>The order of the following steps is very important.</para></note><indexterm><primary>databases</primary><secondary>PostgreSQL</secondary></indexterm>\r
342                 <procedure>\r
343                         <step>\r
344                                 <para>As <systemitem class="username">opensrf</systemitem>, stop the evergreen and opensrf services:</para>\r
345                                 <screen><userinput>osrf_ctl.sh -l -a stop_all</userinput></screen>\r
346                         </step>                 \r
347                         <step>\r
348                                 <para><link linkend="backingup">Backup the Evergreen database data</link></para>\r
349                         </step>\r
350                         <step>\r
351                                 <para>Upgrade to Postgresql 8.4 by removing old version and installing Postgresql 8.4</para>\r
352                         </step>\r
353                         <step>                  \r
354                                 <para>Create an empty Evergreen database in postgresql 8.4 by issuing the following commands as the postgres user:</para>\r
355 <screen>\r
356 <userinput>\r
357 createdb -E UNICODE evergreen\r
358 createlang plperl   evergreen\r
359 createlang plperlu  evergreen\r
360 createlang plpgsql  evergreen\r
361 psql -f /usr/share/postgresql/8.4/contrib/tablefunc.sql evergreen\r
362 psql -f /usr/share/postgresql/8.4/contrib/tsearch2.sql evergreen\r
363 psql -f /usr/share/postgresql/8.4/contrib/pgxml.sql evergreen\r
364 </userinput>\r
365 </screen>               \r
366                         </step>\r
367                         <step>\r
368                                 <para>As the postgres user on the PostgreSQL server, create a PostgreSQL user named <systemitem class="username">evergreen</systemitem> for the database cluster:</para>\r
369                                 <screen><userinput>createuser -P -s evergreen</userinput></screen>\r
370                                 <para>Enter the password for the new PostgreSQL superuser (<systemitem class="username">evergreen</systemitem>)</para>  \r
371                         </step>                 \r
372                         <step>\r
373                                 <para>Restore data from backup created in step 1.</para>\r
374                         </step>\r
375                         <step>\r
376                                 <para>To point tsearch2 to proper function names in 8.4, run the SQL script \r
377                                 <filename>/home/opensrf/Evergreen-ILS*/Open-ILS/src/sql/Pg/000.english.pg83.fts-config.sql</filename> using the <command>psql</command> command.</para>\r
378                                 <screen><userinput>cd /home/opensrf/Evergreen-ILS*</userinput></screen>\r
379                                 <screen><userinput>psql -f /Open-ILS/src/sql/Pg/000.english.pg83.fts-config.sql evergreen</userinput></screen>\r
380                         </step>\r
381                         <step>\r
382                                 <para><link linkend="upgraderestart">Restart Evergreen and OpenSRF services</link></para>\r
383                         </step>\r
384                         <step>\r
385                                 <para>For additional information regarding upgrading PostgreSQL, see the following documentation in PostgreSQL:</para>\r
386                                 <para><ulink url="http://www.postgresql.org/docs/8.4/static/install-upgrading.html" /></para>\r
387                                 <para><ulink url="http://www.postgresql.org/docs/8.4/interactive/textsearch-migration.html" /> \r
388                                 </para>\r
389                                 <para><ulink url="http://www.postgresql.org/docs/current/static/tsearch2.html#AEN102824" /></para>\r
390                         </step>\r
391                 </procedure>\r
392         </simplesect>\r
393 </chapter>\r