]> git.evergreen-ils.org Git - working/Evergreen.git/blob - docs/installation/server_upgrade.txt
907b95dc22cd6cc8cadc0bf93b21e70bee2641e8
[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.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 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.2:
46 +
47 [source, bash]
48 -----------------------------------------------
49 wget http://evergreen-ils.org/downloads/Evergreen-ILS-2.2.0.tar.gz
50 tar xzf Evergreen-ILS-2.2.0.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.2.0
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.2.0
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.2.0
89 make STAFF_CLIENT_STAMP_ID=rel_2_2_0 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 configuration files:
100 +
101 [source, bash]
102 -----------------------------------------------------------
103 cd /home/opensrf/Evergreen-ILS-2.2.0
104
105 perl Open-ILS/src/support-scripts/eg_db_config.pl \
106 --create-offline --user evergreen --password evergreen \
107 --hostname localhost --port 5432 --database evergreen
108 ----------------------------------------------------------
109 +
110 . As the opensrf user, update the server symlink in /openils/var/web/xul/:
111 +
112 [source, bash]
113 -----------------------------------------------------------
114 cd /openils/var/web/xul/
115 rm server
116 ln -s rel_2_2_0/server
117 ----------------------------------------------------------
118 +
119 . As the opensrf user, update opensrf_core.xml and opensrf.xml by copying the
120   new example files (/openils/conf/opensrf_core.xml.example and
121   /openils/conf/opensrf.xml).
122 +
123 [source, bash]
124 ----------------------------------------------------------
125 cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
126 cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
127 ----------------------------------------------------------
128 +
129 [CAUTION]
130 Copying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
131 +
132 . Update Apache files:
133 +
134 [CAUTION]
135 Copying these Apache configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
136 For example, if you purchased an SSL certificate, you will need to edit eg.conf to point to the appropriate SSL certificate files.
137 +
138 .. Update /etc/apache2/startup.pl by copying the example from Open-ILS/examples/apache/startup.pl.
139 .. Update /etc/apache2/eg_vhost.conf by copying the example from Open-ILS/examples/apache/eg_vhost.conf.
140 .. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/ examples/apache/eg.conf.
141 . Update opensrf.xml with the database connection info:
142 +
143 As the opensrf user, if you are happy with the default settings in
144 opensrf.xml.example, then:
145 +
146 [source, bash]
147 -------------------------------------------------------------------------
148 cp -b /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
149 cd /home/opensrf/Evergreen-ILS-2.2.0
150 perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config --service all \
151 --database evergreen --host localhost --user evergreen --password evergreen
152 -------------------------------------------------------------------------
153 +
154 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
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.2.0/Open-ILS/src/sql/Pg
183 psql -U evergreen -h localhost -f version_upgrade/2.1-2.2-upgrade-db.sql evergreen
184 ----------------------------------------------------------
185
186 Restart Evergreen and Test
187 ~~~~~~~~~~~~~~~~~~~~~~~~~~
188 . As the opensrf user, start all Evergreen and OpenSRF services:
189 +
190 [source, bash]
191 --------------------------------------------------------------
192 osrf_ctl.sh -l -a start_all
193 --------------------------------------------------------------
194 +
195 . As the opensrf user, run autogen to refresh the static organizational data files:
196 +
197 [source, bash]
198 --------------------------------------------------------------
199 cd /openils/bin
200 ../autogen.sh
201 --------------------------------------------------------------
202 +
203 . Start srfsh and try logging in using your Evergreen username and password:
204 +
205 [source, bash]
206 --------------------------------------------------------------
207 /openils/bin/srfsh
208 srfsh% login username password
209 --------------------------------------------------------------
210 +
211 You should see a result like:
212 +
213 [source, bash]
214 ------------------------------------------------------
215 Received Data: "250bf1518c7527a03249858687714376"
216     ------------------------------------
217     Request Completed Successfully
218     Request Time in seconds: 0.045286
219     ------------------------------------
220
221     Received Data: {
222        "ilsevent":0,
223        "textcode":"SUCCESS",
224        "desc":" ",
225        "pid":21616,
226        "stacktrace":"oils_auth.c:304",
227        "payload":{
228           "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
229           "authtime":420
230        }
231
232     }
233
234     ------------------------------------
235     Request Completed Successfully
236     Request Time in seconds: 1.336568
237     ------------------------------------
238 ----------------------------------------------------------
239 +
240 If this does not work, it's time to do some troubleshooting.
241 +
242 . As the root user, start the Apache web server.
243 +
244 If you encounter errors, refer to the troubleshooting section of this documentation for tips on finding solutions and seeking further assistance
245 from the Evergreen community.