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.
6 Software Prerequisites:
7 ~~~~~~~~~~~~~~~~~~~~~~~
9 * **PostgreSQL**: Version 9.1 is recommended. The minimum supported version
11 * **Linux**: Evergreen 2.5 has been tested on Debian Wheezy (7.0) Debian Squeeze (6.0),
12 Ubuntu Lucid Lynx (10.04) and Ubuntu Precise Pangolin (12.04). If you are
13 running an older version of these distributions, you may want to upgrade
14 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 2.2.0.
18 In the following instructions, you are asked to perform certain steps as either the root or opensrf user.
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.
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.
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
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:
38 -----------------------------
39 osrf_ctl.sh -l -a stop_all
40 -----------------------------
42 .. Back up the /openils directory.
43 . Upgrade OpenSRF. Download and install the latest version of OpenSRF from
44 the http://evergreen-ils.org/opensrf-downloads/[OpenSRF download page].
45 . As the opensrf user, download and extract Evergreen 2.4:
48 -----------------------------------------------
49 wget http://evergreen-ils.org/downloads/previews/Evergreen-ILS-2.5-beta1.tar.gz
50 tar xzf http://evergreen-ils.org/downloads/previews/Evergreen-ILS-2.5-beta1.tar.gz
51 -----------------------------------------------
54 For the latest edition of Evergreen, check the http://evergreen-ils.org/downloads.php[Evergreen download page] and adjust upgrading instructions accordingly.
56 . As the root user, install the prerequisites:
59 ----------------------------------------------
60 cd /home/opensrf/Evergreen-ILS-2.5-beta1
61 ---------------------------------------------
63 On the next command, replace `[distribution]` with one of these values for your
64 distribution of Debian or Ubuntu:
66 indexterm:[Linux, Debian]
68 indexterm:[Linux, Ubuntu]
71 * `debian-wheezy` for Debian Wheezy (7.0)
72 * `debian-squeeze` for Debian Squeeze (6.0)
73 * `ubuntu-lucid` for Ubuntu Lucid Lynx (10.04)
74 * `ubuntu-precise` for Ubuntu Precise Pangolin (12.04)
77 ------------------------------------------------------------
78 make -f Open-ILS/src/extras/Makefile.install [distribution]
79 ------------------------------------------------------------
81 . As the opensrf user, configure and compile Evergreen:
84 ------------------------------------------------------------
85 cd /home/opensrf/Evergreen-ILS-2.5.beta1
86 ./configure --prefix=/openils --sysconfdir=/openils/conf
88 ------------------------------------------------------------
90 . As the root user, install Evergreen:
93 ------------------------------------------------------------
94 cd /home/opensrf/Evergreen-ILS-2.5-beta1
95 make STAFF_CLIENT_STAMP_ID=rel_2_5_beta1 install
96 ------------------------------------------------------------
98 . As the root user, change all files to be owned by the opensrf user and group:
101 ------------------------------------------------------------
102 chown -R opensrf:opensrf /openils
103 ------------------------------------------------------------
105 . As the opensrf user, update the server symlink in /openils/var/web/xul/:
108 -----------------------------------------------------------
109 cd /openils/var/web/xul/
111 ln -sf rel_2_5_beta1/server server
112 ----------------------------------------------------------
114 . As the opensrf user, update opensrf_core.xml and opensrf.xml by copying the
115 new example files (/openils/conf/opensrf_core.xml.example and
116 /openils/conf/opensrf.xml). The _-b_ option creates a backup copy of the old file.
119 ----------------------------------------------------------
120 cp -b /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
121 cp -b /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
122 ----------------------------------------------------------
125 Copying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
127 . As the opensrf user, update the configuration files:
130 -------------------------------------------------------------------------
131 cd /home/opensrf/Evergreen-ILS-2.5-beta1
132 perl Open-ILS/src/support-scripts/eg_db_config --update-config --service all \
133 --create-offline --database evergreen --host localhost --user evergreen --password evergreen
134 -------------------------------------------------------------------------
136 . As the _root_ user, update the Apache files:
141 Copying these Apache configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
142 For example, if you purchased an SSL certificate, you will need to edit eg.conf to point to the appropriate SSL certificate files.
144 .. Update _/etc/apache2/eg_startup_ by copying the example from _Open-ILS/examples/apache/eg_startup_.
147 ----------------------------------------------------------
148 cp /home/opensrf/Evergreen-ILS-2.5-beta1/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup
149 ----------------------------------------------------------
151 .. Update /etc/apache2/eg_vhost.conf by copying the example from Open-ILS/examples/apache/eg_vhost.conf.
154 ----------------------------------------------------------
155 cp /home/opensrf/Evergreen-ILS-2.5-beta1/Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/eg_vhost.conf
156 ----------------------------------------------------------
158 .. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/examples/apache/eg.conf.
161 ----------------------------------------------------------
162 cp /home/opensrf/Evergreen-ILS-2.5-beta1/Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/eg.conf
163 ----------------------------------------------------------
165 Upgrade the Evergreen database schema
166 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168 indexterm:[database schema]
170 The upgrade of the Evergreen database schema is the lengthiest part of the
171 upgrade process for sites with a significant amount of production data.
173 Before running the upgrade script against your production Evergreen database,
174 back up your database, restore it to a test server, and run the upgrade script
175 against the test server. This enables you to determine how long the upgrade
176 will take and whether any local customizations present problems for the
177 stock upgrade script that require further tailoring of the upgrade script.
178 The backup also enables you to cleanly restore your production data if
179 anything goes wrong during the upgrade.
182 Pay attention to error output as you run the upgrade scripts. If you encounter errors
183 that you cannot resolve yourself through additional troubleshooting, please
184 report the errors to the http://evergreen-ils.org/communicate/mailing-lists/[Evergreen
185 Technical Discussion List].
187 Run the following steps as a user with the ability to connect to the
191 ----------------------------------------------------------
192 cd /home/opensrf/Evergreen-ILS-2.4.0/Open-ILS/src/sql/Pg
193 psql -U evergreen -h localhost -f version-upgrade/2.4.2-2.5-beta1-upgrade-db.sql evergreen
194 ----------------------------------------------------------
196 Restart Evergreen and Test
197 ~~~~~~~~~~~~~~~~~~~~~~~~~~
198 . As the opensrf user, start all Evergreen and OpenSRF services:
201 --------------------------------------------------------------
202 osrf_ctl.sh -l -a start_all
203 --------------------------------------------------------------
205 . As the opensrf user, run autogen to refresh the static organizational data files:
208 --------------------------------------------------------------
211 --------------------------------------------------------------
213 . Start srfsh and try logging in using your Evergreen username and password:
216 --------------------------------------------------------------
218 srfsh% login username password
219 --------------------------------------------------------------
221 You should see a result like:
224 ------------------------------------------------------
225 Received Data: "250bf1518c7527a03249858687714376"
226 ------------------------------------
227 Request Completed Successfully
228 Request Time in seconds: 0.045286
229 ------------------------------------
233 "textcode":"SUCCESS",
236 "stacktrace":"oils_auth.c:304",
238 "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
244 ------------------------------------
245 Request Completed Successfully
246 Request Time in seconds: 1.336568
247 ------------------------------------
248 ----------------------------------------------------------
250 If this does not work, it's time to do some troubleshooting.
252 . As the root user, start the Apache web server.
254 If you encounter errors, refer to the troubleshooting section of this documentation for tips on finding solutions and seeking further assistance
255 from the Evergreen community.