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