wiki:sysadminProcedureForUpgradingEvergreen24

Before beginning the actual upgrade

  1. Backup the db to darkmatter (this is a lot faster than doing a pg_dump / restore).
    • start a screen session
    • Set up a tunneled connection from darkmatter to kochab via polaris replication user connection info is in /etc/postgresql/9.1/main/recovery.conf on the replica (polaris).
      ssh -f -N -L 6432:kochab.cs.uoguelph.ca:5432 lauadmin@polaris.cs.uoguelph.ca 
      
    • Stop osrf on comet
      osrf_ctl.sh -l -a stop_all
      
    • Drop the cluster on the target (as postgres user on darkmatter)
      pg_dropcluster --stop 9.1 evergreen
      
    • Bring in the db from kochab via the tunnel
      pg_basebackup -D /data/postgresql/9.1/evergreen -x -P -h localhost -p 6432 -U replicant
      
    • Fire up opensrf on comet
      osrf_ctl.sh -l -a start_all
      
  2. Get config files in order
    • Check to see if opensrf.xml and opensrf_core.xml are different on the new install. If the new version of the conf files outline new services that we don't have, go ahead and edit them so we can just drop them into /openils/conf when the time comes and we don't need to fool around too much with vim.
    • Check to see if the apache configuration is the same. If not make the necessary changes to the files in advance.
  3. Install the database prerequisites on both kohab and polaris. From the README, run the following commands as the root user:
    aptitude install gcc libxml-libxml-perl libxml-libxslt-perl
    cpan Business::ISBN
    cpan JSON::XS
    cpan Library::CallNumber::LC
    cpan MARC::Record
    cpan MARC::File::XML
    cpan UUID::Tiny
    cpan Rose::URI
    

The upgrade

Shutdown

  1. Shutdown opensrf on protostar and carbon in order:
    # On carbon
    osrf_ctl.sh -a stop_router
    # On carbon
    osrf_ctl.sh -a stop_perl
    # On protostar
    osrf_ctl.sh -a stop_perl
    # On carbon
    osrf_ctl.sh -a stop_c
    # On protostar
    osrf_ctl.sh -a stop_c
    
  1. Shutdown clark-kent
    ps wax | grep Clark; kill <PID>; rm /tmp/reporter-LOCK
    
  1. Shutdown cron on both protostar and carbon
    su - opensrf
    crontab -e #comment out cronjobs
    
  1. Shutdown z39.50 on protostar:
    su - lauadmin
    killall simple2zoom
    

Backup /openils and clone repos

  1. backup /openils on protostar to your home directory (make sure you have enough space first)
    sudo tar -czf /home/risard/openils.tar.gz /openils
    
  1. Update our sources
    # First, update OpenSRF
    cd /openils/sources/OpenSRF
    git fetch --all
    git checkout -b install_2013_06 origin/master
    # Next, update Conifer
    cd /openils/sources/Conifer
    git fetch --all
    git checkout -b install_2013_06 origin/rel_2_4_mergery_tpac
    

Upgrade Schema

  1. Upgrade the DB schema. From the git repository directory, run the database upgrade, directing STDOUT and STDERR into a log file:
    cd /openils/sources/Conifer
    # Switch to the upgrade_db_2_4 branch
    git checkout origin/feature/upgrade_db_2_4
    cd Open-ILS/src/sql/Pg/version-upgrade
    psql -U evergreen -h kochab -d conifer -f conifer-2_4_step1-single-updates.sql > ~/upgrade_2_4_step1.out 2>&1
    psql -U evergreen -h kochab -d conifer -f conifer-2_4_step2-2.3.4-2.3.5.sql > ~/upgrade_2_4_step2.out 2>&1
    psql -U evergreen -h kochab -d conifer -f 2.3.5-2.3.6-upgrade-db.sql > ~/upgrade_2_4_upgrade-db.out 2>&1
    psql -U evergreen -h kochab -d conifer -f conifer-2_4_step4a.sql > ~/upgrade_2_4_step4a.out 2>&1 
    psql -U evergreen -h kochab -d conifer -f conifer-2_4_step4b.sql > ~/upgrade_2_4_step4b.out 2>&1 
    psql -U evergreen -h kochab -d conifer -f conifer-2_4_step4c.sql > ~/upgrade_2_4_step4c.out 2>&1 
    
  2. run the supplemental script
    psql -U evergreen -h kochab -d conifer -v eg_version=null -f ./2.3-2.4-supplemental.sh > ~/upgrade_2_4_sup.out 2>&1 
    

Install OpenSRF

  1. install pre-reqs on both carbon and protostar. You need to run this on each machine, so run through the steps on protostar first, and then /openils will have updated sources so that you can run the same command from /openils/sources/Conifer on carbon.
    sudo su -
    cd /openils/sources/OpenSRF
    make -f src/extras/Makefile.install debian-squeeze
    
  2. configure (as the linux user)
    ./configure --prefix=/openils --sysconfdir=/openils/conf --enable-python
    make
    
  3. On protostar, install OpenSRF, set the permissions, and update the dynamic library cache:
    sudo su -
    cd /openils/sources/OpenSRF
    make install
    chown -R opensrf:opensrf /openils
    ldconfig
    
  4. On carbon, as the linux user, install just the Perl modules:
    cd /openils/sources/OpenSRF
    cd src/perl
    sudo ./Build install
    # refresh the dynamic library cache to reflect the new Evergreen libraries on /openils
    sudo ldconfig
    

Upgrade the evergreen code

  1. Install pre-reqs on both carbon and protostar. You need to run this step on each machine, so run through the steps on protostar first, and then /openils will have updated sources so that you can run the same command from /openils/sources/Conifer on carbon.
    cd /openils/sources/Conifer
    git checkout install_2013_06
    make -f Open-ILS/src/extras/Makefile.install debian-squeeze
    
  1. On protostar, build and install evergreen
    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
    
  1. On protostar, install all of the TPAC skin templates and ensure no old templates are hanging around
    cd /openils/sources/Conifer
    # ensure we're on the install branch, just in case
    git checkout install_2013_06
    # become root, because most of the following steps require it
    sudo su -
    cd /openils/sources/Conifer
    rm -fr /openils/var/templates_*
    cp -r Open-ILS/src/templates_* /openils/var/
    
  1. Build the staff client. This automatically creates the partial updates and generates the page that users see at http://clients.concat.ca so that they can download the full client if necessary:
    cd Open-ILS/xul/staff_client 
    STAFF_CLIENT_BUILD_ID=conifer_2_4_0 AUTOUPDATE_HOST=clients.concat.ca make rigrelease rebuild clients updates-client
    # set permissions again
    sudo chown -R opensrf:opensrf /openils
    # refresh the dynamic library cache to reflect the new Evergreen libraries on /openils
    sudo ldconfig
    
  1. On carbon, install just the Perl modules:
    cd /openils/sources/Conifer
    cd Open-ILS/src/perlmods/lib
    sudo ./Build install
    # refresh the dynamic library cache to reflect the new Evergreen libraries on /openils
    sudo ldconfig
    

Start up Evergreen

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
  1. On protostar, as the root user, start the Apache server:
    /etc/init.d/apache2 restart
    
  1. Restart the cron jobs for opensrf on carbon and protostar
    /openils/bin/clark-kent.pl --daemon --concurrency 2
    
  1. On protostar, as the lauadmin user , restart the Z39.50 server:
    sudo su - lauadmin
    cd /home/lauadmin/z3950_server
    sh run-server
    
Last modified 7 years ago Last modified on Jun 14, 2013, 12:30:19 PM