These instructions are valid for any of the following upgrade paths:
For more information about new features or major changes in previous releases of DSpace, please refer to following:
|
In order to minimize downtime, it is always recommended to first perform a DSpace upgrade using a Development or Test server. You should note any problems you may have encountered (and also how to resolve them) before attempting to upgrade your Production server. It also gives you a chance to "practice" at the upgrade. Practice makes perfect, and minimizes problems and downtime. Additionally, if you are using a version control system, such as subversion or git, to manage your locally developed features or modifications, then you can do all of your upgrades in your local version control system on your Development server and commit the changes. That way your Production server can just checkout your well tested and upgraded code. |
In the notes below |
The DSpace Lightweight Networking Interface, supporting WebDAV / SOAP / RPC API, has been removed from DSpace 6.0 or above. We recommend using REST or SWORD (v1 or v2) as a replacement. However, if you still require it, the old (unmaintained) codebase is still available at https://github.com/DSpace/dspace-lni |
Before you start your upgrade, it is strongly recommended that you create a backup of your DSpace instance. Backups are easy to recover from; a botched install/upgrade is very difficult if not impossible to recover from. The DSpace specific things to backup are: configs, source code modifications, database, and assetstore. On your server that runs DSpace, you might additionally consider checking on your cron/scheduled tasks, servlet container, and database.
Make a complete backup of your system, including:
Database: Make a snapshot/dump of the database. For the PostgreSQL database use Postgres' pg_dump command. For example:
pg_dump -U [database-user] -f [backup-file-location] [database-name] |
[dspace]/assetstore
by default, and any other assetstores configured in the [dspace]/config/dspace.cfg
"assetstore.dir" and "assetstore.dir.#" settings)[dspace]/config
.[dspace]/elasticsearch
, SOLR Statistics stores data in [dspace]/solr/statistics
. A simple copy of the data directory should give you a point of recovery, should something go wrong in the update process. We can't stress this enough, your users depend on these statistics more than you realize. You need a backup.DSpace 6.x requires the following versions of prerequisite software:
Refer to the Prerequisite Software section of "Installing DSpace" for more details around configuring and installing these prerequisites.
[dspace-source]/dspace/modules/jspui/src/main/webapp/
[dspace-source]/dspace/modules/xmlui/src/main/webapp/
[dspace]/config
Edit the build.properties file (if needed) ([dspace-source]/build.properties
). Any settings changed in this build.properties
file are automatically copied over to the final dspace.cfg
file during the "Build DSpace" process (in the next step). For more information on the build.properties file, see "The build.properties Configuration Properties File" section of the Configuration Reference documentation.
Build DSpace. Run the following commands to compile DSpace :
cd [dspace-source]/dspace/ mvn -U clean package |
The above command will re-compile the DSpace source code and build its "installer". You will find the result in [dspace-source]/dspace/target/dspace-installer
Without any extra arguments, the DSpace installation package is initialized for PostgreSQL. If you use Oracle instead, you should build the DSpace installation package as follows: |
Mirage 2 is a responsive theme for the XML User Interface, added as a new feature in DSpace 5. It has not yet replaced the Mirage 1 theme as the XMLUI default theme. To enable Mirage 2, add the following to the <theme name="Mirage 2" regex=".*" path="Mirage2/" /> It is important to do this before executing the maven build. Mirage 2 is not yet activated in the default "mvn package" build. To include it as part of the build, run: mvn -U clean package -Dmirage2.on=true The speed of this specific step of the build can be increased by installing local copies of the specific dependencies required for building Mirage 2. The Mirage 2 developer documentation provides detailed instructions for these installations. After the installation of these dependencies, you can choose to run: mvn -U clean package -Dmirage2.on=true -Dmirage2.deps.included=false Warning: The Mirage 2 build process should NOT be run as "root". It must be run as a non-root user. For more information see: Mirage 2 Common Build Issues |
$CATALINA_HOME/shutdown.sh
script. (Many Unix-based installations will have a startup/shutdown script in the /etc/init.d
or /etc/rc.d
directories.)Update DSpace Installation. Update the DSpace installation directory with the new code and libraries. Issue the following commands:
cd [dspace-source]/dspace/target/dspace-installer ant update |
The above command will also automatically upgrade all your existing Solr indexes (e.g. for Discovery, Statistics, OAI-PMH) to the latest version. For large instances, this may take some time. But, it is important to ensure that your indexes are usable by the latest version of DSpace.
dspace.cfg
it is recommended to start with a fresh copy of the file from the new version and copy your site-specific settings from the old file. Read the new file carefully to see if you need (or want) other alterations. Decide which DSpace Web Applications you want to install. DSpace comes with a variety of web applications (in [dspace]/webapps
), each of which provides a different "interface" to your DSpace. Which ones you install is up to you, but there are a few that we highly recommend (see below):
"xmlui" = This is the XML-based User Interface, based on Apache Cocoon. It comes with a variety of out-of-the-box themes, including Mirage 1 (the default) and Mirage 2 (based on Bootstrap).Between the "xmlui" and "jspui", you likely only need to choose one.
"jspui" = This is the JSPUI-based User Interface, which is based on Bootstrap. Between the "xmlui" and "jspui", you likely only need to choose one.
"solr" (required) = This is Apache Solr web application, which is used by the "xmlui" and "jspui" (for search & browse functionality), as well as the OAI-PMH interface. It must be installed in support of either UI.
Deploy DSpace Web Applications. If necessary, copy the web applications from your [dspace]/webapps
directory to the subdirectory of your servlet container (e.g. Tomcat):
cp -R [dspace]/webapps/* [tomcat]/webapps/ |
See the installation guide for full details.
First, you can optionally verify whether DSpace correctly detects the version of your DSpace database. It is very important that the DSpace version is detected correctly before you attempt the migration:
[dspace]/bin/dspace database info # Look for a line at the bottom that says something like: # "Your database looks to be compatible with DSpace version ___" |
In some scenarios, if your database's "sequences" are outdated, inconsistent or incorrect, a database migration error may occur (in your DSpace logs). In order to AVOID this scenario, you may wish to manually run the "update-sequences.sql" script PRIOR to upgrade. This "update-sequences.sql" script will auto-correct any possible database sequence issues. In the future, we plan to automate this step to avoid any sequence problems (see DS-2480 ticket):
# Example for a PostgreSQL database named "dspace" psql -U dspace -f [dspace]/etc/postgres/update-sequences.sql |
Then, you can upgrade your DSpace database to the latest version of DSpace. (NOTE: check the DSpace log, [dspace]/log/dspace.log.[date]
, for any output from this command)
[dspace]/bin/dspace database migrate |
As long as you plan to use the default settings in DSpace (with Discovery enabled), you can safely remove any old Legacy browse tables (named "bi_*", where "bi" = browse index). To do so, simply run:
[dspace]/bin/dspace index-db-browse -f -d |
The contents of one more leftover Legacy browse table needs to be removed, the "communities2item" table. From an SQL client, execute the following SQL (and commit the changes/purge the recyclebin if you're using Oracle):
DELETE FROM COMMUNITIES2ITEM; |
[dspace]/log/dspace.log.[date]
) for information on its status.Reindexing of all content for search/browse: If your database was just upgraded (either manually or automatically), all the content in your DSpace will be automatically re-indexed for searching/browsing. As the process can take some time (minutes to hours, depending on the size of your repository), it is performed in the background; meanwhile, DSpace can be used as the index is gradually filled. But, keep in mind that not all content will be visible until the indexing process is completed. Again, check the DSpace log ( [dspace]/log/dspace.log.[date]
) for information on its status.
Check your cron / Task Scheduler jobs. In recent versions of DSpace, some of the scripts names have changed.
Check the Scheduled Tasks via Cron documentation for details. Especially pay attention to the Solr Index optimization commands, which ideally should be run regularly (as noted in the previous step).
If you run into issues with the auto-upgrade of your Solr search/browse indexes (during the final part of the ant update step
), then you may need to manually upgrade your Solr indexes. Depending on the type of failure, there are a few possible fixes.
lucene-core-3.5.0.jar
, in order to upgrade a DSpace 1.6.x, 1.7.x or 1.8.x index.lucene-core-3.5.0.jar
from http://search.maven.org/remotecontent?filepath=org/apache/lucene/lucene-core/3.5.0/lucene-core-3.5.0.jar [dspace-source]/dspace/target/dspace-installer/
directory (i.e. the directory where you ran "ant update" from)ant update
". This time, it should find the lucene-core-3.5.0.jar
locally and re-attempt the upgrade of your Solr indexes.If you are using an older version of DSpace, you will see errors similar to this one until you manually upgrade your index:
Caused by: org.apache.lucene.index.IndexFormatTooOldException: Format version is not supported (resource: segment _386q in resource ChecksumIndexInput(MMapIndexInput(path="/space/dspace/solr/statistics/data/index/segments_37m6"))): 2.x. This version of Lucene only supports indexes created with release 3.0 and later. |
Manually upgrading your Solr index involves temporarily downloading an older version of Lucene (on which Solr is based), and calling its IndexUpgrader script, e.g.
# Download Lucene 3.5.0, which can upgrade older Solr/Lucene indexes wget "http://search.maven.org/remotecontent?filepath=org/apache/lucene/lucene-core/3.5.0/lucene-core-3.5.0.jar" -O lucene-core-3.5.0.jar # Then, actually upgrade the indexes by loading the lucene-core-3.5.0.jar and calling IndexUpgrader # Upgrade the Usage Statistics index. Run this if you have Solr Usage Statistics enabled in your UI. java -cp lucene-core-3.5.0.jar org.apache.lucene.index.IndexUpgrader [dspace]/solr/statistics/data/index/ # Upgrade the OAI-PMH indexes. Run this if you use the "oai" webapp. java -cp lucene-core-3.5.0.jar org.apache.lucene.index.IndexUpgrader [dspace]/solr/oai/data/index/ # NOTE: You do not need to upgrade the Discovery Search and Browse indexes as they will be automatically rebuilt on upgrade (See previous upgrade step) |
Upgrading from DSpace 3.x or above: DSpace provides optimization commands for all Solr indexes. Which ones you need to run depend on which features you are using in DSpace.
# First, ensure your Tomcat is started up. All of the below commands will call Solr directly, which requires Tomcat to be running. # Optimize Usage Statistics (based on Solr). Run this if you have Usage Statistics enabled in your UI. [dspace]/bin/dspace stats-util -o # Optimize OAI-PMH indexes (based on Solr). Run this if you use the "oai" webapp. [dspace]/bin/dspace oai import -o # NOTE: You should not need to optimize the Discovery Search and Browse indexes, as they will be automatically rebuilt on upgrade (See previous upgrade step) # However, you still may wish to schedule optimizing of Discovery Search & Browse (via cron or similar) # [dspace]/bin/dspace index-discovery -o |
If, after running ant update
, you see an error like this:
[dspace-src]/dspace/target/dspace-installer/build.xml:88: Property ____ was circularly defined. |
This usually means that you are attempting to build the new version of DSpace using an outdated build.properties
file. Specifically, the property which is reported as being "circularly defined" is likely missing from your local [dspace-source]/build.properties
file. To resolve this issue, simply:
mvn -U clean package
). See Upgrade Steps (step #4) above.