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