======Upgrading OpenSRF====== **Warning: These instructions are still being drafted and reviewed by the community for errors.** In the following instructions, you are asked to perform certain steps as either the **root** user or the **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 - '' command; for example, ''su - opensrf''. Once you have become a non-root user, to become the **root** user again simply issue the ''exit'' command. Also, in the following instructions, **/path/to/OpenSRF/** represents the path to the OpenSRF source directory. ===== Short Version ===== Currently upgrading from 1.6 to 2.0 is basically stopping OpenSRF processes, taking care of the makefile prereqs, then configure, make, make install the code and finally start the processes back up.osrf_ctl.sh -l -a --stop_all / configure / makefile prereqs / make / make install / osrf_ctl.sh -l -a --start_all * Warning: If you are running Evergreen you might need to possibly re-compile, we are unsure if a pre-compiled binary set for Evergreen will continue to work after upgrading OpenSRF. ===== Longer Version ===== - Stop OpenSRF, as the **opensrf** user: osrf_ctl.sh -l -a stop_all - As the **opensrf** user, download and extract the source files for the latest OpenSRF version: wget http://evergreen-ils.org/downloads/opensrf-X.X.X.tar.gz tar xzf opensrf-X.X.X.tar.gz A new directory ''opensrf-X.X.X'' is created. - As the **root** user, install the software prerequisites using the automatic prerequisite installer. * **Important:** Experienced system administers might want to diff the new Makefile.install with the one in your current version of OpenSRF to see if this step is required & the consequences. * Replace //// below with the following value for your distribution: * ''debian-lenny'' for Debian Lenny (5.0) * ''debian-squeeze'' for Debian Squeeze (6.0) * ''fedora13'' for Fedora 13 * ''ubuntu-hardy'' for Ubuntu Hardy Heron (8.04) * ''ubuntu-lucid'' for Ubuntu Lucid Lynx (10.04) * ''centos'' for CentOS 5 * ''rhel'' for Red Hat Enterprise Linux 5 cd /path/to/OpenSRF make -f src/extras/Makefile.install This will install a number of packages required by OpenSRF on your system, including some Perl modules from CPAN. We suggest that you let CPAN auto-configure itself. Also, always allow the CPAN installer to install prerequisite modules when it asks. - Build OpenSRF: - As the **opensrf** user, configure and compile OpenSRF. You can include the ''--enable-python'' configure options if you want to include support for Python: cd /path/to/OpenSRF ./configure --prefix=/openils --sysconfdir=/openils/conf make - As the **root** user, return to your OpenSRF build directory and install OpenSRF: cd /path/to/OpenSRF make install - As the **root** user, change the ownership of the installed files to the opensrf user: chown -R opensrf:opensrf /openils - Jot 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.backup cp -p /openils/conf/opensrf_core.xml /openils/conf/opensrf_core.xml.backup - As 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.xml cp /openils/conf/opensrf_core.xml.example /openils/conf/opensrf_core.xml - Edit ''/openils/conf/opensrf_core.xml'' to change the Jabber usernames and passwords you jotted down earlier. - As the **root** user, Run the following command: ldconfig ===Starting OpenSRF=== Before starting OpenSRF, ensure that your Jabber and memcached daemons are running. As the **root** user: /etc/init.d/ejabberd start /etc/init.d/memcached start Starting OpenSRF with the ''start_all'' option starts the OpenSRF router, Perl services, and C services. As the **opensrf** user, start OpenSRF (**NOTE**: use the ''-l'' flag only if you wish to force the hostname for the '''' section in ''opensrf.xml'' to be ''localhost''): osrf_ctl.sh -l -a start_all * If you receive the error message **bash: osrf_ctl.sh: command not found**, then your environment variable **PATH** does not include the ''/openils/bin'' directory; this should have been set by ''.bashrc'' when you logged in as the ''opensrf'' user, but you can manually set it using the following command:export PATH=$PATH:/openils/bin =====Testing connections to OpenSRF ===== Once you started OpenSRF, test your connection to OpenSRF via ''srfsh'': - Start ''srfsh'' and try calling the ''add'' method on the OpenSRF math service: /openils/bin/srfsh srfsh# request opensrf.math add 2 2 You should see a result like: Received Data: 4 ------------------------------------ Request Completed Successfully Request Time in seconds: 0.007519 ------------------------------------ srfsh# If this does not work, it's time to do some troubleshooting. Please do not make any significant changes to your configuration. Gather your configuration files and log files in ''/openils/var/log'' and contact the [[http://open-ils.org/listserv.php|Evergreen development mailing list]] for assistance before making any drastic changes to your system configuration. =====Roll back configuration===== Since we have confirmed that OpenSRF work correctly. We now will go back to the Evergreen configuration files we previously backed up unless you are using OpenSRF for another project. - As the **opensrf** user, stop OpenSRF: osrf_ctl.sh -l -a stop_all - As the **opensrf** user backup the OpenSRF config files cp -p /openils/conf/opensrf.xml /openils/conf/opensrf.xml.opensrf.backup cp -p /openils/conf/opensrf_core.xml /openils/conf/opensrf_core.xml.opensrf.backup - As 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.backup /openils/conf/opensrf.xml cp /openils/conf/opensrf_core.xml.backup /openils/conf/opensrf_core.xml - As the **opensrf** start OpenSRF osrf_ctl.sh -l -a start_all