]> git.evergreen-ils.org Git - Evergreen.git/blob - docs/installation/server_upgrade.adoc
Lp#1718459: Remove Debian 7 Wheezy Installation Support
[Evergreen.git] / docs / installation / server_upgrade.adoc
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**: The minimum supported version is 9.4.
10   * **Linux**: Evergreen 2.12.0 has been tested on Debian Stretch (9.0),
11     Debian Jessie (8.0), Ubuntu Xenial Xerus (16.04),and Ubuntu Trusty Tahr (14.04).
12     If you are running an older version of these distributions, you may want
13     to upgrade before upgrading Evergreen. For instructions on upgrading these
14     distributions, visit the Debian or Ubuntu websites.
15   * **OpenSRF**: The minimum supported version of OpenSRF is 3.0.0.
16
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 https://evergreen-ils.org/opensrf-downloads/[OpenSRF download page].
45 . As the *opensrf* user, download and extract Evergreen 2.12.0:
46 +
47 [source, bash]
48 -----------------------------------------------
49 wget https://evergreen-ils.org/downloads/Evergreen-ILS-2.12.0.tar.gz
50 tar xzf Evergreen-ILS-2.12.0.tar.gz
51 -----------------------------------------------
52 +
53 [NOTE]
54 For the latest edition of Evergreen, check the https://evergreen-ils.org/egdownloads/[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.12.0
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-stretch` for Debian Stretch (9.0) (EDI compatibility in progess)
70   * `debian-jessie` for Debian Jessie (8.0) (See https://bugs.launchpad.net/evergreen/+bug/1342227[Bug 134222] if you want to use EDI)
71   * `ubuntu-xenial` for Ubuntu Xenial Xerus (16.04) (EDI compatibility in progress)
72   * `ubuntu-trusty` for Ubuntu Trusty Tahr (14.04) (See https://bugs.launchpad.net/evergreen/+bug/1342227[Bug 134222] if you want to use EDI)
73
74 +
75 [source, bash]
76 ------------------------------------------------------------
77 make -f Open-ILS/src/extras/Makefile.install [distribution]
78 ------------------------------------------------------------
79 +
80 . As the *opensrf* user, configure and compile Evergreen:
81 +
82 [source, bash]
83 ------------------------------------------------------------
84 cd /home/opensrf/Evergreen-ILS-2.12.0
85 PATH=/openils/bin:$PATH ./configure --prefix=/openils --sysconfdir=/openils/conf
86 make
87 ------------------------------------------------------------
88 +
89 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.
90 +
91 . As the *root* user, install Evergreen:
92 +
93 [source, bash]
94 ------------------------------------------------------------
95 cd /home/opensrf/Evergreen-ILS-2.12.0
96 make install
97 ------------------------------------------------------------
98 +
99
100 **Note** that this version of Evergreen does not use the legacy XUL staff
101 client by default, but if you wish to use a versioned XUL staff client, you
102 can supply `STAFF_CLIENT_STAMP` during the `make install` step like this:
103 +
104 [source, bash]
105 ------------------------------------------------------------
106 cd /home/opensrf/Evergreen-ILS-2.12.0
107 make STAFF_CLIENT_STAMP_ID=rel_2_12_rc install
108 ------------------------------------------------------------
109 +
110 . As the *root* user, change all files to be owned by the opensrf user and group:
111 +
112 [source, bash]
113 ------------------------------------------------------------
114 chown -R opensrf:opensrf /openils
115 ------------------------------------------------------------
116 +
117 . (Optional, only if you are using the legacy staff client)
118   As the *opensrf* user, update the server symlink in /openils/var/web/xul/:
119 +
120 [source, bash]
121 -----------------------------------------------------------
122 cd /openils/var/web/xul/
123 rm server
124 ln -sf rel_2_12_rc/server server
125 ----------------------------------------------------------
126 +
127 . As the *opensrf* user, update opensrf_core.xml and opensrf.xml by copying the
128   new example files (/openils/conf/opensrf_core.xml.example and
129   /openils/conf/opensrf.xml). The _-b_ option creates a backup copy of the old file.
130 +
131 [source, bash]
132 ----------------------------------------------------------
133 cp -b /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
134 cp -b /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
135 ----------------------------------------------------------
136 +
137 [CAUTION]
138 Copying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
139 +
140 . As the *opensrf* user, update the configuration files:
141 +
142 [source, bash]
143 -------------------------------------------------------------------------
144 cd /home/opensrf/Evergreen-ILS-2.12.0
145 perl Open-ILS/src/support-scripts/eg_db_config --update-config --service all \
146 --create-offline --database evergreen --host localhost --user evergreen --password evergreen
147 -------------------------------------------------------------------------
148 +
149 . As the *root* user, update the Apache files:
150 +
151 indexterm:[Apache]
152 +
153 Use the example configuration files in `Open-ILS/examples/apache/` (for
154 Apache versions below 2.4) or `Open-ILS/examples/apache_24/` (for Apache
155 versions 2.4 or greater) to configure your Web server for the Evergreen
156 catalog, staff client, Web services, and administration interfaces. Issue the
157 following commands as the *root* Linux account:
158 +
159 [CAUTION]
160 Copying these Apache configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
161 For example, if you purchased an SSL certificate, you will need to edit eg.conf to point to the appropriate SSL certificate files.
162 The diff command can be used to show the differences between the distribution version and your customized version. `diff <customized file> <dist file>`
163 +
164 .. Update _/etc/apache2/eg_startup_ by copying the example from _Open-ILS/examples/apache/eg_startup_.
165 +
166 [source, bash]
167 ----------------------------------------------------------
168 cp /home/opensrf/Evergreen-ILS-2.12.0/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup
169 ----------------------------------------------------------
170 +
171 .. Update /etc/apache2/eg_vhost.conf by copying the example from Open-ILS/examples/apache/eg_vhost.conf.
172 +
173 [source, bash]
174 ----------------------------------------------------------
175 cp /home/opensrf/Evergreen-ILS-2.12.0/Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/eg_vhost.conf
176 ----------------------------------------------------------
177 +
178 .. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/examples/apache/eg.conf.
179 +
180 [source, bash]
181 ----------------------------------------------------------
182 cp /home/opensrf/Evergreen-ILS-2.12.0/Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/eg.conf
183 ----------------------------------------------------------
184
185 Upgrade the Evergreen database schema
186 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
187
188 indexterm:[database schema]
189
190 The upgrade of the Evergreen database schema is the lengthiest part of the
191 upgrade process for sites with a significant amount of production data.
192
193 Before running the upgrade script against your production Evergreen database,
194 back up your database, restore it to a test server, and run the upgrade script
195 against the test server. This enables you to determine how long the upgrade
196 will take and whether any local customizations present problems for the
197 stock upgrade script that require further tailoring of the upgrade script.
198 The backup also enables you to cleanly restore your production data if
199 anything goes wrong during the upgrade.
200
201 [NOTE]
202 =============
203 Evergreen provides incremental upgrade scripts that allow you to upgrade
204 from one minor version to the next until you have the current version of
205 the schema. For example, if you want to upgrade from 2.5.1 to 2.12.0, you
206 would run the following upgrade scripts:
207
208 - 2.5.1-2.5.2-upgrade-db.sql
209 - 2.5.2-2.5.3-upgrade-db.sql
210 - 2.5.3-2.6.0-upgrade-db.sql (this is a major version upgrade)
211 - 2.6.2-2.6.3-upgrade-db.sql
212 - 2.6.3-2.7.0-upgrade-db.sql (this is a major version upgrade)
213 - 2.7.0-2.7.1-upgrade-db.sql
214 - 2.7.1-2.7.2-upgrade-db.sql
215 - 2.7.2-2.7.3-upgrade-db.sql
216 - 2.7.3-2.7.4-upgrade-db.sql
217 - 2.7.4-2.8.0-upgrade-db.sql (this is a major version upgrade)
218 - 2.8.0-2.8.1-upgrade-db.sql
219 - 2.8.1-2.8.2-upgrade-db.sql
220 - 2.8.2-2.8.3-upgrade-db.sql
221 - 2.8.3-2.8.4-upgrade-db.sql
222 - 2.8.4-2.9.0-upgrade-db.sql (this is a major version upgrade)
223 - 2.9.0-2.9.1-upgrade-db.sql
224 - 2.9.1-2.9.2-upgrade-db.sql
225 - 2.9.2-2.9.3-upgrade-db.sql
226 - 2.9.3-2.10.0-upgrade-db.sql
227 - 2.10.0-2.10.1-upgrade-db.sql
228 - 2.10.1-2.10.2-upgrade-db.sql
229 - 2.10.2-2.10.3-upgrade-db.sql
230 - 2.10.3-2.10.4-upgrade-db.sql
231 - 2.10.4-2.10.5-upgrade-db.sql
232 - 2.10.5-2.10.6-upgrade-db.sql
233 - 2.10.6-2.10.7-upgrade-db.sql
234 - 2.10.7-2.11.0-upgrade-db.sql (this is a major version upgrade)
235 - 2.11.0-2.11.1-upgrade-db.sql
236 - 2.11.1-2.11.2-upgrade-db.sql
237 - 2.11.2-2.11.3-upgrade-db.sql
238 - 2.11.3-2.12.0-upgrade-db.sql (this is a major version upgrade)
239
240 Note that you do *not* want to run additional 2.5 scripts to upgrade to the
241 newest version of 2.5, since currently there is no automated way to upgrade
242 from 2.5.4+ to 2.6. Only upgrade as far as necessary to reach the major
243 version upgrade script (in this example, as far as 2.5.3).
244
245 To upgrade across multiple major versions (e.g. from 2.3.0 to 2.12.0), use
246 the same logic to utilize the provided major version upgrade scripts. For
247 example:
248
249 - 2.3-2.4.0-upgrade-db.sql
250 - 2.3-2.4-supplemental.sh
251 - (run all incremental scripts from 2.4.0 to 2.4.3)
252 - 2.4.3-2.5.0-upgrade-db.sql
253 - (run all incremental scripts from 2.5.0 to 2.5.3)
254 - 2.5.3-2.6.0-upgrade-db.sql
255 - (run all incremental scripts from 2.6.0 to 2.6.3)
256 - 2.6.3-2.7.0-upgrade-db.sql
257 - (run all incremental scripts from 2.7.0 to 2.7.4)
258 - 2.7.4-2.8.0-upgrade-db.sql
259 - (run all incremental scripts from 2.8.0 to 2.8.4)
260 - 2.8.4-2.9.0-upgrade-db.sql
261 - (run all incremental scripts from 2.9.0 to 2.9.3)
262 - 2.9.3-2.10.0-upgrade-db.sql
263 - (run all incremental scripts from 2.10.0 to 2.10.7)
264 - 2.10.7-2.11.0-upgrade-db.sql
265 - (run all incremental scripts from 2.11.0 to 2.11.3)
266 - 2.11.3-2.12.0-upgrade-db.sql
267
268 =============
269
270 [CAUTION]
271 Pay attention to error output as you run the upgrade scripts. If you encounter errors
272 that you cannot resolve yourself through additional troubleshooting, please
273 report the errors to the https://evergreen-ils.org/communicate/mailing-lists/[Evergreen
274 Technical Discussion List].
275
276 Run the following steps (including other upgrade scripts, as noted above)
277 as a user with the ability to connect to the database server.
278
279 [source, bash]
280 ----------------------------------------------------------
281 cd /home/opensrf/Evergreen-ILS-2.12.0/Open-ILS/src/sql/Pg
282 psql -U evergreen -h localhost -f version-upgrade/2.11.3-2.12.0-upgrade-db.sql evergreen
283 ----------------------------------------------------------
284
285 [TIP]
286 After the some database upgrade scripts finish, you may see a
287 note on how to reingest your bib records. You may run this after you have
288 completed the entire upgrade and tested your system. Reingesting records
289 may take a long time depending on the number of bib records in your system.
290
291 Restart Evergreen and Test
292 ~~~~~~~~~~~~~~~~~~~~~~~~~~
293 . As the *root* user, restart memcached to clear out all old user sessions.
294 +
295 [source, bash]
296 --------------------------------------------------------------
297 service memcached restart
298 --------------------------------------------------------------
299 +
300 . As the *opensrf* user, start all Evergreen and OpenSRF services:
301 +
302 [source, bash]
303 --------------------------------------------------------------
304 osrf_control --localhost --start-all
305 --------------------------------------------------------------
306 +
307 . As the *opensrf* user, run autogen to refresh the static organizational data files:
308 +
309 [source, bash]
310 --------------------------------------------------------------
311 cd /openils/bin
312 ./autogen.sh
313 --------------------------------------------------------------
314 +
315 . Start srfsh and try logging in using your Evergreen username and password:
316 +
317 [source, bash]
318 --------------------------------------------------------------
319 /openils/bin/srfsh
320 srfsh% login username password
321 --------------------------------------------------------------
322 +
323 You should see a result like:
324 +
325 [source, bash]
326 ------------------------------------------------------
327 Received Data: "250bf1518c7527a03249858687714376"
328     ------------------------------------
329     Request Completed Successfully
330     Request Time in seconds: 0.045286
331     ------------------------------------
332
333     Received Data: {
334        "ilsevent":0,
335        "textcode":"SUCCESS",
336        "desc":" ",
337        "pid":21616,
338        "stacktrace":"oils_auth.c:304",
339        "payload":{
340           "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
341           "authtime":420
342        }
343
344     }
345
346     ------------------------------------
347     Request Completed Successfully
348     Request Time in seconds: 1.336568
349     ------------------------------------
350 ----------------------------------------------------------
351 +
352 If this does not work, it's time to do some <<install-troubleshooting-1,troubleshooting>>.
353 +
354 . As the *root* user, start the Apache web server.
355 +
356 If you encounter errors, refer to the <<install-troubleshooting-1,troubleshooting>> section 
357 of this documentation for tips on finding solutions and seeking further assistance
358 from the Evergreen community.
359
360 Review Release Notes
361 ~~~~~~~~~~~~~~~~~~~~
362
363 Review this version's release notes for other tasks
364 that need to be done after upgrading.  If you have upgraded over several 
365 major versions, you will need to review the release notes for each version also.