OrderlyStats SE Upgrade Procedure
***************************************************************************************
NOTE: Version 13.6a contains a minor change to the package structure. If you are using
a webapps/orderlystatsse/WEB-INF/OrderlyStatsSE.xml file from an older version, you 
will need to change '.phone.deployment.' to '.phonedeployment.' on line 66 to use it.

***************************************************************************************
NOTE: Version 11.7a contains upgrades to the live feed mechanism for Control Panel and
Agent Toolbar.  The old Flash mechanism is maintained for legacy browsers, however the
new WebSocket mechanism is selected by default.  If you are upgrading from pre-11.7a,
you will need to ensure that the relevent servlet and servlet-mapping tags for 
ActiveWebSocket are included in your WEB-INF/web.xml file (see below).  Your tomcat
must be at least version 7.0.27 in order for WebSockets to work.

***************************************************************************************
NOTE: Version 11.2a contains upgrades to the Tomcat, Java and Hypersonic SQL components

If you upgrading from an earlier version of OrderlyStats SE to 11.2a or later, you will
need to follow the instructions in the MAJORUPGRADE file in this folder INSTEAD, also
available at http://us3.orderlyq.com/build/orderlystatsse/MAJORUPGRADE.

The instructions in this file WILL NOT WORK if you are upgrading from pre-11.2a to
post-11.2a.

***************************************************************************************

This document describes the softare upgrade procedure.  The All-In-One download always
contains the latest version available, so if you have recently downloaded the system, 
you won't need to upgrade.  These upgrade instructions do change from time to time, 
so please check for the most recent version at 

http://us3.orderlyq.com/build/orderlystatsse/UPGRADE

BEFORE attempting your upgrade.

So, to upgrade, first download the latest Core Only dirstribution from 

http://www.orderlyq.com/orderlystatsse/download.html

To perform the upgrade, execute the following command sequence as root.  The following
assumes you have your OrderlyStats SE installed in /usr/share/orderly, and the new core
pack in your home directory (~) - you will need to edit the instructions if this is
not the case.

#1. Stop the OrderlyStats server: 
/etc/init.d/orderlystatsse stop

#2. Create a backup folder:
mkdir /usr/share/orderly/backup

#3. Move your current installation to the backup folder (or anywhere EXCEPT webapps.  
I repeat - if you back up to the webapps folder, you will BREAK YOUR INSTALLATION)

mv /usr/share/orderly/tomcat/webapps/orderlystatsse /usr/share/orderly/backup

#3a. IF YOU ARE STILL USING THE DEFAULT HypersonicSQL DATABASE, you should also 
BACK THIS UP NOW.

cp -r /usr/share/orderly/hsqldb /usr/share/orderly/backup

Some users have reported problems with HypersonicSQL after a number of years' use, so
we now recommend migrating to MySQL or PostgreSQL for ALL PRODUCTION SYSTEMS.  
Instructions are in the CHANGEDB file in this directory.

#4. Go to your webapps folder and DELETE the old installation (NOTE: If you just 
overwrite the old folder, you will BREAK YOUR INSTALLATION):

cd /usr/share/orderly/tomcat/webapps
rm -rf orderlystatsse

#5. Install the new core (Note: replace XXX with the version number of the new version, 
for instance 10.0a):

tar -xvzf ~/orderlystatsseXXX.tar.gz

#6. Restore your configuration files from the backup:
cp /usr/share/orderly/backup/orderlystatsse/WEB-INF/*.xml /usr/share/orderly/tomcat/webapps/orderlystatsse/WEB-INF/

NOTE: If you are upgrading from pre-11.7a, you must also ensure your web.xml file in this
folder contains the necessary ActiveWebSocket tags (included in the default WEB-INF/web.xml
file in the distribution), otherwise the live feeds will stop working.

#7. Clear out any old tomcat-compiled JSP files:
rm -rf /usr/share/orderly/tomcat/work/*

#8. Start OrderlyStats server:
/etc/init.d/orderlystatsse start

Don't forget to let us know if you run into any trouble - we're here to help.
support@orderlyq.com

