Tuesday, August 03, 2010

DSpace 1.6.2 Upgrade Procedure

Upgrade to DSpace 1.6.2

This blog covers the upgrade procedure from DSpace 1.5.2 to DSpace 1.6.2 under CentOS 5.3 Linux

Login as user dspace and download and untar the source distribution:

lynx http://sourceforge.net/projects/dspace/files/DSpace%20Stable/1.6.2/dspace-1.6.2-src-release.tar.gz/download
tar -xzvf dspace-1.6.2-src-release.tar.gz


Stop Tomcat and the handle server:

su - root
service tomcat stop
service handle stop


In DSpace 1.6.2 the new solr statistics feature is provided. This works in addition to the existing statistics and provides content specific statistics on Communities, Collections and Items. It is worth maintaining both old and new statistics reporting at this stage as the old system provides an repository wide overview, whilst the new system is much more specific.

The solr Webserver is already provided with DSpace 1.6.2. However with our implementation of tomcat running behind Apache using mod_jk two additional steps needed to be taken to enable access to solr.

Statistics Step 1 (as root)

cd /etc/httpd/conf.d
nano jk.conf

Append the following text:

#
JkMount /solr worker2
#
JkMount /solr/* worker2

Save jk.conf
exit

Statistics Step 2 (as dspace)

cd /home/dspace/apache-tomcat-6.0.18/conf
nano server.xml

Add the following text:

[!-- DEFINE A CONTEXT PATH FOR DSpace Solr Statistics Interface --]
[Context path="/solr" docBase="/home/dspace/webapps/solr" debug="0"
reloadable="true" cachingAllowed="false"
allowLinking="true"/]

Note that the HTML braces above have been replaced by [] for display purposes just within this blog.


As of 8th August 2010 there is a patch missing from the DSpace 1.6.2 source code. This results in the issue date being wrongly displayed. The process for correcting this is explained below:

cd
nano DCDate.patch

Cut and paste the patch file text below (derived from http://jira.dspace.org/jira/browse/DS-469) into the text file DCDate.patch:

Index: dspace-api/src/main/java/org/dspace/content/DCDate.java
===================================================================
--- dspace-api/src/main/java/org/dspace/content/DCDate.java (revision 4697)
+++ dspace-api/src/main/java/org/dspace/content/DCDate.java (working copy)
@@ -639,9 +639,9 @@
dd.getHourGMT(), dd.getMinuteGMT(), dd.getSecondGMT());
}
}
- else if (granularity == DateGran.DAY)
+ else if (granularity == DateGran.YEAR)
{
- return String.format("%d-%s-%4d", dd.getDay(), monthName, dd.getYear());
+ return String.format("%4d", dd.getYear());
}
else if (granularity == DateGran.MONTH)
{
@@ -649,7 +649,7 @@
}
else
{
- return String.format("%4d", dd.getYear());
+ return String.format("%d-%s-%4d", dd.getDay(), monthName, dd.getYear());
}
}
}


Save the file DCDate.patch
Use the following command to apply the above patch:

patch /home/dspace/dspace-1.6.2-src-release/dspace-api/src/main/java/org/dspace/content/DCDate.java DCDate.patch


With reference to the source code files in the DSpace 1.5.2 build, apply the Bromley College customisations to the following default files:

Replace the getSpecialGroups code with the customised version (this is specifically for our installation)

nano /home/dspace/dspace-1.6.2-src-release/dspace-api/src/main/java/org/dspace/authenticate/LDAPHierarchicalAuthentication.java

Customise the stylesheets:

nano /home/dspace/dspace-1.6.2-src-release/dspace-jspui/dspace-jspui-webapp/src/main/webapp/styles.css.jsp

nano /home/dspace/dspace-1.6.2-src-release/dspace-jspui/dspace-jspui-webapp/src/main/webapp/layout/header-default.jsp

nano /home/dspace/dspace-1.6.2-src-release/dspace-jspui/dspace-jspui-webapp/src/main/webapp/layout/footer-default.jsp

nano /home/dspace/dspace-1.6.2-src-release/dspace-jspui/dspace-jspui-webapp/src/main/webapp/home.jsp

Also copy over the College logo from the 1.5.2 build:

cp /home/dspace/dspace-1.5.2-src-release/dspace-jspui/dspace-jspui-webapp/src/main/webapp/image/logo.gif /home/dspace/dspace-1.6.2-src-release/dspace-jspui/dspace-jspui-webapp/src/main/webapp/image/logo.gif


With reference to dspace.cfg for the 1.5.2 build, apply the Bromley College customisations to the default dspace.cfg. Also check out the new solr statistics section in dspace.cfg and append the following lines to the solr statistics section of dspace.cfg:

# Added by Clive Gould on 8th August 2010
statistics.items.dc.1=dc.identifier
statistics.items.dc.2=dc.date.accessioned
statistics.items.type.1=dcinput
statistics.items.type.2=date
statistics.default.start.datepick = 01/01/1977

nano /home/dspace/dspace-1.6.2-src-release/dspace/config/dspace.cfg
cp /home/dspace/dspace-1.6.2-src-release/dspace/config/dspace.cfg /home/dspace/config/dspace.cfg


Build DSpace (note this takes about 5 minutes):

cd
cd dspace-1.6.2-src-release/dspace
mvn -U clean package


Update DSpace:

cd /home/dspace/dspace-1.6.2-src-release/dspace/target/dspace-1.6.2-build.dir
ant -Dconfig=/home/dspace/config/dspace.cfg update


Apply the bitstream fix:

/home/dspace/bin/dspace registry-loader -bitstream /home/dspace/etc/upgrades/15-16/new-bitstream-formats.xml


Apply the database update script:

psql -U dspace -f /home/dspace/dspace-1.6.2-src-release/dspace/etc/postgres/database_schema_15-16.sql dspace


The webapps folder is already pathed from tomcat's server.xml so it is not necessary to copy the files over.


Generate the browse and search indexes:

/home/dspace/bin/dspace index-init


Start Tomcat:

su - root
service tomcat start
service handle start
service httpd restart
exit

On testing it appears that DSpace 1.6.2 works fine with both oai and handle requests

The old statistics files can be imported into DSpace and there is an excellent tutorial on this subject on the following site: http://ir.sun.ac.za/wiki/index.php/Asset_Statistics