====== Upgrading from Evergreen 1.6.1.x to 2.0.9 ====== ===== Preface ===== BACK EVERYTHING UP! Seriously. FIXME This is incomplete! YMMV! A far superior version is available as draft documentation here: [[http://docs.evergreen-ils.org/2.0/draft/html/upgradingevergreen-upgrading_from_1.6_to_2.0.html]] ===== Upgrading your codey bits ===== * If you are currently on a version before 1.6.1, make sure you follow the [[upgrading:evergreen|upgrade instructions]] for all previous releases up to 1.6.1. **NOTE:** There are no upgrade scripts for 1.6.2 IT IS AN ABANDONED BRANCH - Stop Apache. - Stop all Evergreen and OpenSRF services. As the **opensrf** user: osrf_ctl.sh -l -a stop_all - [[zzz_archive:opensrf:2.0:install|Install OpenSRF 2.0.x]]. - **NOTE:** You may skip this step if the latest version of OpenSRF 2.0.x was previously installed. - Download and build Evergreen: - As the **opensrf** user, download and extract the latest version of Evergreen (http://open-ils.org/downloads/Evergreen-ILS-2.0.9.tar.gz): wget http://evergreen-ils.org/downloads/Evergreen-ILS-2.0.9.tar.gz tar xzf Evergreen-ILS-2.0.9.tar.gz - As the **root** user, install the prerequisites. Replace below with one of these values for your actual distribution: * ''debian-sqeeze'' for Debian Squeeze * ''ubuntu-lucid'' for Ubuntu Lucid Lynx (10.04) cd /home/opensrf/Evergreen-ILS-2.0.9 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/conf make - As the **root** user, install Evergreen: make STAFF_CLIENT_BUILD_ID=rel_2_0_9 install - As the **root** user, change all files to be owned by the opensrf user/group: sudo chown -R opensrf:opensrf /openils - As 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 server ===== Upgrading your configuration files ====== - As the **opensrf** user, update configuration files: cd /home/opensrf/Evergreen-ILS-2.0.9 # 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 * FIXME what about changes to opensrf.xml? - If you have made local changes to the following files, you may want to use a diff program such as vimdiff to compare the files. If you are not comfortable with this and you haven't changed these files much, backup your original files someplace safe and then copy the new files across. - Copy/diff Open-ILS/examples/apache/eg.conf to /etc/apache2/sites-enabled/eg.conf - Copy/diff Open-ILS/examples/apache/eg_vhost.conf to /etc/apache2/eg_vhost.conf - Copy/diff Open-ILS/examples/apache/startup.pl to /etc/apache2/startup.pl ===== Upgrading your database from 1.6.1 ===== * **NOTE: it is recommended that you [[http://www.open-ils.org/dokuwiki/doku.php?id=evergreen-admin:maintenance:backups&s[]=database&s[]=backup|back up your Evergreen database]] in order to restore your data if anything goes wrong** * **NOTE: For Evergreen 2.0, you must be using PostgreSQL 8.4. Instructions are yet to come** - Run the main upgrade script:cd /home/opensrf/Evergreen-ILS-2.0.9 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 - Generate a reingest SQL script using the reingest script generation script:cd /home/opensrf/Evergreen-ILS-2.0.9 perl Open-ILS/src/sql/Pg/reingest-1.6-2.0.pl --config /openils/conf/opensrf_core.xml --chunk_size 10000 psql -U evergreen -h localhost -f reingest-1.6-2.0.sql evergreen * **Note**: Evergreen needs to be running. * Note: SQL file will be created in the current directory. * This takes a long time, you may run this in the background and go about your business. 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. - Generate the normalized title fields (tag="tnf" in ''metabib.real_full_rec'') required for sorting by title, etc:BEGIN; DELETE FROM metabib.real_full_rec WHERE tag = 'tnf'; INSERT INTO metabib.real_full_rec (record, tag, subfield, value) SELECT record, 'tnf', 'a', SUBSTRING(value, COALESCE(NULLIF(REGEXP_REPLACE(ind2,'[^0-9]','','g'),''),'0')::int + 1) FROM metabib.real_full_rec WHERE tag = '245' AND subfield = 'a'; COMMIT; ===== Finishing up ===== - Start all Evergreen and OpenSRF services. As the **opensrf** user: osrf_ctl.sh -l -a start_all - Start Apache. - 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 - Troubleshooting: If you run into errors, see: [[http://www.open-ils.org/dokuwiki/doku.php?id=troubleshooting:checking_for_errors&s[]=troubleshooting|Troubleshooting: Checking for Errors]] for help finding errors in the log files. You may also ask the evergreen community using the [[http://www.open-ils.org/listserv.php|mailing lists]]. Including error information from the logs will be extremely helpful when seeking assistance.