2.10.3 Upgrading
Important: these are instructions for upgrading from Daisy
1.5-M1. To upgrade from older releases, e.g. Daisy 1.4, please follow the
aggregated instructions for upgrading from 1.4 to 1.5-final, which can be found
2.10.3.1 Download and extract installation files
- Rename your existing <DAISY_HOME> directory. During these instructions, we will refer to this location as <OLD_DAISY_HOME>.
- Download the Daisy 1.5 installation files from here.
- Extract the installation archive. Make sure that your <DAISY_HOME> variable points to that newly created directory, if necessary, move or rename that directory (or adapt your <DAISY_HOME> environment variable).
2.10.3.2 Switching from OpenJMS to ActiveMQ
2.10.3.2.1 Make sure no messages are left in OpenJMS
Before moving to ActiveMQ, it is a good idea to check if there are no messages waiting to be processed in OpenJMS's queues. Usually JMS messages in Daisy are processed quickly, so unless you have had high activity right before shutting down the Daisy repository, there will normally be no more messages waiting to be processed.
To be sure, you can do a quick check like this:
- start OpenJMS
- go to OPENJMS_HOME/bin, and execute the "admin" script. This will launch a GUI window. In its menu, choose Actions, Connections, Online. It will ask for a username and password. The username is normally "admin", the password can be found in the file OPENJMS_HOME/config/openjms.xml (look for <User name="admin" password="something"/>). Once connected, you see the topics with their durable subscribers, and the queues. Next to them a number is displayed, they should all be zero.
If there would still be messages, just start the repostory server again, and wait till they have all been processed.
2.10.3.2.2 Creating a database for ActiveMQ
Start the MySQL client:
mysql -uroot
and execute:
CREATE DATABASE activemq; GRANT ALL ON activemq.* TO activemq@'%' IDENTIFIED BY 'activemq'; GRANT ALL ON activemq.* TO activemq@localhost IDENTIFIED BY 'activemq';
ActiveMQ will automatically create its database tables the first time the repository server is launched.
2.10.3.2.3 ActiveMQ configuration
Create the ActiveMQ configuration :
cp <DAISY_HOME>/repository-server/conf/activemq-conf.xml.template <DAISY_DATA>/conf/activemq-conf.xml cp <DAISY_HOME>/repository-server/conf/login.config <DAISY_DATA>/conf/ cp <DAISY_HOME>/repository-server/conf/users.properties <DAISY_DATA>/conf/ cp <DAISY_HOME>/repository-server/conf/groups.properties <DAISY_DATA>/conf/
Update myconfig.xml (<DAISY_DATA>/conf/myconfig.xml):
Look for the following element:
<target path="/daisy/jmsclient/jmsclient">
and replace the <configuration> element inside it with:
<configuration>
<jmsConnection>
<clientId>daisy-repository</clientId>
<credentials username="admin" password="jmsadmin"/>
<initialContext>
<property name="java.naming.provider.url" value="vm://DaisyJMS?brokerConfig=xbean:file:${daisy.datadir}/conf/activemq-conf.xml"/>
<property name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
<property name="queue.fullTextIndexerJobs" value="fullTextIndexerJobs"/>
<property name="topic.daisy" value="daisy"/>
</initialContext>
<connectionFactoryName>ConnectionFactory</connectionFactoryName>
</jmsConnection>
</configuration>
If you are using MySQL 5 (thus not 4.1), then you need to edit <DAISY_DATA>/conf/activemq-conf.xml. Look for the following line (here split on two lines for readability):
<property name="url" value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true&
useServerPrepStmts=false&sessionVariables=storage_engine=InnoDB"/>
In this, you should remove the "useServerPrepStmts=false&", so that it becomes:
<property name="url" value="jdbc:mysql://localhost/activemq
?relaxAutoCommit=true&sessionVariables=storage_engine=InnoDB"/>
2.10.3.3 Configuring the Driver Registrar component
This new component registers JDBC drivers that are used by datasources in the repository-server.
Background info: previously, the JDBC drivers were configured as part of the datasource, but since JDBC connections are now needed by multiple datasources in the same VM (both the repository server and ActiveMQ), their registration is now moved into a specific component.
Edit <DAISY_DATA>/conf/myconfig.xml, and add a new target :
<target path="/daisy/driverregistrar/driverregistrar">
<configuration>
<drivers>
<driver>
<classpath>${daisy.home}/lib/mysql/jars/mysql-connector-java-3.1.12-bin.jar</classpath>
<classname>com.mysql.jdbc.Driver</classname>
</driver>
</drivers>
</configuration>
</target>
Notice the upgrade from mysql-connector 3.1.7 to mysql-connector 3.1.12
You may now also remove the references to JDBC drives from the datasource component. In the same file look for "/daisy/datasource/datasource". In the configuration of this component look for the "driverClasspath" and "driverClassName" elements. You may simply remove both these elements like this :
<target path="/daisy/datasource/datasource">
<configuration>
<username>daisy</username>
<password>daisy</password>
<url>jdbc:mysql://localhost/daisyrepository?useServerPrepStmts=false</url>
<driverClasspath>REMOVE THIS LINE</driverClasspath>
<driverClassName>REMOVE THIS LINE</driverClassName>
<maxActive>20</maxActive>
<maxIdle>8</maxIdle>
<minIdle>0</minIdle>
<maxWait>5000</maxWait>
</configuration>
</target>
2.10.3.4 Updating wrapper configuration for the Repository Server
If you are using the service wrapper (or custom startup scripts) to start the
repository server, then you will need to upgrade the configuration/scripts to
pass some additional parameters. In dsy_repo_wrapper.conf, these have to be
added (see also the
wrapper.java.additional.5=-Dorg.apache.commons.logging.Log=org.outerj.daisy.logging.DaisyLog wrapper.java.additional.6=-Djava.security.auth.login.config=%DAISY_DATADIR%/conf/login.config wrapper.java.additional.7=-Ddaisy.datadir=%DAISY_DATADIR% wrapper.java.additional.8=-Ddaisy.home=%DAISY_HOME%
2.10.3.5 Optional: remove absolute paths in myconfig.xml
Daisy now allows to use properties in the myconfig.xml to avoid absolute paths. If you want, you can update your myconfig.xml and change absolute references to the daisy data directory and daisy home directory by ${daisy.datadir} and ${daisy.home} respectively. Doing this will allow to move your data directory around without changing the myconfig.xml.
Previous