]> git.evergreen-ils.org Git - working/Evergreen.git/blob - docs/installation/server_upgrade.txt
Generate Apache config files for increased portability
[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.1 is recommended. The minimum supported version
10     is 9.0.
11   * **Linux**: Evergreen 2.3 has been tested on 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.1.0.
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 catalogue 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_ctl.sh -l -a stop_all
40 -----------------------------
41 +
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.php[OpenSRF download page].
45 . As the opensrf user, download and extract Evergreen 2.3:
46 +
47 [source, bash]
48 -----------------------------------------------
49 wget http://www.open-ils.org/downloads/Evergreen-ILS-2.3.3.tar.gz
50 tar xzf Evergreen-ILS-2.3.3.tar.gz
51 -----------------------------------------------
52 +
53 [NOTE]
54 For the latest edition of Evergreen, check the http://evergreen-ils.org/downloads.php[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-2.3.3
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
68 indexterm:[Linux, Ubuntu]
69
70
71   * `debian-squeeze` for Debian Squeeze (6.0)
72   * `ubuntu-lucid` for Ubuntu Lucid Lynx (10.04)
73   * `ubuntu-precise` for Ubuntu Precise Pangolin (12.04)
74 +
75 [source, bash]
76 ------------------------------------------------------------
77 make -f Open-ILS/src/extras/Makefile.install [distribution]
78 ------------------------------------------------------------
79 +
80 . As the opensrf user, configure and compile Evergreen:
81 +
82 [source, bash]
83 ------------------------------------------------------------
84 cd /home/opensrf/Evergreen-ILS-2.3.3
85 ./configure --prefix=/openils --sysconfdir=/openils/conf
86 make
87 ------------------------------------------------------------
88 +
89 . As the root user, install Evergreen:
90 +
91 [source, bash]
92 ------------------------------------------------------------
93 cd /home/opensrf/Evergreen-ILS-2.3.3
94 make STAFF_CLIENT_STAMP_ID=rel_2_3_3 install
95 ------------------------------------------------------------
96 +
97 . As the root user, change all files to be owned by the opensrf user and group:
98 +
99 [source, bash]
100 ------------------------------------------------------------
101 chown -R opensrf:opensrf /openils
102 ------------------------------------------------------------
103 +
104 . As the opensrf user, update the server symlink in /openils/var/web/xul/:
105 +
106 [source, bash]
107 -----------------------------------------------------------
108 cd /openils/var/web/xul/
109 rm server
110 ln -sf rel_2_3_3/server server
111 ----------------------------------------------------------
112 +
113 . As the opensrf user, update opensrf_core.xml and opensrf.xml by copying the
114   new example files (/openils/conf/opensrf_core.xml.example and
115   /openils/conf/opensrf.xml). The _-b_ option creates a backup copy of the old file.
116 +
117 [source, bash]
118 ----------------------------------------------------------
119 cp -b /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
120 cp -b /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
121 ----------------------------------------------------------
122 +
123 [CAUTION]
124 Copying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
125 +
126 . As the opensrf user, update the configuration files:
127 +
128 [source, bash]
129 -------------------------------------------------------------------------
130 cd /home/opensrf/Evergreen-ILS-2.3.3
131 perl Open-ILS/src/support-scripts/eg_db_config --update-config --service all \
132 --create-offline --database evergreen --host localhost --user evergreen --password evergreen
133 -------------------------------------------------------------------------
134 +
135 . As the _root_ user, update the Apache files:
136 +
137 indexterm:[Apache]
138 +
139 [CAUTION]
140 Copying these Apache configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
141 For example, if you purchased an SSL certificate, you will need to edit eg.conf to point to the appropriate SSL certificate files.
142 +
143 .. Update _/etc/apache2/eg_startup_ by copying the example from _Open-ILS/examples/apache/eg_startup_.
144 +
145 [source, bash]
146 ----------------------------------------------------------
147 cp /home/opensrf/Evergreen-ILS-2.3.3/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup 
148 ----------------------------------------------------------
149 +
150 .. Update /etc/apache2/eg_vhost.conf by copying the example from Open-ILS/examples/apache/eg_vhost.conf.
151 +
152 [source, bash]
153 ----------------------------------------------------------
154 cp /home/opensrf/Evergreen-ILS-2.3.3/Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/eg_vhost.conf 
155 ----------------------------------------------------------
156 +
157 .. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/examples/apache/eg.conf.
158 +
159 [source, bash]
160 ----------------------------------------------------------
161 cp /home/opensrf/Evergreen-ILS-2.3.3/Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/eg.conf 
162 ----------------------------------------------------------
163
164 Upgrade the Evergreen database schema
165 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
166
167 indexterm:[database schema]
168
169 The upgrade of the Evergreen database schema is the lengthiest part of the
170 upgrade process for sites with a significant amount of production data.
171
172 Before running the upgrade script against your production Evergreen database,
173 back up your database, restore it to a test server, and run the upgrade script
174 against the test server. This enables you to determine how long the upgrade
175 will take and whether any local customizations present problems for the
176 stock upgrade script that require further tailoring of the upgrade script.
177 The backup also enables you to cleanly restore your production data if
178 anything goes wrong during the upgrade.
179
180 [CAUTION]
181 Pay attention to error output as you run the upgrade scripts. If you encounter errors
182 that you cannot resolve yourself through additional troubleshooting, please
183 report the errors to the http://evergreen-ils.org/listserv.php[Evergreen
184 Technical Discussion List].
185
186 Run the following script as a user with the ability to connect to the
187 database server. Adjust the arguments to the `psql` command to reflect your
188 database server connection information:
189
190 [source, bash]
191 ----------------------------------------------------------
192 cd /home/opensrf/Evergreen-ILS-2.3.3/Open-ILS/src/sql/Pg
193 psql -U evergreen -h localhost -f version-upgrade/2.2-2.3.0-upgrade-db.sql evergreen
194 psql -U evergreen -h localhost -f version-upgrade/2.3.0-2.3.1-upgrade-db.sql evergreen
195 psql -U evergreen -h localhost -f version-upgrade/2.3.1-2.3.2-upgrade-db.sql evergreen
196 psql -U evergreen -h localhost -f version-upgrade/2.3.2-2.3.3-upgrade-db.sql evergreen
197 ----------------------------------------------------------
198
199 Restart Evergreen and Test
200 ~~~~~~~~~~~~~~~~~~~~~~~~~~
201 . As the opensrf user, start all Evergreen and OpenSRF services:
202 +
203 [source, bash]
204 --------------------------------------------------------------
205 osrf_ctl.sh -l -a start_all
206 --------------------------------------------------------------
207 +
208 . As the opensrf user, run autogen to refresh the static organizational data files:
209 +
210 [source, bash]
211 --------------------------------------------------------------
212 cd /openils/bin
213 ./autogen.sh
214 --------------------------------------------------------------
215 +
216 . Start srfsh and try logging in using your Evergreen username and password:
217 +
218 [source, bash]
219 --------------------------------------------------------------
220 /openils/bin/srfsh
221 srfsh% login username password
222 --------------------------------------------------------------
223 +
224 You should see a result like:
225 +
226 [source, bash]
227 ------------------------------------------------------
228 Received Data: "250bf1518c7527a03249858687714376"
229     ------------------------------------
230     Request Completed Successfully
231     Request Time in seconds: 0.045286
232     ------------------------------------
233
234     Received Data: {
235        "ilsevent":0,
236        "textcode":"SUCCESS",
237        "desc":" ",
238        "pid":21616,
239        "stacktrace":"oils_auth.c:304",
240        "payload":{
241           "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
242           "authtime":420
243        }
244
245     }
246
247     ------------------------------------
248     Request Completed Successfully
249     Request Time in seconds: 1.336568
250     ------------------------------------
251 ----------------------------------------------------------
252 +
253 If this does not work, it's time to do some troubleshooting.
254 +
255 . As the root user, start the Apache web server.
256 +
257 If you encounter errors, refer to the troubleshooting section of this documentation for tips on finding solutions and seeking further assistance
258 from the Evergreen community.