Upgrading Evergreen to 2.0This Chapter will explain the step-by-step process of upgrading Evergreen
to 2.0, 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.0 has several software requirements:PostgreSQL: Version 8.4 is the minimum supported version of PostgreSQL. Linux: Evergreen 2.0 has been tested on Debian Squeeze (6.0) and Ubuntu Lucid Lynx (10.04). If you are running an older version of these distributions,
you may want to upgrade befor installing Evergreen 2.0. For instructions on upgrading these distributions, visit the
Debian or Ubuntu websites.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.In the following instructions, /path/to/OpenSRF/ represents the path to the OpenSRF source directory.Backing Up DataAs root, stop the Apache
web serverweb serverApache.As the opensrf user, stop all
Evergreen
and OpenSRF services:osrf_ctl.sh -l -a stop_allBack up of the /openils
directory.Back up the evergreen
database.Upgrading OpenSRF to 2.0OpenSRFAs the opensrf user, download and extract the source files for OpenSRF
2.0:
wget http://open-ils.org/downloads/opensrf-2.0.1.tar.gz
tar xzf opensrf-2.0.1.tar.gz
A new directory opensrf-2.0.1 is created.For the latest edition of OpenSRF, check the Evergreen download page at
.
As the root user, install the software prerequisites using the automatic
prerequisite installer.
aptitude install make
cd /home/opensrf/opensrf-2.0.1
Replace below with the following value
for your distribution: for Debian Squeeze (6.0)LinuxDebian for Fedora 13LinuxFedora for Ubuntu Lucid Lynx
(10.04)LinuxUbuntu for CentOS 5LinuxCentOS for Red Hat Enterprise Linux 5LinuxRed Hat
make -f src/extras/Makefile.install [distribution]
This will install a number of packages required by OpenSRF on your system,
including some Perl modules from CPANPerlCPAN. You can type no to the initial CPAN
configuration prompt to allow it to automatically configure itself to download
and install Perl modules from CPAN. The CPAN installer will ask you a number of
times whether it should install prerequisite modules - type yes.As the opensrf user, configure and compile OpenSRF:You can include the and configure options if
you want to include support for PythonPython and Java
Java, respectively.
cd /home/opensrf/opensrf-2.0.1
./configure --prefix=/openils --sysconfdir=/openils/conf
make
As the root user, return to your OpenSRF build directory and install
OpenSRF:
cd /home/opensrf/opensrf-2.0.1
make install
As the root user, change the ownership of the installed files to the
opensrf user:chown -R opensrf:opensrf /openilsJot down the usernames/passwords of the two Jabber users created when OpenSRF was previously installed these users will correspond to
entries in opensrf_core.xml. Important: Backup your current opensrf.xml and opensrf_core.xml configuration files.cp -p /openils/conf/opensrf.xml /openils/conf/opensrf.xml.backupcp -p /openils/conf/opensrf_core.xml /openils/conf/opensrf_core.xml.backupAs the opensrf user, copy the /openils/conf/opensrf_core.xml and
/openils/conf/opensrf.xml configuration files from the example templates:cp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xmlcp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xmlEdit /openils/conf/opensrf_core.xml to change the Jabber usernames and passwords you jotted down earlier.As the root user, Run the following command:ldconfigRestart and Test OpenSRF
osrf_ctl.sh -l -a start_all
/openils/bin/srfsh
srfsh# request opensrf.math add 2 2
You should see output such as:
Received Data: 4
------------------------------------
Request Completed Successfully
Request Time in seconds: 0.007519
------------------------------------
srfsh#
If test completed successful restore your Evergreen configuration files:
cp /openils/conf/opensrf.xml.backup /openils/conf/opensrf.xml
cp /openils/conf/opensrf_core.xml.backup /openils/conf/opensrf_core.xml
and move on to the next section to upgrade Evergreen. Otherwise, refer to the troubleshooting chapter
of this documentation.Upgrade Evergreen from 1.6.1 to 2.0PostgreSQL 8.4 is the minimum supported version of PostgreSQL.Evergreen 2.0 has been tested on Debian Squeeze (6.0) and Ubuntu Lucid (10.04). If you are runnung an older version of
these distributions, you may want to upgrade befor installing Evergreen 2.0. For instructions on upgrading these distribuitions, visit the
Debian or Ubuntu websites.As the opensrf user, download and extract Evergreen 2.0
wget http://www.open-ils.org/downloads/Evergreen-ILS-2.0.9.tar.gz
tar xzf Evergreen-ILS-2.0.9.tar.gz
For the latest edition of Evergreen 2.0, check the Evergreen download page at
and adjust upgrading instructions accordingly.As the root user, install the prerequisites:cd /home/opensrf/Evergreen-ILS-2.0.9On the next command, replace with one of
these values for your distribution of Debian or Ubuntu: for Debian Squeeze (6.0) for Ubuntu Lucid Lynx
(10.04)make -f Open-ILS/src/extras/Makefile.install As the opensrf user, configure and compile
Evergreen:cd /home/opensrf/Evergreen-ILS-2.0.9./configure --prefix=/openils --sysconfdir=/openils/confmakeAs the root user, install
Evergreen:make STAFF_CLIENT_BUILD_ID=rel_2_0_9 installAs the root user, change all files to be owned by the
opensrf user and group:chown -R opensrf:opensrf /openilsAs the opensrf user, update server symlink in /openils/var/web/xul/:
cd /openils/var/web/xul/
rm server
ln -s rel_2_0_9/server
Change to the Evergreen installation
directory:cd /home/opensrf/Evergreen-ILS-2.0.9Update the evergreen database:It is recommended that you back up your Evergreen database in order to restore your data if anything goes wrong.The 1.6.1-2.0-upgrade-db.sql upgrade script may take a long time (hours) to process
on larger systems.
psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql evergreen
psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.0-2.0.1-upgrade-db.sql evergreen
psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.1-2.0.2-upgrade-db.sql evergreen
psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.2-2.0.3-upgrade-db.sql evergreen
psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.3-2.0.4-upgrade-db.sql evergreen
psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.4-2.0.5-upgrade-db.sql evergreen
psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.5-2.0.6-upgrade-db.sql evergreen
psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.6-2.0.7-upgrade-db.sql evergreen
psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.7-2.0.8-upgrade-db.sql evergreen
psql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/2.0.8-2.0.9-upgrade-db.sql evergreen
Run the reingest-1.6-2.0.pl script to generate an sql script. Then use the sql file to reingest bib records into your
evergreen database. This is required to make the new facet sidebar in OPAC search results work and to upgrade the keyword indexes to use
the revised NACO normalization routine.If you are running a large Evergreen installation, it is recommend that you examine the script first. Reingesting a large number of bibliographic records
may take several hours.perl Open-ILS/src/sql/Pg/reingest-1.6-2.0.plpsql -U evergreen -h localhost -f Open-ILS/src/sql/Pg/reingest-1.6-2.0.sql evergreenAs 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.)configuration filesoils_web.xmlcp /openils/conf/oils_web.xml.example /openils/conf/oils_web.xmlUpdate opensrf_core.xml and opensrf.xml by copying the new example files
(/openils/conf/opensrf_core.xml.example and /openils/conf/opensrf.xml).configuration filesopensrf.xmlcp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xmlconfiguration filesopensrf_core.xmlcp /openils/conf/opensrf.xml.example /openils/conf/opensrf.xmlCopying these configuration files will remove any customizations you have made to them. Remember to redo your customizations after copying
them.Update opensrf.xml with the database connection info:
perl Open-ILS/src/support-scripts/eg_db_config.pl --update-config \
--service all --create-offline --user evergreen --password evergreen \
--hostname localhost --port 5432 --database evergreen
Update /etc/apache2/startup.pl by copying the example from
Open-ILS/examples/apache/startup.pl.configuration filesstartup.plUpdate /etc/apache2/eg_vhost.conf by copying the example from
Open-ILS/examples/apache/eg_vhost.conf.configuration fileseg_vhost.confUpdate /etc/apache2/sites-available/eg.conf by copying the example from Open-ILS/
examples/apache/eg.conf.configuration fileseg.confCopying 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.SSLcertificatesRestart Evergreen and TestAs the opensrf user, start all
Evergreen and OpenSRF
services:osrf_ctl.sh -l -a start_allAs the opensrf user, run autogen to refresh the static
organizational data files:autogen
cd /openils/bin
./autogen.sh -c /openils/conf/opensrf_core.xml -u
Start srfsh and try logging in using your Evergreen
username and password:/openils/bin/srfshsrfsh%login 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.Upgrading PostgreSQL from 8.4 to 9.0Upgrading PostgreSQL on Debian SqueezStop Evergreen and disconnect clients from database.Add the following line to /etc/apt/sources.list:
deb http://www.backports.org/debian squeeze-backports main contrib non-free
Update the sources list on your server.
apt-get update
Backup your databases
$ pg_dump [db connect args] [db name] > evergreen-backup.sql
Install PostgreSQL 9.0 as well as the client, contrib and plperl support packages.
apt-get -t squeeze-backports install postgresql-9.0 postgresql-client-9.0 postgresql-contrib-9.0 postgresql-plperl-9.0
Drop the empty 9.0 cluster.
pg_dropcluster --stop 9.0 main
Update the 8.4 cluster (with evergreen database) to 9.0
pg_upgradecluster 8.4 main
Test by logging into psql, checking the postgrSQL version and running a simple SELECT query.
psql -U evergreen
evergreen=# select version();
evergreen=# select count(*) from biblio.record_entry;
Restart Evergreen and Apache.Drop old 8.4 cluster (optional).
pg_dropcluster 8.4 main
Upgrading PostgreSQL on Ubuntu 10.04Stop Evergreen and disconnect clients from database.Add the backport repository to your repository sources list:
sudo add-apt-repository ppa:pitti/postgresql
Update the sources list on your server.
apt-get update
As the postgres user, backup your PostgreSQL databases. data
]]>As root, remove PostgreSQL 8.4 and install 9.0.
aptitude purge postgresql-8.4
aptitude install postgresql-9.0 postgresql-client-9.0 postgresql-contrib-9.0 postgresql-plperl-9.0
as the postgres user, recreate empty evergreen databases with required language supports.
dropdb evergreen
createdb -T template0 --lc-ctype=C --lc-collate=C -E UNICODE evergreen
createlang plperl evergreen
createlang plperlu evergreen
createlang plpgsql evergreen
psql -f /usr/share/postgresql/9.0/contrib/tablefunc.sql evergreen
psql -f /usr/share/postgresql/9.0/contrib/tsearch2.sql evergreen
psql -f /usr/share/postgresql/9.0/contrib/pgxml.sql evergreen
Update the 8.4 cluster (with evergreen database) to 9.0.
pg_upgradecluster 8.4 main
as the postgres user, load data from backup into PostgreSQL 9.0.Restart Evergreen and Apache.Test by logging into psql, checking the postgrSQL version and running a simple SELECT query.
psql -U evergreen
evergreen=# select version();
evergreen=# select count(*) from biblio.record_entry;