Chapter 11. Upgrading Evergreen to 2.1

Abstract

This Chapter will explain the step-by-step process of upgrading Evergreen to 2.1, including steps to upgrade OpenSRF. 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.

Evergreen 2.1 has several software requirements:

In the following instructions, you are asked to perform certain steps as either the root or opensrf 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.

In the following instructions, /path/to/OpenSRF/ represents the path to the OpenSRF source directory.

  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_ctl.sh -l -a stop_all
    3. Back up of the /openils directory.

    4. Back up the evergreen database.

  2. Upgrade OpenSRF to the latest edition.

    Note

    You may skip this step if the latest version of OpenSRF 2.0.x was previously installed.

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

  3. As the opensrf user, download and extract Evergreen 2.1

    
    wget http://www.open-ils.org/downloads/Evergreen-ILS-2.1.3.tar.gz
    tar xzf Evergreen-ILS-2.1.3.tar.gz
    

    Note

    For the latest edition of Evergreen 2.1, check the Evergreen download page at http://www.open-ils.org/downloads.php and adjust upgrading instructions accordingly.

  4. As the root user, install the prerequisites:

    cd /home/opensrf/Evergreen-ILS-2.1.3

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

    • debian-squeeze for Debian Squeeze (6.0)

    • ubuntu-lucid for Ubuntu Lucid Lynx (10.04)

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

    cd/home/opensrf/Evergreen-ILS-2.1.3
    ./configure --prefix=/openils --sysconfdir=/openils/conf
    make
  6. As the root user, install Evergreen:

    make STAFF_CLIENT_BUILD_ID=rel_2_1_3 install
  7. As the root user, change all files to be owned by the opensrf user and group:

    chown -R opensrf:opensrf /openils
  8. As the opensrf user, update configuration files:

    
    cd /home/opensrf/Evergreen-ILS-2.1.3
    # and offline-config.pl for the offline staff client data uploader
    perl Open-ILS/src/support-scripts/eg_db_config.pl \
      --create-offline --user evergreen --password evergreen \
      --hostname localhost --port 5432 --database evergreen
    
  9. As the opensrf user, update server symlink in /openils/var/web/xul/:

    
    cd /openils/var/web/xul/
    rm server
    ln -s rel_2_1_3/server
    
  10. Change to the Evergreen installation directory:

    cd /home/opensrf/Evergreen-ILS-2.1.3
  11. Update the evergreen database:

    Note

    It is recommended that you back up your Evergreen database in order to restore your data if anything goes wrong.

    If you were running Evergreen 2.0.x on PostgreSQL 8.4, you will need to upgrade to PostgreSQL 9.0:

    1. Install the PostgreSQL 9.0 server packages following the installation instructions. Pay close attention to the backports section.

    2. Upgrade your existing PostgreSQL 8.4 cluster to a PostgreSQL 9.0 cluster by issuing the following commands as root:

      1. Blow away the default PostgreSQL 9.0 main cluster:

        pg_dropcluster 9.0 main
      2. Upgrade your production PostgreSQL 8.4 main cluster

        pg_upgradecluster --stop 8.4 main
      3. OPTIONAL: Blow away your old PostgreSQL 8.4 main cluster. If you don't do this, then you might need to update opensrf.xml with new port numbers (probably 5433)

        pg_dropcluster 8.4 main
    3. Add the hstore PostgreSQL contrib module to your Evergreen database:

      
      psql -U evergreen -h localhost -f /usr/share/postgresql/9.0/contrib/hstore.sql -d evergreen
      
  12. Upgrade Evergreen Schema.

    Caution

    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.

    
    cd /home/opensrf/Evergreen-ILS-2.1.3
    psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/version-upgrade/2.0-2.1-upgrade-db.sql evergreen
    psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/version-upgrade/2.1.0-2.1.1-upgrade-db.sql evergreen
    psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/version-upgrade/2.1.1-2.1.2-upgrade-db.sql evergreen
    psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/version-upgrade/2.1.2-2.1.3-upgrade-db.sql evergreen
    
    
  13. 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.)

    cp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xml
  14. Update opensrf_core.xml and opensrf.xml by copying the new example files (/openils/conf/opensrf_core.xml.example and /openils/conf/opensrf.xml).

    cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml
    cp /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.

  15. Update Apache files:

    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.

    1. Update /etc/apache2/startup.pl by copying the example from Open-ILS/examples/apache/startup.pl.

    2. Update /etc/apache2/eg_vhost.conf by copying the example from Open-ILS/examples/apache/eg_vhost.conf.

    3. Update /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/ examples/apache/eg.conf.

  16. Update opensrf.xml with the database connection info:

    If you are happy with the default settings in opensrf.xml.example, then:

    
    cp -b /openils/conf/opensrf.xml.example /openils/conf/opensrf.xml
    perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config --service all \
      --database evergreen --host localhost --user evergreen --password evergreen
    

    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

  17. As of Evergreen 2.1.1, the Perl modules are installed in the normal location on the system. To avoid conflicting versions, get the old versions of Perl modules out of your PERL5LIB path. Issue the following command as the opensrf user:

    
    mv /openils/lib/perl5 /openils/lib/perl5-2.0
    

Restart Evergreen and Test

  1. As the opensrf user, start all Evergreen and OpenSRF services:

    osrf_ctl.sh -l -a start_all
  2. As the opensrf user, run autogen to refresh the static organizational data files:

    
    cd /openils/bin
    ./autogen.sh -c /openils/conf/opensrf_core.xml -u
    
  3. Start srfsh and try logging in using your Evergreen username and password:

    /openils/bin/srfsh
    srfsh% login username password
    
  4. Start the Apache web server.

Note

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.