Upgrading the Evergreen Server ------------------------------ Before upgrading, it is important to carefully plan an upgrade strategy to minimize system downtime and service interruptions. All of the steps in this chapter are to be completed from the command line. Software Prerequisites ~~~~~~~~~~~~~~~~~~~~~~ * **PostgreSQL**: Version 9.1 is recommended. The minimum supported version is 9.1. * **Linux**: Evergreen 2.5 has been tested on Debian Wheezy (7.0), Debian Squeeze (6.0), Ubuntu Precise Pangolin (12.04) and Ubuntu Lucid Lynx (10.04). If you are running an older version of these distributions, you may want to upgrade before upgrading Evergreen. For instructions on upgrading these distributions, visit the Debian or Ubuntu websites. * **OpenSRF**: The minimum supported version of OpenSRF is 2.3.0. In the following instructions, you are asked to perform certain steps as either the root or opensrf user. * **Debian**: To become the root user, issue the `su` command and enter the password of the root user. * **Ubuntu**: To become the root user, issue the `sudo su` command and enter the password of your current user. 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. Upgrade the Evergreen code ~~~~~~~~~~~~~~~~~~~~~~~~~~ The following steps guide you through a simplistic upgrade of a production server. You must adjust these steps to accommodate your customizations such as catalogue skins. . Stop Evergreen and back up your data: .. As root, stop the Apache web server. .. As the opensrf user, stop all Evergreen and OpenSRF services: + [source, bash] ----------------------------- osrf_control --localhost --stop-all ----------------------------- + .. Back up the /openils directory. . Upgrade OpenSRF. Download and install the latest version of OpenSRF from the http://evergreen-ils.org/opensrf-downloads/[OpenSRF download page]. . As the opensrf user, download and extract Evergreen 2.5: + [source, bash] ----------------------------------------------- wget http://evergreen-ils.org/downloads/previews/Evergreen-ILS-2.5.0.tar.gz tar xzf Evergreen-ILS-2.5.0.tar.gz ----------------------------------------------- + [NOTE] For the latest edition of Evergreen, check the http://evergreen-ils.org/downloads.php[Evergreen download page] and adjust upgrading instructions accordingly. . As the root user, install the prerequisites: + [source, bash] --------------------------------------------- cd /home/opensrf/Evergreen-ILS-2.5.0 --------------------------------------------- + On the next command, replace `[distribution]` with one of these values for your distribution of Debian or Ubuntu: + indexterm:[Linux, Debian] indexterm:[Linux, Ubuntu] + * `debian-wheezy` for Debian Wheezy (7.0) * `debian-squeeze` for Debian Squeeze (6.0) * `ubuntu-precise` for Ubuntu Precise Pangolin (12.04) * `ubuntu-lucid` for Ubuntu Lucid Lynx (10.04) + [source, bash] ------------------------------------------------------------ make -f Open-ILS/src/extras/Makefile.install [distribution] ------------------------------------------------------------ + . As the opensrf user, configure and compile Evergreen: + [source, bash] ------------------------------------------------------------ cd /home/opensrf/Evergreen-ILS-2.5.0 ./configure --prefix=/openils --sysconfdir=/openils/conf make ------------------------------------------------------------ + . As the root user, install Evergreen: + [source, bash] ------------------------------------------------------------ cd /home/opensrf/Evergreen-ILS-2.5.0 make STAFF_CLIENT_STAMP_ID=rel_2_5_0 install ------------------------------------------------------------ + . As the root user, change all files to be owned by the opensrf user and group: + [source, bash] ------------------------------------------------------------ chown -R opensrf:opensrf /openils ------------------------------------------------------------ + . As the opensrf user, update the server symlink in /openils/var/web/xul/: + [source, bash] ----------------------------------------------------------- cd /openils/var/web/xul/ rm server ln -sf rel_2_5_0/server server ---------------------------------------------------------- + . As the opensrf user, update opensrf_core.xml and opensrf.xml by copying the new example files (/openils/conf/opensrf_core.xml.example and /openils/conf/opensrf.xml). The _-b_ option creates a backup copy of the old file. + [source, bash] ---------------------------------------------------------- cp -b /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml cp -b /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml ---------------------------------------------------------- + [CAUTION] Copying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them. + . As the opensrf user, update the configuration files: + [source, bash] ------------------------------------------------------------------------- cd /home/opensrf/Evergreen-ILS-2.5.0 perl Open-ILS/src/support-scripts/eg_db_config --update-config --service all \ --create-offline --database evergreen --host localhost --user evergreen --password evergreen ------------------------------------------------------------------------- + . As the _root_ user, update the Apache files: + indexterm:[Apache] + [CAUTION] Copying these Apache configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them. For example, if you purchased an SSL certificate, you will need to edit eg.conf to point to the appropriate SSL certificate files. + .. Update _/etc/apache2/eg_startup_ by copying the example from _Open-ILS/examples/apache/eg_startup_. + [source, bash] ---------------------------------------------------------- cp /home/opensrf/Evergreen-ILS-2.5.0/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup ---------------------------------------------------------- + .. Update /etc/apache2/eg_vhost.conf by copying the example from Open-ILS/examples/apache/eg_vhost.conf. + [source, bash] ---------------------------------------------------------- cp /home/opensrf/Evergreen-ILS-2.5.0/Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/eg_vhost.conf ---------------------------------------------------------- + .. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/examples/apache/eg.conf. + [source, bash] ---------------------------------------------------------- cp /home/opensrf/Evergreen-ILS-2.5.0/Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/eg.conf ---------------------------------------------------------- Upgrade the Evergreen database schema ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ indexterm:[database schema] The upgrade of the Evergreen database schema is the lengthiest part of the upgrade process for sites with a significant amount of production data. Before running the upgrade script against your production Evergreen database, back up your database, restore it to a test server, and run the upgrade script against the test server. This enables you to determine how long the upgrade will take and whether any local customizations present problems for the stock upgrade script that require further tailoring of the upgrade script. The backup also enables you to cleanly restore your production data if anything goes wrong during the upgrade. [CAUTION] Pay attention to error output as you run the upgrade scripts. If you encounter errors that you cannot resolve yourself through additional troubleshooting, please report the errors to the http://evergreen-ils.org/communicate/mailing-lists/[Evergreen Technical Discussion List]. Run the following steps as a user with the ability to connect to the database server. [source, bash] ---------------------------------------------------------- cd /home/opensrf/Evergreen-ILS-2.5.0/Open-ILS/src/sql/Pg psql -U evergreen -h localhost -f version-upgrade/2.4.3-2.5.0-upgrade-db.sql evergreen ---------------------------------------------------------- Restart Evergreen and Test ~~~~~~~~~~~~~~~~~~~~~~~~~~ . As the opensrf user, start all Evergreen and OpenSRF services: + [source, bash] -------------------------------------------------------------- osrf_control --localhost --start-all -------------------------------------------------------------- + . As the opensrf user, run autogen to refresh the static organizational data files: + [source, bash] -------------------------------------------------------------- cd /openils/bin ./autogen.sh -------------------------------------------------------------- + . Start srfsh and try logging in using your Evergreen username and password: + [source, bash] -------------------------------------------------------------- /openils/bin/srfsh srfsh% login username password -------------------------------------------------------------- + You should see a result like: + [source, bash] ------------------------------------------------------ Received Data: "250bf1518c7527a03249858687714376" ------------------------------------ Request Completed Successfully Request Time in seconds: 0.045286 ------------------------------------ Received Data: { "ilsevent":0, "textcode":"SUCCESS", "desc":" ", "pid":21616, "stacktrace":"oils_auth.c:304", "payload":{ "authtoken":"e5f9827cc0f93b503a1cc66bee6bdd1a", "authtime":420 } } ------------------------------------ Request Completed Successfully Request Time in seconds: 1.336568 ------------------------------------ ---------------------------------------------------------- + If this does not work, it's time to do some troubleshooting. + . As the root user, start the Apache web server. + 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.