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