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