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