]> git.evergreen-ils.org Git - Evergreen.git/blob - docs/modules/installation/pages/server_upgrade.adoc
Docs: LP1826256 Change 'catalogue' to 'catalog'
[Evergreen.git] / docs / modules / installation / pages / server_upgrade.adoc
1 = Upgrading the Evergreen Server =
2 :toc:
3
4 Before upgrading, it is important to carefully plan an upgrade strategy to minimize system downtime and service interruptions.
5 All of the steps in this chapter are to be completed from the command line.
6
7 == Software Prerequisites ==
8
9   * **PostgreSQL**: The minimum supported version is 9.6.
10   * **Linux**: Evergreen 3.X.X 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.2.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 catalog 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 3.X.X:
46 +
47 [source, bash]
48 -----------------------------------------------
49 wget https://evergreen-ils.org/downloads/Evergreen-ILS-3.X.X.tar.gz
50 tar xzf Evergreen-ILS-3.X.X.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-3.X.X
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-3.X.X
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-3.X.X
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-3.X.X
106 make STAFF_CLIENT_STAMP_ID=rel_3_x_x 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_3_x_x/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-3.X.X
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-3.X.X/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-3.X.X/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-3.X.X/Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/eg.conf
182 ----------------------------------------------------------
183
184 == Upgrade the Evergreen database schema ==
185
186 indexterm:[database schema]
187
188 The upgrade of the Evergreen database schema is the lengthiest part of the
189 upgrade process for sites with a significant amount of production data.
190
191 Before running the upgrade script against your production Evergreen database,
192 back up your database, restore it to a test server, and run the upgrade script
193 against the test server. This enables you to determine how long the upgrade
194 will take and whether any local customizations present problems for the
195 stock upgrade script that require further tailoring of the upgrade script.
196 The backup also enables you to cleanly restore your production data if
197 anything goes wrong during the upgrade.
198
199 [NOTE]
200 =============
201 Evergreen provides incremental upgrade scripts that allow you to upgrade
202 from one minor version to the next until you have the current version of
203 the schema. For example, if you want to upgrade from 2.9.0 to 2.11.0, you
204 would run the following upgrade scripts:
205
206 - 2.9.0-2.9.1-upgrade-db.sql
207 - 2.9.1-2.9.2-upgrade-db.sql
208 - 2.9.2-2.9.3-upgrade-db.sql
209 - 2.9.3-2.10.0-upgrade-db.sql (this is a major version upgrade)
210 - 2.10.0-2.10.1-upgrade-db.sql
211 - 2.10.1-2.10.2-upgrade-db.sql
212 - 2.10.2-2.10.3-upgrade-db.sql
213 - 2.10.3-2.10.4-upgrade-db.sql
214 - 2.10.4-2.10.5-upgrade-db.sql
215 - 2.10.5-2.10.6-upgrade-db.sql
216 - 2.10.6-2.10.7-upgrade-db.sql
217 - 2.10.7-2.11.0-upgrade-db.sql (this is a major version upgrade)
218
219 Note that you do *not* necessarily want to run additional upgrade scripts to
220 upgrade to the newest version, since currently there is no automated way, for
221 example to upgrade from 2.9.4+ to 2.10. Only upgrade as far as necessary to
222 reach the major version upgrade script (in this example, as far as 2.9.3).
223
224 =============
225
226 [CAUTION]
227 Pay attention to error output as you run the upgrade scripts. If you encounter errors
228 that you cannot resolve yourself through additional troubleshooting, please
229 report the errors to the https://evergreen-ils.org/communicate/mailing-lists/[Evergreen
230 Technical Discussion List].
231
232 Run the following steps (including other upgrade scripts, as noted above)
233 as a user with the ability to connect to the database server.
234
235 [source, bash]
236 ----------------------------------------------------------
237 cd /home/opensrf/Evergreen-ILS-3.X.X/Open-ILS/src/sql/Pg
238 psql -U evergreen -h localhost -f version-upgrade/3.X.W-3.X.X-upgrade-db.sql evergreen
239 ----------------------------------------------------------
240
241 [TIP]
242 After the some database upgrade scripts finish, you may see a
243 note on how to reingest your bib records. You may run this after you have
244 completed the entire upgrade and tested your system. Reingesting records
245 may take a long time depending on the number of bib records in your system.
246
247 == Restart Evergreen and Test ==
248
249 . As the *root* user, restart memcached to clear out all old user sessions.
250 +
251 [source, bash]
252 --------------------------------------------------------------
253 service memcached restart
254 --------------------------------------------------------------
255 +
256 . As the *opensrf* user, start all Evergreen and OpenSRF services:
257 +
258 [source, bash]
259 --------------------------------------------------------------
260 osrf_control --localhost --start-all
261 --------------------------------------------------------------
262 +
263 . As the *opensrf* user, run autogen to refresh the static organizational data files:
264 +
265 [source, bash]
266 --------------------------------------------------------------
267 cd /openils/bin
268 ./autogen.sh
269 --------------------------------------------------------------
270 +
271 . Start srfsh and try logging in using your Evergreen username and password:
272 +
273 [source, bash]
274 --------------------------------------------------------------
275 /openils/bin/srfsh
276 srfsh% login username password
277 --------------------------------------------------------------
278 +
279 You should see a result like:
280 +
281 [source, bash]
282 --------------------------------------------------------------
283 Received Data: "250bf1518c7527a03249858687714376"
284     ------------------------------------
285     Request Completed Successfully
286     Request Time in seconds: 0.045286
287     ------------------------------------
288
289     Received Data: {
290        "ilsevent":0,
291        "textcode":"SUCCESS",
292        "desc":" ",
293        "pid":21616,
294        "stacktrace":"oils_auth.c:304",
295        "payload":{
296           "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
297           "authtime":420
298        }
299
300     }
301
302     ------------------------------------
303     Request Completed Successfully
304     Request Time in seconds: 1.336568
305     ------------------------------------
306 --------------------------------------------------------------
307 +
308 If this does not work, it's time to do some
309 xref:installation:server_installation.adoc#install-troubleshooting-1[troubleshooting].
310 +
311 . As the *root* user, start the Apache web server.
312 +
313 If you encounter errors, refer to the
314 xref:installation:server_installation.adoc#install-troubleshooting-1[troubleshooting] section 
315 of this documentation for tips on finding solutions and seeking further assistance
316 from the Evergreen community.
317
318 == Review Release Notes ==
319
320 Review this version's release notes for other tasks
321 that need to be done after upgrading.  If you have upgraded over several 
322 major versions, you will need to review the release notes for each version also.