Daisy documentation Previous Home Next 2.13 2.3 to 2.4 upgrade Book Index 3 Source Code

#### 2.13.2.1 Daisy installation review

In case you're not very familiar with Daisy, it is helpful to identify the main parts involved. The following picture illustrates these.

There is the application directory, which is simply the extracted Daisy download, and doesn't contain any data (to be safe don't remove it yet though).

Next to this, there are 3 locations where data (and configuration) is stored: the relational database (MySQL), the repository data directory, and the wiki data directory. The Daisy repository and the Daisy Wiki are two independent applications, therefore each has its own data directory.

The text between the angle brackets (< and >) is the way we will refer to these directories further on in this document. Note that <DAISY_HOME> is the new extracted download (see later on), not the old one.

#### 2.13.2.2 Make a backup

No, really. Make a backup.

#### 2.13.2.3 Stop your existing Daisy

Stop your existing Daisy, both the repository server and the Daisy Wiki.

#### 2.13.2.4 Download and extract Daisy 2.4

If not done already, download Daisy 2.4 from the distribution area (Sourceforge). For Windows, download the zip or autoextract.exe (not the installer!). For Unix-based systems, the .tar.gz is recommended. The difference is that the .zip contains text files with DOS line endings, while the .tar.gz contains text files with unix line endings. When using non-Linux unixes such as Solaris, be sure to use GNU tar to extract the archive.

Extract the download at a location of your choice. Extract it next to your existing Daisy installation, do not copy it over your existing installation.

#### 2.13.2.5 Update environment variables

Make sure the DAISY_HOME environment variable points to the just-extracted Daisy 2.4 directory.

Note that when you start/stop Daisy using the wrapper scripts, you don't need to set DAISY_HOME, though you do need to update or re-generate the service wrapper configuration (see next section).

How this is done depends a bit on your system and personal preferences:

• it might be that you set the DAISY_HOME variable each time at the command prompt, in which case you simply continue to do this but let it now point to the new location:
[Windows]
set DAISY_HOME=c:\path\to\daisy-2.4
• [Linux]
export DAISY_HOME=/path/to/daisy-2.4
• in Windows, it might be set globally via the System properties
• it could also be that you renamed the Daisy 2.3 directory to something that doesn't contain the version number (such as simply "daisy"), in which case you can leave the DAISY_HOME setting alone and just rename the daisy directories.

#### 2.13.2.6 Updating the repository SQL database

Execute the database upgrade script:

cd <DAISY_HOME>/misc
mysql -Ddaisyrepository -udaisy -ppassword < daisy-2_3-to-2_4_M1.sql
mysql -Ddaisyrepository -udaisy -ppassword < daisy-2_4_M1-to-2_4.sql

On many MySQL installations you can use "root" as user (thus specify -uroot instead of -udaisy) without password, thus without the -p option.

#### 2.13.2.7 Various

Optionally, copy missing file(s) from the directory $DAISY_HOME/daisywiki/wikidata-template/conf to your wikidata/conf directory. (You can just copy the entire conf directory taking care not to overwrite files that you do not want to change) In the repository data dir, open conf/myconfig.xml and remove all <repositoryUser/> elements, but remember the password for the 'internal' user. Next, add this configuration snippet to conf/myconfig.xml, but change the password to the one your remembered.  <target path="/daisy/repository/credentials-provider"> <configuration> <credentials key="internal" login="internal" password="defaultpwd"/> </configuration> </target> In the same file, look for the word 'driverregistrar', and update its configuration element (the path to the MySQL jar file needs to be changed) <target path="/daisy/driverregistrar/driverregistrar"> <configuration> <drivers> <driver> <classname>com.mysql.jdbc.Driver</classname> <classpath>${daisy.home}/lib/mysql/mysql-connector-java/3.1.12/mysql-connector-java-3.1.12.jar</classpath>
</driver>
</drivers>
</configuration>
</target>

In conf/activemq-conf.xml, look up the element named "jdbcPersistence" and add the attribute useDatabaseLock="false", so it looks like this.

      <jdbcPersistenceAdapter dataSource="#dataSource" statements="#statements" useDatabaseLock="false"/>

#### 2.13.2.8 Remove full text index files

Due to the new point in time feature, the fulltext index will need to be rebuild. Therefore, we'll now do the first step: drop the current index. You can do this by removing all files in the following directory (but not the directory itself!):

<daisy data dir>/indexstore

This can be done like this:

[Windows]
cd <daisydata dir>\indexstore
del *.*

[Unix]
cd <daisydata dir>/indexstore
rm -f *

#### 2.13.2.9 Generate the document summaries

This section assumes your Daisy repository and MySQL database are running on 'localhost' at the default ports.  Change to suit your environment.

Before Daisy 2.4 only the 'live' version summaries were stored. As of Daisy 2.4 the summary for each version is stored. That is why you must generate summaries when upgrading to 2.4.

Start Daisy as usual, using the normal scripts or the wrapper scripts.

##### 2.13.2.9.1 Take a backup lock

To take a backup lock, invoke 'lock(3000)' on the BackupLocker JMX bean

• http://localhost:9264/mbean?objectname=Daisy:name%3DBackupLocker
• method: lock
• parameters:
• 3000

Regenerate summaries

Next execute the following commands to regenerate document summaries:

# on unix
cd \$DAISY_HOME/misc
./regenerate-summaries.sh http://localhost:9263 testuser testuser jdbc:mysql://localhost:3306/daisyrepository root ""

# on windows
cd %DAISY_HOME%\misc
regenerate-summaries.bat http://localhost:9263 testuser testuser jdbc:mysql://localhost:3306/daisyrepository root ""
##### 2.13.2.9.2 Unlock the repository

To do this, invoke the unlock method on the BackupLocker bean.

• http://localhost:9264/mbean?objectname=Daisy:name%3DBackupLocker
• method: unlock
##### 2.13.2.9.3 Clear the document cache

This step makes sure that the summaries in the current cache are correct. You can clear the cache via the jmx console (or simply by restarting the repository)

• localhost:9264/mbean?objectname=Daisy:name%3DDocumentCache
• method: clearCache

#### 2.13.2.10 Rebuild the extracted links data

You can do this via the RepositoryMaintainerImpl bean in the jmx console.

• http://localhost:9264/mbean?objectname=Daisy:name%3DRepositoryMaintainerImpl