]> git.evergreen-ils.org Git - working/Evergreen.git/blob - installation/server_upgrade.txt
a520841b7bf5e329fc335000542814c42a527900
[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 is 9.0.
10 * **Linux**: Evergreen 2.0 has been tested on Debian Squeeze (6.0), Ubuntu Lucid Lynx (10.04) and Ubuntu Precise Pangolin (12.04). If you are running an older
11 version of these distributions, you may want to upgrade before upgrading Evergreen. For instructions on upgrading these distributions, visit the Debian or
12 Ubuntu websites.
13 * **OpenSRF**: The minimum supported version of OpenSRF is 2.1.0.
14
15 In the following instructions, you are asked to perform certain steps as either the root or opensrf user.
16
17  * Debian: To become the root user, issue the su command and enter the password of the root user.
18  * Ubuntu: To become the root user, issue the sudo su command and enter the password of your current user.
19
20 To switch from the root user to a different user, issue the `su - [user]`
21 command; for example, `su - opensrf`. Once you have become a non-root user, to
22 become the root user again simply issue the `exit` command.
23
24 . Stop Evergreen and back up your data:
25  .. As root, stop the Apache web server.
26  .. As the opensrf user, stop all Evergreen and OpenSRF services:
27 +
28 [source, bash]
29 -----------------------------
30 osrf_ctl.sh -l -a stop_all
31 -----------------------------
32 +
33  .. Back up the /openils directory.
34  .. Back up the evergreen database.
35 . Upgrade OpenSRF. Download and install the latest version of OpenSRF from
36 the http://evergreen-ils.org/opensrf.php[OpenSRF download page].
37 . As the opensrf user, download and extract Evergreen 2.2
38 +
39 [source, bash]
40 -----------------------------------------------
41 wget http://evergreen-ils.org/downloads/previews/Evergreen-ILS-2.2-beta1.tar.gz
42 tar xzf Evergreen-ILS-2.2.beta1.tar.gz
43 -----------------------------------------------
44 +
45 [NOTE]
46 For the latest edition of Evergreen, check the http://evergreen-ils.org/downloads.php[Evergreen download page] and adjust upgrading instructions accordingly.
47 +
48 . As the root user, install the prerequisites:
49 +
50 [source, bash]
51 ----------------------------------------------
52 cd /home/opensrf/Evergreen-ILS-2.2-beta1
53 ---------------------------------------------
54 +
55 On the next command, replace [distribution] with one of these values for your distribution of Debian or Ubuntu:
56 * debian-squeeze for Debian Squeeze (6.0)
57 * ubuntu-lucid for Ubuntu Lucid Lynx (10.04)
58 * ubuntu-precise for Ubuntu Lucid Lynx (10.04)
59 +
60 [source, bash]
61 ------------------------------------------------------------
62 make -f Open-ILS/src/extras/Makefile.install [distribution]
63 ------------------------------------------------------------
64 +
65 . As the opensrf user, configure and compile Evergreen:
66 +
67 [source, bash]
68 ------------------------------------------------------------
69 cd /home/opensrf/Evergreen-ILS-2.2.beta1
70 ./configure --prefix=/openils --sysconfdir=/openils/conf
71 make
72 ------------------------------------------------------------
73 +
74 . As the root user, install Evergreen:
75 +
76 [source, bash]
77 ------------------------------------------------------------
78 make STAFF_CLIENT_BUILD_ID=rel_2_2_beta1 install
79 ------------------------------------------------------------
80 +
81 . As the root user, change all files to be owned by the opensrf user and group:
82 +
83 [source, bash]
84 ------------------------------------------------------------
85 chown -R opensrf:opensrf /openils
86 ------------------------------------------------------------
87 +
88 . As the opensrf user, update the configuration files:
89 +
90 [source, bash]
91 -----------------------------------------------------------
92 cd /home/opensrf/Evergreen-ILS-2.2.beta1
93
94 perl Open-ILS/src/support-scripts/eg_db_config.pl \
95 --create-offline --user evergreen --password evergreen \
96 --hostname localhost --port 5432 --database evergreen
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_2_beta1/server
106 ----------------------------------------------------------
107 +
108 . Change to the Evergreen installation directory:
109 +
110 [source, bash]
111 ----------------------------------------------------------
112 cd /home/opensrf/Evergreen-ILS-2.2.beta1
113 ---------------------------------------------------------
114 +
115 . Update the evergreen database:
116 +
117 It is recommended that you back up your Evergreen database in order to restore your data if anything goes wrong.
118 +
119 [CAUTION]
120 Pay attention to error output as you run these scripts. You should do
121 additional troubleshooting and error reporting to the
122 http://evergreen-ils.org/listserv.php[Evergreen Technical Discussion List] if
123 you encounter errors.
124 +
125 [source, bash]
126 ----------------------------------------------------------
127 cd /home/opensrf/Evergreen-ILS-2.1.beta1
128 psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.1-2.2-beta1.sql evergreen
129 ----------------------------------------------------------
130 +
131 . As the opensrf user, update opensrf_core.xml and opensrf.xml by copying the
132   new example files (/openils/conf/opensrf_core.xml.example and
133   /openils/conf/opensrf.xml).
134 +
135 [source, bash]
136 ----------------------------------------------------------
137 cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
138 cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
139 ----------------------------------------------------------
140 +
141 [CAUTION]
142 Copying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
143 +
144 . Update Apache files:
145 +
146 [CAUTION]
147 Copying these Apache configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
148 For example, if you purchased an SSL certificate, you will need to edit eg.conf to point to the appropriate SSL certificate files.
149 +
150 .. Update /etc/apache2/startup.pl by copying the example from Open-ILS/examples/apache/startup.pl.
151 .. Update /etc/apache2/eg_vhost.conf by copying the example from Open-ILS/examples/apache/eg_vhost.conf.
152 .. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/ examples/apache/eg.conf.
153 . Update opensrf.xml with the database connection info:
154 +
155 If you are happy with the default settings in opensrf.xml.example, then:
156 +
157 [source, bash]
158 -------------------------------------------------------------------------
159 cp -b /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
160 perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config --service all \
161 --database evergreen --host localhost --user evergreen --password evergreen
162 -------------------------------------------------------------------------
163 +
164 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
165
166 Restart Evergreen and Test
167 ~~~~~~~~~~~~~~~~~~~~~~~~~~
168 . As the opensrf user, start all Evergreen and OpenSRF services:
169 +
170 [source, bash]
171 --------------------------------------------------------------
172 osrf_ctl.sh -l -a start_all
173 --------------------------------------------------------------
174 +
175 . As the opensrf user, run autogen to refresh the static organizational data files:
176 +
177 [source, bash]
178 --------------------------------------------------------------
179 cd /openils/bin
180 ../autogen.sh
181 --------------------------------------------------------------
182 +
183 . Start srfsh and try logging in using your Evergreen username and password:
184 +
185 [source, bash]
186 --------------------------------------------------------------
187 /openils/bin/srfsh
188 srfsh% login username password
189 --------------------------------------------------------------
190 +
191 You should see a result like:
192 +
193 [source, bash]
194 ------------------------------------------------------
195 Received Data: "250bf1518c7527a03249858687714376"
196     ------------------------------------
197     Request Completed Successfully
198     Request Time in seconds: 0.045286
199     ------------------------------------
200
201     Received Data: {
202        "ilsevent":0,
203        "textcode":"SUCCESS",
204        "desc":" ",
205        "pid":21616,
206        "stacktrace":"oils_auth.c:304",
207        "payload":{
208           "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a",
209           "authtime":420
210        }
211
212     }
213
214     ------------------------------------
215     Request Completed Successfully
216     Request Time in seconds: 1.336568
217     ------------------------------------
218 ----------------------------------------------------------
219 +
220 If this does not work, it's time to do some troubleshooting.
221 +
222 . As the root user, start the Apache web server.
223 +
224 If you encounter errors, refer to the troubleshooting section of this documentation for tips on finding solutions and seeking further assistance
225 from the Evergreen community.