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