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