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