]> git.evergreen-ils.org Git - Evergreen.git/blob - docs/installation/server_upgrade.txt
Fix formatting in upgrade instructions
[Evergreen.git] / docs / installation / server_upgrade.txt
1 Upgrading the Evergreen Server
2 ------------------------------
3 Before upgrading, it is important to carefully plan an upgrade strategy to minimize system downtime and service interruptions.
4 All of the steps in this chapter are to be completed from the command line.
5
6 Software Prerequisites:
7 ~~~~~~~~~~~~~~~~~~~~~~~
8
9   * **PostgreSQL**: Version 9.1 is recommended. The minimum supported version
10     is 9.1.
11   * **Linux**: Evergreen 2.4 has been tested on Debian Squeeze (6.0),
12     Ubuntu Lucid Lynx (10.04) and Ubuntu Precise Pangolin (12.04). If you are
13     running an older version of these distributions, you may want to upgrade
14     before upgrading Evergreen. For instructions on upgrading these
15     distributions, visit the Debian or Ubuntu websites.
16   * **OpenSRF**: The minimum supported version of OpenSRF is 2.2.0.
17
18 In the following instructions, you are asked to perform certain steps as either the root or opensrf user.
19
20   * **Debian**: To become the root user, issue the `su` command and enter the password of the root user.
21   * **Ubuntu**: To become the root user, issue the `sudo su` command and enter the password of your current user.
22
23 To switch from the root user to a different user, issue the `su - [user]`
24 command; for example, `su - opensrf`. Once you have become a non-root user, to
25 become the root user again simply issue the `exit` command.
26
27 Upgrade the Evergreen code
28 ~~~~~~~~~~~~~~~~~~~~~~~~~~
29 The following steps guide you through a simplistic upgrade of a production
30 server. You must adjust these steps to accommodate your customizations such
31 as catalogue skins.
32
33 . Stop Evergreen and back up your data:
34  .. As root, stop the Apache web server.
35  .. As the opensrf user, stop all Evergreen and OpenSRF services:
36 +
37 [source, bash]
38 -----------------------------
39 osrf_ctl.sh -l -a stop_all
40 -----------------------------
41 +
42  .. Back up the /openils directory.
43 . Upgrade OpenSRF. Download and install the latest version of OpenSRF from
44 the http://evergreen-ils.org/opensrf.php[OpenSRF download page].
45 . As the opensrf user, download and extract Evergreen 2.4:
46 +
47 [source, bash]
48 -----------------------------------------------
49 wget http://evergreen-ils.org/downloads/Evergreen-ILS-2.4.2.tar.gz
50 tar xzf Evergreen-ILS-2.4.2.tar.gz
51 -----------------------------------------------
52 +
53 [NOTE]
54 For the latest edition of Evergreen, check the http://evergreen-ils.org/downloads.php[Evergreen download page] and adjust upgrading instructions accordingly.
55 +
56 . As the root user, install the prerequisites:
57 +
58 [source, bash]
59 ----------------------------------------------
60 cd /home/opensrf/Evergreen-ILS-2.4.2
61 ---------------------------------------------
62 +
63 On the next command, replace `[distribution]` with one of these values for your
64 distribution of Debian or Ubuntu:
65 +
66 indexterm:[Linux, Debian]
67 indexterm:[Linux, Ubuntu]
68 +
69   * `debian-squeeze` for Debian Squeeze (6.0)
70   * `ubuntu-lucid` for Ubuntu Lucid Lynx (10.04)
71   * `ubuntu-precise` for Ubuntu Precise Pangolin (12.04)
72 +
73 [source, bash]
74 ------------------------------------------------------------
75 make -f Open-ILS/src/extras/Makefile.install [distribution]
76 ------------------------------------------------------------
77 +
78 . As the opensrf user, configure and compile Evergreen:
79 +
80 [source, bash]
81 ------------------------------------------------------------
82 cd /home/opensrf/Evergreen-ILS-2.4.2
83 ./configure --prefix=/openils --sysconfdir=/openils/conf
84 make
85 ------------------------------------------------------------
86 +
87 . As the root user, install Evergreen:
88 +
89 [source, bash]
90 ------------------------------------------------------------
91 cd /home/opensrf/Evergreen-ILS-2.4.2
92 make STAFF_CLIENT_STAMP_ID=rel_2_4_2 install
93 ------------------------------------------------------------
94 +
95 . As the root user, change all files to be owned by the opensrf user and group:
96 +
97 [source, bash]
98 ------------------------------------------------------------
99 chown -R opensrf:opensrf /openils
100 ------------------------------------------------------------
101 +
102 . As the opensrf user, update the server symlink in /openils/var/web/xul/:
103 +
104 [source, bash]
105 -----------------------------------------------------------
106 cd /openils/var/web/xul/
107 rm server
108 ln -sf rel_2_4_2/server server
109 ----------------------------------------------------------
110 +
111 . As the opensrf user, update opensrf_core.xml and opensrf.xml by copying the
112   new example files (/openils/conf/opensrf_core.xml.example and
113   /openils/conf/opensrf.xml). The _-b_ option creates a backup copy of the old file.
114 +
115 [source, bash]
116 ----------------------------------------------------------
117 cp -b /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
118 cp -b /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
119 ----------------------------------------------------------
120 +
121 [CAUTION]
122 Copying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
123 +
124 . As the opensrf user, update the configuration files:
125 +
126 [source, bash]
127 -------------------------------------------------------------------------
128 cd /home/opensrf/Evergreen-ILS-2.4.2
129 perl Open-ILS/src/support-scripts/eg_db_config --update-config --service all \
130 --create-offline --database evergreen --host localhost --user evergreen --password evergreen
131 -------------------------------------------------------------------------
132 +
133 . As the _root_ user, update the Apache files:
134 +
135 indexterm:[Apache]
136 +
137 [CAUTION]
138 Copying these Apache configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
139 For example, if you purchased an SSL certificate, you will need to edit eg.conf to point to the appropriate SSL certificate files.
140 +
141 .. Update _/etc/apache2/eg_startup_ by copying the example from _Open-ILS/examples/apache/eg_startup_.
142 +
143 [source, bash]
144 ----------------------------------------------------------
145 cp /home/opensrf/Evergreen-ILS-2.4.2/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup 
146 ----------------------------------------------------------
147 +
148 .. Update /etc/apache2/eg_vhost.conf by copying the example from Open-ILS/examples/apache/eg_vhost.conf.
149 +
150 [source, bash]
151 ----------------------------------------------------------
152 cp /home/opensrf/Evergreen-ILS-2.4.2/Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/eg_vhost.conf 
153 ----------------------------------------------------------
154 +
155 .. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/examples/apache/eg.conf.
156 +
157 [source, bash]
158 ----------------------------------------------------------
159 cp /home/opensrf/Evergreen-ILS-2.4.2/Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/eg.conf 
160 ----------------------------------------------------------
161
162 Upgrade the Evergreen database schema
163 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
164
165 indexterm:[database schema]
166
167 The upgrade of the Evergreen database schema is the lengthiest part of the
168 upgrade process for sites with a significant amount of production data.
169
170 Before running the upgrade script against your production Evergreen database,
171 back up your database, restore it to a test server, and run the upgrade script
172 against the test server. This enables you to determine how long the upgrade
173 will take and whether any local customizations present problems for the
174 stock upgrade script that require further tailoring of the upgrade script.
175 The backup also enables you to cleanly restore your production data if
176 anything goes wrong during the upgrade.
177
178 [CAUTION]
179 Pay attention to error output as you run the upgrade scripts. If you encounter errors
180 that you cannot resolve yourself through additional troubleshooting, please
181 report the errors to the http://evergreen-ils.org/listserv.php[Evergreen
182 Technical Discussion List].
183
184 Run the following steps as a user with the ability to connect to the
185 database server. Please adjust the arguments to the `psql` command and
186 the `PG*` environment variables for the `2.3-2.4-supplemental.sh` command
187 to reflect your database server connection information.  To supply the
188 pasword, you can create a 
189 http://www.postgresql.org/docs/9.1/static/libpq-pgpass.html[PostgreSQL password file].
190
191 [source, bash]
192 ----------------------------------------------------------
193 cd /home/opensrf/Evergreen-ILS-2.4.2/Open-ILS/src/sql/Pg
194 psql -U evergreen -h localhost -f version-upgrade/2.3-2.4.0-upgrade-db.sql evergreen
195 PGDATABASE=evergreen PGUSER=evergreen PGHOST=localhost version-upgrade/2.3-2.4-supplemental.sh
196 psql -U evergreen -h localhost -f version-upgrade/2.4.0-2.4.1-upgrade-db.sql evergreen
197 ----------------------------------------------------------
198
199 Restart Evergreen and Test
200 ~~~~~~~~~~~~~~~~~~~~~~~~~~
201 . As the opensrf user, start all Evergreen and OpenSRF services:
202 +
203 [source, bash]
204 --------------------------------------------------------------
205 osrf_ctl.sh -l -a start_all
206 --------------------------------------------------------------
207 +
208 . As the opensrf user, run autogen to refresh the static organizational data files:
209 +
210 [source, bash]
211 --------------------------------------------------------------
212 cd /openils/bin
213 ./autogen.sh
214 --------------------------------------------------------------
215 +
216 . Start srfsh and try logging in using your Evergreen username and password:
217 +
218 [source, bash]
219 --------------------------------------------------------------
220 /openils/bin/srfsh
221 srfsh% login username password
222 --------------------------------------------------------------
223 +
224 You should see a result like:
225 +
226 [source, bash]
227 ------------------------------------------------------
228 Received Data: "250bf1518c7527a03249858687714376"
229     ------------------------------------
230     Request Completed Successfully
231     Request Time in seconds: 0.045286
232     ------------------------------------
233
234     Received Data: {
235        "ilsevent":0,
236        "textcode":"SUCCESS",
237        "desc":" ",
238        "pid":21616,
239        "stacktrace":"oils_auth.c:304",
240        "payload":{
241           "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
242           "authtime":420
243        }
244
245     }
246
247     ------------------------------------
248     Request Completed Successfully
249     Request Time in seconds: 1.336568
250     ------------------------------------
251 ----------------------------------------------------------
252 +
253 If this does not work, it's time to do some troubleshooting.
254 +
255 . As the root user, start the Apache web server.
256 +
257 If you encounter errors, refer to the troubleshooting section of this documentation for tips on finding solutions and seeking further assistance
258 from the Evergreen community.