All Versions
- DSpace 7.x (Current Release)
- DSpace 8.x (Unreleased)
- DSpace 6.x (EOL)
- DSpace 5.x (EOL)
- More Versions...
Old Release
This documentation relates to an old version of DSpace, version 4.x. Looking for another version? See all documentation.
This DSpace release is end-of-life and is no longer supported.
This page provides some simple tips/tricks you can use to upgrade DSpace over multiple versions (e.g. 1.5.x -> 1.6.x -> 1.7.x -> 1.8.x -> 3.x -> 4.x).
In the notes below [dspace]
refers to the install directory for your existing DSpace installation, and [dspace-source]
to the source directory for DSpace 4.x. Whenever you see these path references, be sure to replace them with the actual path names on your local system.
Before you start ANY 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
.Depending on your local use cases and needs, there are two primary options for upgrading across multiple versions:
With this option, you are just performing each major upgrade one by one following the upgrade instructions. At times, it may be a bit more difficult, but the advantage is that it is more likely to bring forward any customizations you have made locally (e.g. in branding your UI or similar).
As an example, if you wanted to upgrade from DSpace 1.5.x to DSpace 4.x, you'd perform each of these upgrades, one-by-one, in order:
Likely, you'd want to perform some local testing between each upgrade to ensure that each upgrade is successful. Otherwise, if there are later issues, you may not be able to easily tell which upgrade caused the problems.
It is also recommended to read the Release Notes for each major version.
The second option is to actually install a fresh installation of the latest version of DSpace, and then simply upgrade your data (primarily the database). This is a much easier multi-version upgrade process, however it does not automatically upgrade all of your configurations or customizations (as you'll be migrating to a fresh, uncustomized installlation). So, depending on how complex (or important) your customizations were, this may not fully meet your needs.
For example, in PostgreSQL use the "pg_dump" command to backup all your old data
pg_dump -U [database-user] -f my-dspace-db-backup.sql [database-name]
For example, in PostgreSQL use the "createdb" and "psql" commands:
# Create a replica database. I've called this one "dspace-upgrade" just as an example createdb -U [database-user] -E UNICODE dspace-upgrade # Load the old data into this replica database psql -U [database-user] -f my-dspace-db-backup.sql dspace-upgrade
[dspace-source]/dspace/etc/postgres/
folder.For example, suppose you are upgrading from DSpace 1.5.x to 4.x. That means you'll be upgrading your database from being 1.5.x compatible to being 4.x compatible. In order to do that, you will run all these database upgrade scripts in order (again this example is just for PostgreSQL):
# Upgrade 'dspace-upgrade' database from 1.5.x to 1.6.x compatibility psql -U [database-user] -f [dspace-source]/dspace/etc/postgres/database_schema_15-16.sql dspace-upgrade # Upgrade 'dspace-upgrade' database from 1.6.x to 1.7.x compatibility psql -U [database-user] -f [dspace-source]/dspace/etc/postgres/database_schema_16-17.sql dspace-upgrade # Upgrade 'dspace-upgrade' database from 1.7.x to 1.8.x compatibility psql -U [database-user] -f [dspace-source]/dspace/etc/postgres/database_schema_17-18.sql dspace-upgrade # Upgrade 'dspace-upgrade' database from 1.8.x to 3.x compatibility psql -U [database-user] -f [dspace-source]/dspace/etc/postgres/database_schema_18-3.sql dspace-upgrade # Upgrade 'dspace-upgrade' database from 3.x to 4.x compatibility psql -U [database-user] -f [dspace-source]/dspace/etc/postgres/database_schema_3-4.sql dspace-upgrade
For example, to dump "dspace-upgrade" to a file named "my-dspace-upgraded-db.sql":
pg_dump -U [database-user] -f my-dspace-upgraded-db.sql dspace-upgrade
First, you need to move over your upgraded Database data. That's done by removing the default "fresh installation" database, and replacing it with your upgraded version:
# Delete the default (MAKE SURE IT IS EMPTY) "fresh install" Database on the NEW DSpace dropdb -U [database-user] [database-name] # Recreate an empty DB createdb -U [database-user] -E UNICODE [database-name] # Load in the newly upgrade data (from "my-dspace-upgraded-db.sql") psql -U [database-user] -f my-dspace-upgraded-db.sql [database-name]
Next, copy over your old DSpace "Assetstore" directory into the newly installed version of DSpace. This assetstore directory contains all the actual content files
cp -R [path-to-old-dspace]/assetstore/* [path-to-new-dspace]/assetstore/
Finally, reindex all of your DSpace content in the newly installed version of DSpace. For example, assuming you are using Discovery faceted/filtered search/browse (the default in DSpace 4.x), you'd run:
[dspace]/bin/dspace index-discovery -f
1 Comment
Peter Dietz
When upgrading from 1.8 to 4, be sure to optimize your SOLR indexes before shutting down your 1.8 instance. And then run optimize again once your 4.x instance is up. This allows SOLR to upgrade the internal data structure of SOLR, otherwise your solr indexes can get corrupt and you would lost solr data.
Before shutting down 1.8
wget http:
//localhost
:8080
/solr/
<core>
/update
?optimize=
true
Right after turning on 4.x
wget http:
//localhost
:8080
/solr/
<core>
/update
?optimize=
true
Repeat that a few times, where <core> is: statistics, discovery, and oai, for each step.