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: The minimum supported version is 10.

  • Linux: Evergreen 3.X.X has been tested on Debian Buster (10.0), Debian Bullseye (11.0), Ubuntu Focal Fossa (20.04), and Ubuntu Jammy Jellyfish (22.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 3.2.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 catalog skins.

  1. Stop Evergreen and back up your data:

    1. As root, stop the Apache web server.

    2. As the opensrf user, stop all Evergreen and OpenSRF services:

      osrf_control --localhost --stop-all
    3. Back up the /openils directory.

      1. Upgrade OpenSRF. Download and install the latest version of OpenSRF from the OpenSRF download page.

      2. As the opensrf user, download and extract Evergreen 3.X.X:

        wget https://evergreen-ils.org/downloads/Evergreen-ILS-3.X.X.tar.gz
        tar xzf Evergreen-ILS-3.X.X.tar.gz
        For the latest edition of Evergreen, check the Evergreen download page and adjust upgrading instructions accordingly.
  2. As the root user, install the prerequisites:

    cd /home/opensrf/Evergreen-ILS-3.X.X

    On the next command, replace [distribution] with one of these values for your distribution of Debian or Ubuntu:

    • debian-buster for Debian Buster (10.0)

    • debian-bullseye for Debian Bullseye (11.0)

    • ubuntu-focal for Ubuntu Focal Fossa (20.04)

    • ubuntu-jammy for Ubuntu Jammy Jellyfish (22.04)

    make -f Open-ILS/src/extras/Makefile.install [distribution]
  3. As the opensrf user, configure and compile Evergreen:

    cd /home/opensrf/Evergreen-ILS-3.X.X
    PATH=/openils/bin:$PATH ./configure --prefix=/openils --sysconfdir=/openils/conf
    make

    These instructions assume that you have also installed OpenSRF under /openils/. If not, please adjust PATH as needed so that the Evergreen configure script can find osrf_config.

  4. As the root user, install Evergreen:

    cd /home/opensrf/Evergreen-ILS-3.X.X
    make install

    Note that this version of Evergreen does not use the legacy XUL staff client by default, but if you wish to use a versioned XUL staff client, you can supply STAFF_CLIENT_STAMP during the make install step like this:

    cd /home/opensrf/Evergreen-ILS-3.X.X
    make STAFF_CLIENT_STAMP_ID=rel_3_x_x install
  5. As the root user, change all files to be owned by the opensrf user and group:

    chown -R opensrf:opensrf /openils
  6. (Optional, only if you are using the legacy staff client) As the opensrf user, update the server symlink in /openils/var/web/xul/:

    cd /openils/var/web/xul/
    rm server
    ln -sf rel_3_x_x/server server
  7. 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.

    cp -b /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
    cp -b /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
    Copying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying them.
  8. As the opensrf user, update the configuration files:

    cd /home/opensrf/Evergreen-ILS-3.X.X
    perl Open-ILS/src/support-scripts/eg_db_config --update-config --service all \
    --create-offline --database evergreen --host localhost --user evergreen --password evergreen
  9. As the root user, update the Apache files:

    Use the example configuration files in Open-ILS/examples/apache/ (for Apache versions below 2.4) or Open-ILS/examples/apache_24/ (for Apache versions 2.4 or greater) to configure your Web server for the Evergreen catalog, staff client, Web services, and administration interfaces. Issue the following commands as the root Linux account:

    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. The diff command can be used to show the differences between the distribution version and your customized version. diff <customized file> <dist file>
    1. Update /etc/apache2/eg_startup by copying the example from Open-ILS/examples/apache/eg_startup.

      cp /home/opensrf/Evergreen-ILS-3.X.X/Open-ILS/examples/apache/eg_startup /etc/apache2/eg_startup
    2. Update /etc/apache2/eg_vhost.conf by copying the example from Open-ILS/examples/apache/eg_vhost.conf.

      cp /home/opensrf/Evergreen-ILS-3.X.X/Open-ILS/examples/apache/eg_vhost.conf /etc/apache2/eg_vhost.conf
    3. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/examples/apache/eg.conf.

      cp /home/opensrf/Evergreen-ILS-3.X.X/Open-ILS/examples/apache/eg.conf /etc/apache2/sites-available/eg.conf

Upgrade the Evergreen 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.

Evergreen provides incremental upgrade scripts that allow you to upgrade from one minor version to the next until you have the current version of the schema. For example, if you want to upgrade from 2.9.0 to 2.11.0, you would run the following upgrade scripts:

  • 2.9.0-2.9.1-upgrade-db.sql

  • 2.9.1-2.9.2-upgrade-db.sql

  • 2.9.2-2.9.3-upgrade-db.sql

  • 2.9.3-2.10.0-upgrade-db.sql (this is a major version upgrade)

  • 2.10.0-2.10.1-upgrade-db.sql

  • 2.10.1-2.10.2-upgrade-db.sql

  • 2.10.2-2.10.3-upgrade-db.sql

  • 2.10.3-2.10.4-upgrade-db.sql

  • 2.10.4-2.10.5-upgrade-db.sql

  • 2.10.5-2.10.6-upgrade-db.sql

  • 2.10.6-2.10.7-upgrade-db.sql

  • 2.10.7-2.11.0-upgrade-db.sql (this is a major version upgrade)

Note that you do not necessarily want to run additional upgrade scripts to upgrade to the newest version, since currently there is no automated way, for example to upgrade from 2.9.4+ to 2.10. Only upgrade as far as necessary to reach the major version upgrade script (in this example, as far as 2.9.3).

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 Evergreen Technical Discussion List.

Run the following steps (including other upgrade scripts, as noted above) as a user with the ability to connect to the database server.

cd /home/opensrf/Evergreen-ILS-3.X.X/Open-ILS/src/sql/Pg
psql -U evergreen -h localhost -f version-upgrade/3.X.W-3.X.X-upgrade-db.sql evergreen
After the some database upgrade scripts finish, you may see a note on how to reingest your bib records. You may run this after you have completed the entire upgrade and tested your system. Reingesting records may take a long time depending on the number of bib records in your system.

Restart Evergreen and Test

  1. As the root user, restart memcached to clear out all old user sessions.

    service memcached restart
  2. As the opensrf user, start all Evergreen and OpenSRF services:

    osrf_control --localhost --start-all
  3. As the opensrf user, run autogen to refresh the static organizational data files:

    cd /openils/bin
    ./autogen.sh
  4. Start srfsh and try logging in using your Evergreen username and password:

    /openils/bin/srfsh
    srfsh% login username password

    You should see a result like:

    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.

  5. 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.

Review Release Notes

Review this version’s release notes for other tasks that need to be done after upgrading. If you have upgraded over several major versions, you will need to review the release notes for each version also.