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