]> git.evergreen-ils.org Git - working/Evergreen.git/blob - docs/installation/server_upgrade.txt
LP#1207529: Add /openils assumption note
[working/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.6 has been tested on Debian Wheezy (7.0), Debian Squeeze (6.0),
12     Ubuntu Precise Pangolin (12.04) and Ubuntu Lucid Lynx (10.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.3.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_control --localhost --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-downloads/[OpenSRF download page].
45 . As the opensrf user, download and extract Evergreen 2.6:
46 +
47 [source, bash]
48 -----------------------------------------------
49 wget http://evergreen-ils.org/downloads/Evergreen-ILS-2.6.1.tar.gz
50 tar xzf Evergreen-ILS-2.6.1.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.6.1
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-wheezy` for Debian Wheezy (7.0)
70   * `debian-squeeze` for Debian Squeeze (6.0)
71   * `ubuntu-precise` for Ubuntu Precise Pangolin (12.04)
72   * `ubuntu-lucid` for Ubuntu Lucid Lynx (10.04)
73 +
74 [source, bash]
75 ------------------------------------------------------------
76 make -f Open-ILS/src/extras/Makefile.install [distribution]
77 ------------------------------------------------------------
78 +
79 . As the opensrf user, configure and compile Evergreen:
80 +
81 [source, bash]
82 ------------------------------------------------------------
83 cd /home/opensrf/Evergreen-ILS-2.6.1
84 PATH=/openils/bin:$PATH ./configure --prefix=/openils --sysconfdir=/openils/conf
85 make
86 ------------------------------------------------------------
87 +
88 These instructions assume that you have also installed OpenSRF under /openils/. If not, please adjust PATH as needed so that the Evergreen configure script can find osrf_config.
89 +
90 . As the root user, install Evergreen:
91 +
92 [source, bash]
93 ------------------------------------------------------------
94 cd /home/opensrf/Evergreen-ILS-2.6.1
95 make STAFF_CLIENT_STAMP_ID=rel_2_6_1 install
96 ------------------------------------------------------------
97 +
98 . As the root user, change all files to be owned by the opensrf user and group:
99 +
100 [source, bash]
101 ------------------------------------------------------------
102 chown -R opensrf:opensrf /openils
103 ------------------------------------------------------------
104 +
105 . As the opensrf user, update the server symlink in /openils/var/web/xul/:
106 +
107 [source, bash]
108 -----------------------------------------------------------
109 cd /openils/var/web/xul/
110 rm server
111 ln -sf rel_2_6_1/server server
112 ----------------------------------------------------------
113 +
114 . As the opensrf user, update opensrf_core.xml and opensrf.xml by copying the
115   new example files (/openils/conf/opensrf_core.xml.example and
116   /openils/conf/opensrf.xml). The _-b_ option creates a backup copy of the old file.
117 +
118 [source, bash]
119 ----------------------------------------------------------
120 cp -b /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
121 cp -b /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
122 ----------------------------------------------------------
123 +
124 [CAUTION]
125 Copying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
126 +
127 . As the opensrf user, update the configuration files:
128 +
129 [source, bash]
130 -------------------------------------------------------------------------
131 cd /home/opensrf/Evergreen-ILS-2.6.1
132 perl Open-ILS/src/support-scripts/eg_db_config --update-config --service all \
133 --create-offline --database evergreen --host localhost --user evergreen --password evergreen
134 -------------------------------------------------------------------------
135 +
136 . As the _root_ user, update the Apache files:
137 +
138 indexterm:[Apache]
139 +
140 [CAUTION]
141 Copying these Apache configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
142 For example, if you purchased an SSL certificate, you will need to edit eg.conf to point to the appropriate SSL certificate files.
143 +
144 .. Update _/etc/apache2/eg_startup_ by copying the example from _Open-ILS/examples/apache/eg_startup_.
145 +
146 [source, bash]
147 ----------------------------------------------------------
148 cp /home/opensrf/Evergreen-ILS-2.6.1/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup 
149 ----------------------------------------------------------
150 +
151 .. Update /etc/apache2/eg_vhost.conf by copying the example from Open-ILS/examples/apache/eg_vhost.conf.
152 +
153 [source, bash]
154 ----------------------------------------------------------
155 cp /home/opensrf/Evergreen-ILS-2.6.1/Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/eg_vhost.conf 
156 ----------------------------------------------------------
157 +
158 .. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/examples/apache/eg.conf.
159 +
160 [source, bash]
161 ----------------------------------------------------------
162 cp /home/opensrf/Evergreen-ILS-2.6.1/Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/eg.conf 
163 ----------------------------------------------------------
164
165 Upgrade the Evergreen database schema
166 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167
168 indexterm:[database schema]
169
170 The upgrade of the Evergreen database schema is the lengthiest part of the
171 upgrade process for sites with a significant amount of production data.
172
173 Before running the upgrade script against your production Evergreen database,
174 back up your database, restore it to a test server, and run the upgrade script
175 against the test server. This enables you to determine how long the upgrade
176 will take and whether any local customizations present problems for the
177 stock upgrade script that require further tailoring of the upgrade script.
178 The backup also enables you to cleanly restore your production data if
179 anything goes wrong during the upgrade.
180
181 [NOTE]
182 =============
183 Evergreen provides incremental upgrade scripts that allow you to upgrade
184 from one minor version to the next until you have the current version of
185 the schema. For example, if you want to upgrade from 2.5.1 to 2.6.1, you
186 would run the following upgrade scripts:
187
188 - 2.5.1-2.5.2-upgrade-db.sql
189 - 2.5.2-2.5.3-upgrade-db.sql
190 - 2.5.3-2.6.0-upgrade-db.sql (this is a major version upgrade)
191 - 2.6.0-2.6.1-upgrade-db.sql
192
193 Note that you do *not* want to run additional 2.5 scripts to upgrade to the
194 newest version of 2.5, since currently there is no automated way to upgrade
195 from 2.5.4+ to 2.6. Only upgrade as far as necessary to reach the major
196 version upgrade script (in this example, as far as 2.5.3).
197
198 To upgrade across multiple major versions (e.g. from 2.3.0 to 2.6.1), use
199 the same logic to utilize the provided major version upgrade scripts. For
200 example:
201
202 - 2.3-2.4.0-upgrade-db.sql
203 - 2.3-2.4-supplemental.sh
204 - (run all incremental scripts from 2.4.0 to 2.4.3)
205 - 2.4.3-2.5.0-upgrade-db.sql
206 - (run all incremental scripts from 2.5.0 to 2.5.3)
207 - 2.5.3-2.6.0-upgrade-db.sql
208 - 2.6.0-2.6.1-upgrade-db.sql
209 =============
210
211 [CAUTION]
212 Pay attention to error output as you run the upgrade scripts. If you encounter errors
213 that you cannot resolve yourself through additional troubleshooting, please
214 report the errors to the http://evergreen-ils.org/communicate/mailing-lists/[Evergreen
215 Technical Discussion List].
216
217 Run the following steps (including other upgrade scripts, as noted above)
218 as a user with the ability to connect to the database server.
219
220 [source, bash]
221 ----------------------------------------------------------
222 cd /home/opensrf/Evergreen-ILS-2.6.1/Open-ILS/src/sql/Pg
223 psql -U evergreen -h localhost -f version-upgrade/2.5.3-2.6.0-upgrade-db.sql evergreen
224 ----------------------------------------------------------
225
226 [TIP]
227 After the `2.5.3-2.6.0-upgrade-db.sql` script finishes, you will see a
228 note on how to reingest your bib records. You may run this after you have
229 completed the entire upgrade and tested your system. Reingesting records
230 may take a long time depending on the number of bib records in your system.
231
232 Restart Evergreen and Test
233 ~~~~~~~~~~~~~~~~~~~~~~~~~~
234 . As the opensrf user, start all Evergreen and OpenSRF services:
235 +
236 [source, bash]
237 --------------------------------------------------------------
238 osrf_control --localhost --start-all
239 --------------------------------------------------------------
240 +
241 . As the opensrf user, run autogen to refresh the static organizational data files:
242 +
243 [source, bash]
244 --------------------------------------------------------------
245 cd /openils/bin
246 ./autogen.sh
247 --------------------------------------------------------------
248 +
249 . Start srfsh and try logging in using your Evergreen username and password:
250 +
251 [source, bash]
252 --------------------------------------------------------------
253 /openils/bin/srfsh
254 srfsh% login username password
255 --------------------------------------------------------------
256 +
257 You should see a result like:
258 +
259 [source, bash]
260 ------------------------------------------------------
261 Received Data: "250bf1518c7527a03249858687714376"
262     ------------------------------------
263     Request Completed Successfully
264     Request Time in seconds: 0.045286
265     ------------------------------------
266
267     Received Data: {
268        "ilsevent":0,
269        "textcode":"SUCCESS",
270        "desc":" ",
271        "pid":21616,
272        "stacktrace":"oils_auth.c:304",
273        "payload":{
274           "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
275           "authtime":420
276        }
277
278     }
279
280     ------------------------------------
281     Request Completed Successfully
282     Request Time in seconds: 1.336568
283     ------------------------------------
284 ----------------------------------------------------------
285 +
286 If this does not work, it's time to do some troubleshooting.
287 +
288 . As the root user, start the Apache web server.
289 +
290 If you encounter errors, refer to the troubleshooting section of this documentation for tips on finding solutions and seeking further assistance
291 from the Evergreen community.