wiki:sysadminProcedureForUpgradingEvergreen

Procedure for upgrading Evergreen

Quick notes based on the upgrade from 2.0 to 2.1:

Before beginning the actual upgrade

Prepare!

  1. Set up your release-specific feature branches in git (http://git.evergreen-ils.org/?p=contrib/Conifer.git - see feature/*_2_1 branches)
  2. Merge all release-specific feature branches into one merge branch (for this upgrade, dbs/rel_2_1_mergery)
  3. Test the following steps on a test server (modifying server names / passwords accordingly)

Upgrade the database schema

Depending on the operations involved (for example, updating every call number and every copy), this may take many hours.

  1. Upgrade any database server prerequisites (for this upgrade, cpan Library::CallNumber::LC)
  2. Prevent any write operations that might affect the database via lock escalation:
    1. Kill clark-kent.pl on protostar (ps wax | grep Clark; kill <PID>; rm /tmp/reporter-LOCK)
    2. Disable cron jobs on protostar and carbon (su - opensrf; crontab -e and comment out the cron jobs)
  3. Upgrade the database schema; :
    1. Grab the version upgrade branch (note: given the reorganization of version upgrades in master, I chose to build this branch against master and therefore it is not part of the merge branch!)
      1. git clone git://git.evergreen-ils.org/contrib/Conifer.git (only need to do this once, then you can use git fetch --all and git checkout to update and switch branches)
      2. cd Conifer
      3. git checkout origin/feature/upgrade_2_1
    2. From the git repository directory, run the database upgrade, directing STDOUT and STDERR into a log file:
      1. psql -U evergreen -h <HOSTNAME> -d <DBNAME> -f Open-ILS/src/sql/Pg/version-upgrade/2.0-2.1-upgrade-db.sql > ~/upgrade_2_1.out 2>&1

Upgrade the Evergreen code

You can run through these steps while the database schema is being upgraded.

  1. On protostar (the server on which /openils/ is mounted as a writable NFS share), get your merge branch from git:
    1. cd /openils/sources
    2. git clone git://git.evergreen-ils.org/contrib/Conifer.git (only need to do this once, then you can use git fetch --all and git checkout to update and switch branches)
    3. cd Conifer
    4. git checkout origin/dbs/mergery_2_1
  2. Install all of the prerequisites on both protostar and carbon:
    1. make -f Open-ILS/src/extras/Makefile.install debian-squeeze
    2. apt-get install nsis
    3. Add a route to nsis.sourceforge.net for one of the staff client install pieces:
      sudo route add -net 216.34.181.96 netmask 255.255.255.255 gw 131.104.100.161 dev eth0
      
    4. Move the system-installed libdbi out of the way (it gets installed as a dependency on syslog-ng, eventually we need to replace with rsyslog):
      sudo mv /usr/lib/libdbi.a /usr/lib/libdbi.a.bak
      sudo mv /usr/lib/libdbi.la /usr/lib/libdbi.la.bak
      sudo mv /usr/lib/libdbi.so.0 /usr/lib/libdbi.so.0.bak
      sudo mv /usr/lib/libdbi.so.0.0.5 /usr/lib/libdbi.so.0.0.5.bak
      sudo ldconfig
      
  3. Build Evergreen, including all desired locales, and specify the automatic update hostname for the client:
    cd build/i18n
    make LOCALE=en-CA install 
    make LOCALE=fr-CA install
    cd ../..
    ./autogen.sh
    ./configure --prefix=/openils --sysconf=/openils/conf --enable-python --with-updateshost=clients.concat.ca --localstatedir=/var/local
    make
    sudo make install
    # Install all of the TPAC skin templates and ensure no old templates are hanging around
    sudo rm -fr /openils/var/templates_*; cp -r Open-ILS/src/templates_* /openils/var/.
    cd Open-ILS/xul/staff_client && sudo make rigrelease rebuild updates-client
    sudo chown -R opensrf:opensrf /openils
    
  4. Configure Evergreen opensrf_core.xml and opensrf.xml with any new stanzas that are required (diff is your friend)
  5. Configure Apache configuration files with any new required stanzas

Now get the Perl modules installed on carbon:

  1. cd /openils/sources/Conifer
  2. cd Open-ILS/src/perlmods/lib
  3. sudo ./Build install

Starting things up after the install

  1. As the opensrf user, start up the OpenSRF processes on carbon and protostar in order, then generate the required JavaScript? files, etc, via autogen.sh:
    # On carbon
    osrf_ctl.sh -a start_router
    # On carbon
    osrf_ctl.sh -a start_perl
    # On protostar
    osrf_ctl.sh -a start_perl
    # On carbon
    osrf_ctl.sh -a start_c
    # On protostar
    osrf_ctl.sh -a start_c
    # On protostar
    autogen.sh -u
    
  2. On protostar, as the root user, start the Apache server:
    /etc/init.d/apache2 restart
    
  3. Restart the cron jobs for opensrf on carbon and protostar
  4. On protostar, as the opensrf user, restart the reporter daemon:
    /openils/bin/clark-kent.pl --daemon --concurrency 2
    
  5. On protostar, as the lauadmin user, restart the Z39.50 server:
    cd /home/lauadmin/z3950_server
    sh run-server
    
Last modified 10 years ago Last modified on Jun 13, 2013, 12:48:10 PM