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