086d471780ddcc4aa7bb8907ff4817d12b916182
[working/Evergreen.git] / admin / upgrading.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 2.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 2.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                         \r
12                 </abstract>\r
13         </info>    \r
14                 <para>Evergreen 2.0 has several software requirements:</para>\r
15                 <itemizedlist>\r
16                         <listitem>PostgreSQL: Version 9.0 is the minimum supported version of PostgreSQL. </listitem>\r
17                         <listitem>Linux: Evergreen 2.0 has been tested on Debian Squeeze (6.0) and Ubuntu Lucid Lynx (10.04). If you are running an older version of \r
18                         these distributions, you may want to upgrade before installing Evergreen 2.1. For instructions on upgrading these distributions, visit the \r
19                         <ulink url="http://www.debian.org/releases/squeeze/">Debian</ulink> or <ulink url="https://help.ubuntu.com/community/LucidUpgrades">Ubuntu</ulink> websites.</listitem>\r
20                 </itemizedlist>\r
21                 <para>In the following instructions, you are asked to perform certain steps as either the <systemitem class="username">root</systemitem>  or \r
22                 <systemitem class="username">opensrf</systemitem> user.</para>\r
23                 <itemizedlist>\r
24                         <listitem>Debian: To become the <systemitem class="username">root</systemitem> user, issue the <command>su</command> command and enter the password of the \r
25                         <systemitem class="username">root</systemitem> user.</listitem>\r
26                         <listitem>Ubuntu: To become the <systemitem class="username">root</systemitem> user, issue the <command>sudo su</command> command and enter the password of your current user.</listitem>\r
27                 </itemizedlist>\r
28                 <para>To switch from the <systemitem class="username">root</systemitem> user to a different user, issue the <command>su - [user]</command> command; for example, \r
29                 <command>su - opensrf</command>. Once you have become a non-root user, to become the <systemitem class="username">root</systemitem> user again simply issue the exit command.</para> \r
30                 <para>In the following instructions, <filename class='directory'>/path/to/OpenSRF/</filename> represents the path to the OpenSRF source directory.</para>\r
31         \r
32                 <procedure>\r
33                         <step>\r
34                                 <para>Stop Evergreen and back up your data:</para>\r
35                                 <substeps>\r
36                                         <step>\r
37                                                 <para>As <systemitem class="username">root</systemitem>, stop the <application>Apache</application> \r
38                                                 web server<indexterm><primary>web server</primary><secondary>Apache</secondary></indexterm>.</para>\r
39                                         </step>\r
40                                         <step>\r
41                                                 <para>As the <systemitem class="username">opensrf</systemitem> user, stop all \r
42                                                 <application>Evergreen</application>\r
43                                                 and <application>OpenSRF</application> services:</para>\r
44                                                 <screen><userinput>osrf_ctl.sh -l -a stop_all</userinput></screen>\r
45                                         </step>\r
46                                         <step>\r
47                                                 <para>Back up of the <filename class='directory'>/openils</filename> \r
48                                                 directory.</para>\r
49                                         </step>\r
50                                         <step>\r
51                                                 <para>Back up the <application>evergreen\r
52                                                 </application> database.</para>\r
53                                         </step>\r
54                                 </substeps>\r
55                         </step>\r
56                         <step>\r
57                                 <para>Upgrade OpenSRF to the latest edition.</para>\r
58                                 <note><para>You may skip this step if the latest version of OpenSRF 2.0.x was previously installed.</para></note>\r
59                                 <para>Download and install the latest version of Opensrf from the <ulink url="http://open-ils.org/opensrf.php">OpenSRF download page.</ulink></para>\r
60                         </step>\r
61                         <step>\r
62                                 <para>As the <systemitem class="username">opensrf</systemitem> user, download and extract <application>Evergreen 2.1</application>\r
63                                 </para>\r
64 <screen><userinput>\r
65 wget http://www.open-ils.org/downloads/Evergreen-ILS-2.1.1.tar.gz\r
66 tar xzf Evergreen-ILS-2.1.1.tar.gz\r
67 </userinput></screen>\r
68                                 <note><para>For the latest edition of Evergreen 2.1, check the Evergreen download page at\r
69                                 <ulink url="http://www.open-ils.org/downloads.php" /> and adjust upgrading instructions accordingly.</para></note>\r
70                         </step>\r
71                         <step>\r
72                                 <para>As the <systemitem class="username">root</systemitem> user, install the prerequisites:</para> \r
73                                 <screen><userinput>cd /home/opensrf/Evergreen-ILS-2.1.1</userinput></screen>    \r
74                                 <para>On the next command, replace <option>[distribution]</option> with one of \r
75                                 these values for your distribution of Debian or Ubuntu:</para>\r
76                                 <itemizedlist>\r
77                                         \r
78                                         <listitem>\r
79                                                 <para><option>debian-squeeze</option> for <systemitem class="osname">Debian Squeeze (6.0)</systemitem></para>\r
80                                         </listitem>\r
81                                         \r
82                                         <listitem>\r
83                                                 <para><option>ubuntu-lucid</option> for  <systemitem class="osname">Ubuntu Lucid Lynx \r
84                                                 (10.04)</systemitem></para>\r
85                                         </listitem>\r
86                                 </itemizedlist>\r
87                                 <screen><userinput>make -f Open-ILS/src/extras/Makefile.install <option>[distribution]</option></userinput></screen>\r
88                         </step>\r
89                         <step>\r
90                                 <para>As the <systemitem class="username">opensrf</systemitem> user, configure and compile \r
91                                 <application>Evergreen</application>:</para>\r
92                                 <screen><userinput>cd /home/opensrf/Evergreen-ILS-2.1.1</userinput></screen>\r
93                                 <screen><userinput>./configure --prefix=/openils --sysconfdir=/openils/conf</userinput></screen>\r
94                                 <screen><userinput>make</userinput></screen>\r
95                         </step>\r
96                         <step>\r
97                                 <para>As the <systemitem class="username">root</systemitem> user, install \r
98                                 <application>Evergreen</application>:</para>\r
99                                 <screen><userinput>make STAFF_CLIENT_BUILD_ID=rel_2_1_1 install</userinput></screen>\r
100                         </step>\r
101                         <step>\r
102                                 <para>As the <emphasis>root</emphasis> user, change all files to be owned by the \r
103                                 <emphasis>opensrf</emphasis> user and group:</para>\r
104                                 <screen><userinput>chown -R opensrf:opensrf /openils</userinput></screen>\r
105                         </step>                                         \r
106                         <step>\r
107                                 <para>As the <systemitem class="username">opensrf</systemitem> user, update configuration files:</para>\r
108 <screen><userinput>\r
109 cd /home/opensrf/Evergreen-ILS-2.1.1\r
110 # and offline-config.pl for the offline staff client data uploader\r
111 perl Open-ILS/src/support-scripts/eg_db_config.pl \\r
112   --create-offline --user evergreen --password evergreen \\r
113   --hostname localhost --port 5432 --database evergreen\r
114 </userinput></screen>\r
115                         </step> \r
116 \r
117                         <step>\r
118                                 <para>As the <systemitem class="username">opensrf</systemitem> user, update server symlink in <filename class="directory">/openils/var/web/xul/</filename>:</para>\r
119 <screen><userinput>\r
120 cd /openils/var/web/xul/\r
121 rm server\r
122 ln -s rel_2_1_1/server\r
123 </userinput></screen>\r
124                         </step>\r
125                         <step>\r
126                                 <para>Change to the <application>Evergreen</application> installation \r
127                                 directory:</para>\r
128 <screen><userinput>cd /home/opensrf/Evergreen-ILS-2.1.1</userinput></screen>\r
129                         </step>\r
130 \r
131                         <step>\r
132                                 <para>Update the <database>evergreen</database> database:</para>\r
133                                 <note><para>It is recommended that you <link linkend="backingup">back up your Evergreen database</link> in order to restore your data if \r
134                                 anything goes wrong.</para></note>\r
135                                 \r
136                                 <para>If you were running Evergreen 2.0.x on PostgreSQL 8.4, you will need to upgrade to PostgreSQL 9.0:</para>\r
137                                 <substeps>\r
138                                         <title>Upgrade to PostgreSQL 9.0</title>\r
139                                         <step>                                  \r
140                                                 <para>Install the PostgreSQL 9.0 server packages following the \r
141                                                 <link linkend="_creating_the_evergreen_database">installation instructions</link>. Pay close attention to the backports section.</para>\r
142                                         </step>\r
143                                         <step>                          \r
144                                                 <para> Upgrade your existing PostgreSQL 8.4 cluster to a PostgreSQL 9.0 cluster by issuing the following commands as \r
145                                                 <systemitem class="username">root</systemitem>:\r
146                                                 </para>\r
147                                                 <substeps>\r
148                                                         <step>\r
149                                                                 <para>Blow away the default PostgreSQL 9.0 main cluster:</para>\r
150 <screen><userinput>pg_dropcluster 9.0 main</userinput></screen> \r
151                                                         </step>\r
152                                                         <step>\r
153                                                                 <para>Upgrade your production PostgreSQL 8.4 main cluster</para>\r
154 <screen><userinput>pg_upgradecluster --stop 8.4 main</userinput></screen> \r
155                                                         </step>\r
156                                                         <step>\r
157                                                                 <para>OPTIONAL: Blow away your old PostgreSQL 8.4 main cluster. If you don't do this, then you might need to \r
158                                                                 update <filename>opensrf.xml</filename> with new port numbers (probably 5433)</para>\r
159 <screen><userinput>pg_dropcluster 8.4 main</userinput></screen> \r
160                                                         </step>\r
161                                                 </substeps>\r
162                                         </step>\r
163                                         <step>\r
164                                                         <para>Add the hstore PostgreSQL contrib module to your Evergreen database:</para>\r
165 <screen><userinput>\r
166 psql -U evergreen -h localhost -f /usr/share/postgresql/9.0/contrib/hstore.sql -d evergreen\r
167 </userinput></screen> \r
168                                         </step>\r
169                                 </substeps>\r
170                         </step>\r
171                         <step>\r
172                                 <para>Upgrade Evergreen Schema.</para>\r
173                                 <caution><para>Pay attention to error output as you run these scripts. You should do additional troubleshooting and error reporting to the  \r
174                                 <ulink url="http://libmail.georgialibraries.org/mailman/listinfo/open-ils-dev"> Evergreen Developer List</ulink> if you encounter errors.\r
175                                 </para></caution> \r
176 <screen>\r
177 <userinput>\r
178 cd /home/opensrf/Evergreen-ILS-2.1.1\r
179 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0-2.1-upgrade-db.sql evergreen\r
180 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.1.0-2.1.1-upgrade-db.sql evergreen\r
181 </userinput>\r
182 </screen>               \r
183                         </step>\r
184 \r
185                         <step>\r
186                                 <para>As the <systemitem class="username">opensrf</systemitem> user, \r
187                                 copy <filename>/openils/conf/oils_web.xml.example</filename> to <filename>/openils/conf/oils_web.xml</filename>\r
188                                 . (If upgrading from 1.6.1.x, <filename>oils_web.xml</filename> should already exist.)</para>\r
189                                 <indexterm><primary>configuration files</primary><secondary>oils_web.xml</secondary></indexterm>\r
190                                 <screen><userinput>cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml</userinput></screen>\r
191                         </step>\r
192                         <step>\r
193                                 <para>Update <filename>opensrf_core.xml</filename> and <filename>opensrf.xml</filename> by copying the new example files \r
194                                 (<filename>/openils/conf/opensrf_core.xml.example</filename> and <filename>/openils/conf/opensrf.xml</filename>).</para>\r
195                                 <indexterm><primary>configuration files</primary><secondary>opensrf.xml</secondary></indexterm>\r
196                                 <screen><userinput>cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml</userinput></screen>\r
197                                 <indexterm><primary>configuration files</primary><secondary>opensrf_core.xml</secondary></indexterm>\r
198                                 <screen><userinput>cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml</userinput></screen>\r
199                                 <caution><para>Copying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying \r
200                                 them.</para></caution>\r
201                         </step>\r
202                         <step>\r
203                                 <substeps>\r
204                                         <title>Update Apache Files</title>\r
205                                         <caution>\r
206                                                 <para>Copying these Apache configuration files will remove any customizations you have made to them. Remember to redo \r
207                                                 your customizations after copying them. For example, if you purchased an SSL certificate, you \r
208                                                 will need to edit <filename>eg.conf</filename> to point to the appropriate SSL certificate files.</para>\r
209                                                 <indexterm><primary>SSL</primary><secondary>certificates</secondary></indexterm>\r
210                                         </caution> \r
211                                         <step>\r
212                                                 <para>Update <filename>/etc/apache2/startup.pl</filename> by copying the example from \r
213                                                 <filename>Open-ILS/examples/apache/startup.pl</filename>.\r
214                                                 </para><indexterm><primary>configuration files</primary><secondary>startup.pl</secondary></indexterm>\r
215                                         </step>\r
216                 \r
217                                         <step>\r
218                                                 <para>Update /etc/apache2/eg_vhost.conf by copying the example from \r
219                                                 Open-ILS/examples/apache/eg_vhost.conf.</para><indexterm><primary>configuration files</primary><secondary>eg_vhost.conf\r
220                                                 </secondary></indexterm>\r
221                                         </step>\r
222                                         <step>\r
223                                         <para>Update <filename>/etc/apache2/sites-available/eg.conf</filename> by copying the example from <filename>Open-ILS/\r
224                                         examples/apache/eg.conf</filename>.</para><indexterm><primary>configuration files</primary><secondary>eg.conf</secondary></indexterm>\r
225                                         </step>\r
226                                 </substeps>\r
227                         </step>\r
228                         <step>\r
229                                 <para>Update <filename>opensrf.xml</filename> with the database connection info:</para>\r
230                                 <para>If you are happy with the default settings in opensrf.xml.example, then:</para>\r
231 <screen><userinput>\r
232 cp -b /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml\r
233 perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config --service all \\r
234   --database evergreen --host localhost --user evergreen --password evergreen\r
235 </userinput></screen>\r
236                                 <para>Otherwise, compare /openils/conf/opensrf.xml with /openils/conf/opensrf.xml and manually copy the new pieces into place \r
237                                 in your existing opensrf.xml file</para>\r
238                         </step>\r
239                         <step>\r
240                                 <para>As of Evergreen 2.1.1, the Perl modules are installed in the normal location on the system. To avoid conflicting versions, get the old versions of                                        Perl modules out of your PERL5LIB path. Issue the following command as the opensrf user:</para>\r
241 <screen><userinput>\r
242 mv /openils/lib/perl5 /openils/lib/perl5-2.0\r
243 </userinput></screen>\r
244                         </step>\r
245                 \r
246                 </procedure>    \r
247         <simplesect xml:id="testing_after_upgrade">\r
248                 <title>Restart Evergreen and Test</title>\r
249                 <procedure>\r
250                         <step>\r
251                                 <para>As the <systemitem class="username">opensrf</systemitem> user, start all \r
252                                 <application>Evergreen</application> and <application>OpenSRF</application> \r
253                                 services:</para>\r
254                                 <screen><userinput>osrf_ctl.sh -l -a start_all</userinput></screen>\r
255                         </step>\r
256                         <step>\r
257                                 <para>As the <systemitem class="username">opensrf</systemitem> user, run <command>autogen</command> to refresh the static \r
258                                 organizational data files:</para><indexterm><primary>autogen</primary></indexterm>\r
259 <screen><userinput>\r
260 cd /openils/bin\r
261 ./autogen.sh -c /openils/conf/opensrf_core.xml -u\r
262 </userinput></screen>\r
263                                         \r
264                         </step>\r
265                         <step>\r
266                                 <para>Start <command>srfsh</command> and try logging in  using your <application>Evergreen</application>\r
267                                 username and password:</para>\r
268 <screen>\r
269 <userinput>/openils/bin/srfsh</userinput>\r
270 <prompt>srfsh%</prompt> <userinput>login <option>username</option> <option>password</option></userinput>\r
271 </screen> \r
272                         </step> \r
273                         <step>\r
274                                 <para>Start the <application>Apache</application> web server.</para>\r
275                         </step>\r
276                 </procedure>\r
277                 <note>\r
278                         <para>If you encounter errors, refer to the <link linkend="troubleshooting">troubleshooting \r
279                         section</link> of this documentation for tips \r
280                         on finding solutions and seeking further assistance from the Evergreen community.</para>  \r
281                 </note>\r
282         </simplesect>\r
283 </chapter>\r