All Versions
DSpace Documentation
...
DSpace 89.0 features some breaking changes which you may wish to be aware of before beginning your upgrade:
...
DSpace 89.x requires the following updated versions of prerequisite software (when compared to DSpace 8.x).
Refer to the Backend Requirements section of "Installing DSpace" for more details around configuring and installing these prerequisites.
...
| Info | ||
|---|---|---|
| ||
If during the upgrade you are migrating your DSpace backend to a new server/machine, see Migrating DSpace to a new server guide for hints/tips. instead. The migration process documented on that page can be used as an alternative to this upgrade procedure. |
| Note | ||
|---|---|---|
| ||
| If upgrading from 6.x or below, you will need to follow some additional steps. These steps have been moved to our guide for Upgrading from DSpace 6.x or lower. |
dspace-79.20) or branch.Enabling pgcrypto on your DSpace database. (Additional options/notes in the Installation Documentation)
| Code Block |
|---|
# Login to your "dspace" database as a superuser
psql --username=postgres dspace
# Enable the pgcrypto extension on this database
CREATE EXTENSION pgcrypto; |
authority and statistics Solr cores. (Only necessary if you want to keep both your authority records and/or SOLR Statistics)| Code Block | ||
|---|---|---|
| ||
[dspace]/bin/dspace solr-export-statistics -i authority
[dspace]/bin/dspace solr-export-statistics -i statistics |
[dspace]/solr-export. This may take a long time and require quite a lot of storage. In particular, the statistics core is likely to be huge, perhaps double the size of the content of solr/statistics/data. You should ensure that you have sufficient free storage.statistics-YYYY (for example: statistics-2017 statistics-2018 etc.) The current year's statistics shard is named statistics and you should dump that one too. Build DSpace Backend. Run the following commands to compile DSpace :
| Code Block |
|---|
cd [dspace-source]
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
Stop Tomcat (or servlet container). Take down your servlet container.
$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.)As of DSpace 8, the "db.dialect" configuration has changed from "org.hibernate.dialect.PostgreSQL94Dialect" to "org.dspace.util.DSpacePostgreSQLDialect". Therefore, MAKE SURE that your dspace.cfg or local.cfg has this setting:
| Code Block |
|---|
db.dialect = org.dspace.util.DSpacePostgreSQLDialect |
[dspace-source]/dspace/config/local.cfg). That way your existing configuration gets reinstalled alongside the new version of DSpace.config directory, and its subdirectories, concentrating on configurations your previously customized in your local.cfg. See also the Configuration Reference.[dspace]/config/spring/api/bte.xml Spring Configuration. This file is no longer needed as the BTE framework was removed in favor of Live Import from external sources.First, create a temporary folder to copy your old v6 configurations into
| Code Block |
|---|
# Example of creating a [dspace]/config/temp folder for this migration
# You must replace [dspace] with the full path of your DSpace 7 installation.
cd [dspace]/config
mkdir temp |
Run the command-line migration script to migrate them to v7 configuration files
| Code Block |
|---|
# This example uses [dspace] as a placeholder for all paths.
# Replace it with either the absolute or relative path of these files
[dspace]/bin/dspace submission-forms-migrate -s [dspace]/config/temp/item-submission.xml -f [dspace]/config/temp/input-forms.xml |
[dspace]/config/item-submission.xml.migrated [dspace]/config/submission-forms.xml.migrated [dspace]/config/ folder, therefore retaining the inline comments in those default files.[dspace]/config/GeoLiteCity.dat file is no longer maintained by its provider. You can delete it. The new file is named GeoLite2-City.mmdb by default. If you have configured a different name and/or location for this file, you should check the setting of usage-statistics.dbfile in [dspace]/config/modules/usage-statistics.cfg (and perhaps move your custom setting to local.cfg).dspace.cfg and/or local.cfg all lines referencing org.dspace.app.mediafilter.WordFilter and uncomment all lines referencing org.dspace.app.mediafilter.PoiWordFilter.solr.server to point at your new Solr external service. It will probably become something like solr.server = https://localhost:8983/solr. Solr only needs to be accessible to the DSpace backend, and should not be publicly available on the web. It can either be run on localhost or via a hostname (if run on a separate server from the backend). Also review the values ofdiscovery.search.serveroai.solr.urlsolr.authority.serversolr-statistics.serversitemap.cron setting exists in the dspace.cfg which controls when Sitemaps are generated. By default they are enabled to update once per day, for optimal SEO. See Search Engine Optimization docs for more detail./dspace generate-sitemaps", this system cron job can be removed in favor of the new sitemap.cron setting.build.properties configuration file has been replaced by an enhanced local.cfg configuration file. Therefore, any old build.properties file (or similar [dspace-source]/*.properties files) WILL BE IGNORED. Instead, you should create a new local.cfg file, based on the provided [dspace-source]/dspace/config/local.cfg.EXAMPLE and use it to specify all of your locally customized DSpace configurations. See the Configuration Reference documentation and the local.cfg Configuration File section on that page.Update DSpace Installation. Update the DSpace installation directory with the new code and libraries. Issue the following commands:
| Code Block |
|---|
cd [dspace-source]/dspace/target/dspace-installer
ant update |
(Optional) If desired, you can optionally verify which migrations have not yet been run on your database. You can use this to double check that DSpace is recognizing your database version appropriately
| Code Block |
|---|
[dspace]/bin/dspace database info
# If you are upgrading from 5.x or later, then this will list all migrations
# which were previously run, along with any which are "PENDING" or "IGNORED"
# that need to be run to upgrade your database.
# If you are upgrading from 4.x or earlier, this will attempt to detect which
# version of DSpace you are upgrading from. Look for a line at the bottom
# that says something like:
# "Your database looks to be compatible with DSpace version ___" |
(Optional) In some rare scenarios, if your database's "sequences" are outdated, inconsistent or incorrect, a database migration error may occur (in your DSpace logs). While this is seemingly a rare occurrence, you may choose to run the "update-sequences" command PRIOR to upgrading your database. If your database sequences are inconsistent or incorrect, this "update-sequences" command will auto-correct them (otherwise, it will do nothing).
| Code Block |
|---|
# This command only works if upgrading from DSpace 7.0 or later
[dspace]/bin/dspace database update-sequences
# If upgrading from DSpace 6 or below, this script had to be run via psql from [dspace]/etc/postgres/update-sequences.sql
# For example:
# psql -U [database-user] -f [dspace]/etc/postgres/update-sequences.sql [database-name]
# NOTE: It is important to run the "update-sequences" script which came with the OLDER version of DSpace (the version you are upgrading from)! If you've misplaced # this older version of the script, you can download it from our codebase & run it via the "psql" command above.
# DSpace 6.x version of "update-sequences.sql": https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace/etc/postgres/update-sequences.sql
# DSpace 5.x version of "update-sequences.sql": https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace/etc/postgres/update-sequences.sql |
(REQUIRED) 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)
| Code Block |
|---|
# If upgrading from DSpace 6.x or below
[dspace]/bin/dspace database migrate ignored
# If upgrading from DSpace 7.x or an earlier version of 8.x
[dspace]/bin/dspace database migrate |
If you are upgrading from DSpace 6.x or below be sure you include the "ignored" parameter! There are database changes which were previously optional but now are mandatory (specifically Configurable Workflow database changes).
| Note | ||
|---|---|---|
| ||
If any database migrations are run (even during minor release upgrades), then by default DSpace will automatically reindex all content in your site. This process is run automatically in order to ensure that any database-level changes are also immediately updated within the search/browse interfaces. See the notes below under "Restart Tomcat (servlet container)" for more information. However, you may choose to skip automatic reindexing. Some sites choose to run the reindex process manually in order to better control when/how it runs. To disable automatic reindexing, set discovery.autoReindex = false in config/local.cfg or config/modules/discovery.cfg.As you have disabled automatic reindexing, make sure to manually reindex your site by running WARNING: It is not recommended to skip automatic reindexing, unless you will manually reindex at a later time, or have verified that a reindex is not necessary. Forgetting to reindex your site after an upgrade may result in unexpected errors or instabilties. |
Deploy Server web application: Two deployment options are now available for the DSpace backend.
WAR Deployment via Tomcat (traditional approach): In this approach, you must have Tomcat (or a different servlet container) installed locally. You will need to deploy the "server" webapp (in [dspace]/webapps/server ) into your Servlet Container (e.g. Tomcat). Generally, there are two options (or techniques) which you could use...either configure Tomcat to find the DSpace "server" webapp, or copy the "server" webapp into Tomcat's own webapps folder. For more information & example commands, see the Installation Guide
| Code Block | ||||
|---|---|---|---|---|
| ||||
java -jar [dspace]/webapps/server-boot.jar |
Copy the new, empty Solr cores to your new Solr instance.
| Code Block |
|---|
cp -R [dspace]/solr/* [solr]/server/solr/configsets
chown -R solr:solr [solr]/server/solr/configsets |
Start Solr, or restart it if it is running, so that these new cores are loaded.
| Code Block |
|---|
[solr]/bin/solr restart |
You can check the status of Solr and your new DSpace cores by using its administrative web interface. Browse to ${solr.server} (e.g. http://localhost:8983/solr/) to see if Solr is running well, then look at the cores by selecting (on the left) Core Admin or using the Core Selector drop list.
${solr.server}/search/select. It should run an empty query against the "search" core, returning an empty JSON result. If it returns an error, then that means your "search" core is missing or not installed properly.authority and statistics from the CSV dumps that you made earlier in Step 2 above.| Code Block | ||
|---|---|---|
| ||
[dspace]/bin/dspace solr-import-statistics -i authority
[dspace]/bin/dspace solr-import-statistics -i statistics |
For the Statistics core(s) only, upgrade legacy DSpace Object Identifiers (pre-6.4 statistics) to UUID Identifiers.
| Code Block |
|---|
[dspace]/bin/dspace solr-upgrade-statistics-6x -i statistics |
Again If you had sharded your statistics, you will need to run this for each shard separately. See also SOLR Statistics Maintenance#UpgradeLegacyDSpaceObjectIdentifiers(pre-6xstatistics)toDSpace6xUUIDIdentifiers
Update Handle Server Configuration. (Required when upgrading from 6.x or below) Because we've updated to Handle Server v9, if you are using the built-in Handle server (most installations do), you'll need to add the follow to the end of the server_config section of your [dspace]/handle-server/config.dct file (the only new line is the "enable_txn_queue" line)
| Code Block |
|---|
"case_sensitive" = "no"
"storage_type" = "CUSTOM"
"storage_class" = "org.dspace.handle.HandlePlugin"
"enable_txn_queue" = "no" |
./dspace make-handle-config script, which is in charge of updating this config.dct file.geoipupdate tool directly via their package manager. You will still need to configure your license key prior to usage.usage-statistics.dbfile in your local.cfg configuration file . config/ directory (if they exist).usage-statistics.dbfile in your local.cfg configuration file . Restart Tomcat (servlet container) or Runnable JAR. Now restart your servlet container (Tomcat/Jetty/Resin) or Runnable JAR and test out the upgrade.
[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. If you wish to skip automatic reindexing, please see the Note above under the "Upgrade your Database" step.
| Code Block |
|---|
[dspace]/bin/dspace index-discovery -b |
| Code Block |
|---|
[dspace]/bin/dspace oai import |
Build DSpace Backend. Run the following commands to compile DSpace :
| Code Block |
|---|
cd [dspace-source]
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
Stop Tomcat (or servlet container). Take down your servlet container.
$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.)[dspace-source]/dspace/config/local.cfg). That way your existing configuration gets reinstalled alongside the new version of DSpace.As of DSpace 8, the "db.dialect" configuration has changed from "org.hibernate.dialect.PostgreSQL94Dialect" to "org.dspace.util.DSpacePostgreSQLDialect". Therefore, MAKE SURE that your dspace.cfg or local.cfg has this setting:
| Code Block |
|---|
db.dialect = org.dspace.util.DSpacePostgreSQLDialect |
Update DSpace Installation. Update the DSpace installation directory with the new code and libraries. Issue the following commands:
| Code Block |
|---|
cd [dspace-source]/dspace/target/dspace-installer
ant update |
(Optional) If desired, you can optionally verify which migrations have not yet been run on your database. You can use this to double check that DSpace is recognizing your database version appropriately
| Code Block |
|---|
[dspace]/bin/dspace database info
# The response will be a list all migrations which were previously run,
# along with any which are "PENDING" or "IGNORED"
# that need to be run to upgrade your database. |
(Optional) In some rare scenarios, if your database's "sequences" are outdated, inconsistent or incorrect, a database migration error may occur (in your DSpace logs). While this is seemingly a rare occurrence, you may choose to run the "update-sequences" command PRIOR to upgrading your database. If your database sequences are inconsistent or incorrect, this "update-sequences" command will auto-correct them (otherwise, it will do nothing).
| Code Block |
|---|
# This command only works if upgrading from DSpace 7.x or later
[dspace]/bin/dspace database update-sequences
# If upgrading from DSpace 6 or below, this script had to be run via psql from [dspace]/etc/postgres/update-sequences.sql
# For example:
# psql -U [database-user] -f [dspace]/etc/postgres/update-sequences.sql [database-name]
# NOTE: It is important to run the "update-sequences" script which came with the OLDER version of DSpace (the version you are upgrading from)! If you've misplaced
# this older version of the script, you can download it from our codebase & run it via the "psql" command above.
# DSpace 6.x version of "update-sequences.sql": https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace/etc/postgres/update-sequences.sql
# DSpace 5.x version of "update-sequences.sql": https://github.com/DSpace/DSpace/blob/dspace-5_x/dspace/etc/postgres/update-sequences.sql |
(REQUIRED) 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)
| Code Block |
|---|
# If upgrading from DSpace 6.x or below
[dspace]/bin/dspace database migrate ignored
# If upgrading from DSpace 7.x, 8.x or an earlier version of 9.x
[dspace]/bin/dspace database migrate |
| Note | ||
|---|---|---|
| ||
If any database migrations are run (even during minor release upgrades), then by default DSpace will automatically reindex all content in your site. This process is run automatically in order to ensure that any database-level changes are also immediately updated within the search/browse interfaces. See the notes below under "Restart Tomcat (servlet container)" for more information. However, you may choose to skip automatic reindexing. Some sites choose to run the reindex process manually in order to better control when/how it runs. To disable automatic reindexing, set discovery.autoReindex = false in config/local.cfg or config/modules/discovery.cfg.As you have disabled automatic reindexing, make sure to manually reindex your site by running WARNING: It is not recommended to skip automatic reindexing, unless you will manually reindex at a later time, or have verified that a reindex is not necessary. Forgetting to reindex your site after an upgrade may result in unexpected errors or instabilties. |
Deploy Server web application: Two deployment options are now available for the DSpace backend.
WAR Deployment via Tomcat (traditional approach): In this approach, you must have Tomcat (or a different servlet container) installed locally. You will need to deploy the "server" webapp (in [dspace]/webapps/server ) into your Servlet Container (e.g. Tomcat). Generally, there are two options (or techniques) which you could use...either configure Tomcat to find the DSpace "server" webapp, or copy the "server" webapp into Tomcat's own webapps folder. For more information & example commands, see the Installation Guide
| Code Block | ||||
|---|---|---|---|---|
| ||||
java -jar [dspace]/webapps/server-boot.jar |
| Anchor | ||||
|---|---|---|---|---|
|
Copy the new, empty Solr cores to your new Solr instance.
| Code Block |
|---|
cp -R [dspace]/solr/* [solr]/server/solr/configsets
chown -R solr:solr [solr]/server/solr/configsets |
Start Solr, or restart it if it is running, so that these new cores are loaded.
| Code Block |
|---|
[solr]/bin/solr restart |
You can check the status of Solr and your new DSpace cores by using its administrative web interface. Browse to ${solr.server} (e.g. http://localhost:8983/solr/) to see if Solr is running well, then look at the cores by selecting (on the left) Core Admin or using the Core Selector drop list.
${solr.server}/search/select. It should run an empty query against the "search" core, returning an empty JSON result. If it returns an error, then that means your "search" core is missing or not installed properly.Restart Tomcat (servlet container) or Runnable JAR. Now restart your servlet container (Tomcat/Jetty/Resin) or Runnable JAR and test out the upgrade.
[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. If you wish to skip automatic reindexing, please see the Note above under the "Upgrade your Database" step.
| Code Block |
|---|
[dspace]/bin/dspace index-discovery -b |
| Code Block |
|---|
[dspace]/bin/dspace oai import |
dspace-9.0) or branch.[dspace-angular].Install any updated local dependencies using NPM in the [dspace-angular] source code directory:
| Code Block |
|---|
# change directory to our repo
cd [dspace-angular]
# install/update the local dependencies
npm install |
Build the latest User Interface code for Production: This rebuilds the latest code into the [dspace-angular]/dist directory
| Code Block |
|---|
npm run build:prod |
If you are upgrading from 7.0, 7.1 or 7.2, a new "eager-theme.module.ts" and "lazy-theme.module.ts" has been added to both the "custom" and "dspace" themes to improve performance. Make sure to copy those to your custom theme. Additionally, this new "eager-theme.module.ts" for your theme MUST be imported/enabled in "src/themes/eager-themes.module.ts". For example, for a local theme under "src/theme/my-theme":
| Code Block | ||
|---|---|---|
| ||
import { EagerThemeModule as MyThemeEagerThemeModule } from './my-theme/eager-theme.module';
...
@NgModule({
imports: [
MyThemeEagerThemeModule,
],
}) |
dspace-8.0) or branch.[dspace-angular].Install any updated local dependencies using Yarn in the [dspace-angular] source code directory:
| Code Block |
|---|
# change directory to our repo
cd [dspace-angular]
# install/update the local dependencies
yarn install |
Build the latest User Interface code for Production: This rebuilds the latest code into the [dspace-angular]/dist directory
| Code Block |
|---|
yarn build:prod |
[dspace-angular]/dist) to a different directory (which we refer to as [dspace-ui-deploy]) in order to keep your running UI separate from the source code. While it's still possible to run the UI using "yarn start" or "yarn run serve:ssr" (both of which use [dspace-angular]/dist),that older approach will mean that your site goes down / becomes unavailable anytime you rebuild (yarn build:prod). To solve this issue:[dspace-ui-deploy] location as described in the Installation documentation.[dspace-angular]/dist folder to that location, as described in the Installation documentation.If upgrading from 7.0 or 7.1, migrate your UI Configurations to YAML. In 7.2, the format of the UI configuration file changed from Typescript to YAML to support runtime configuration. This means that customization of the older ./src/environment/environment.*.ts build-time configuration files has been superseded by corresponding ./config/config.*.yml configuration files (e.g. environment.prod.ts → config.prod.yml).
As of 7.3, a new "eager-theme.module.ts" and "lazy-theme.module.ts" has been added to both the "custom" and "dspace" themes to improve performance. Make sure to copy those to your custom theme. Additionally, this new "eager-theme.module.ts" for your theme MUST be imported/enabled in "src/themes/eager-themes.module.ts". For example, for a local theme under "src/theme/my-theme":
| Code Block | ||
|---|---|---|
| ||
import { EagerThemeModule as MyThemeEagerThemeModule } from './my-theme/eager-theme.module';
...
@NgModule({
imports: [
MyThemeEagerThemeModule,
],
}) |
Using a tool like "git diff" from the commandline is often an easy way to see changes that occurred only in that directory.
| Code Block |
|---|
# Example which will show all the changes to "src/themes/dspace" (and all subfolders)
# between dspace- |
8. |
1 (tag) and dspace- |
9.0 (tag) git diff dspace- |
8. |
1 dspace- |
9.0 -- src/themes/dspace/ |
const DECLARATIONS" section), and also registers new Modules, i.e. new UI features, (in the "@NgModule" → "imports" section). Make sure those sections are updated in your copy of this file!const DECLARATIONS" section), and also registers new Modules, i.e. new UI features, (in the "@NgModule" → "imports" section). Make sure those sections are updated in your copy of this file!If you are using PM2 as described in the Installing DSpace instructions, you'd stop it and then start it back up as follows
| Code Block |
|---|
# Stop the running UI
pm2 stop dspace-ui.json
# If you had to update your PM2 configs, you may need to delete your old configuration from PM2
# pm2 delete dspace-ui.json
# Start it back up
pm2 start dspace-ui.json |
If you are using a different approach, you simply need to stop the running UI, and re-run:
| Code Block |
|---|
# First stop the running UI process by killing it (or similar)
# You MUST restart the UI from within the deployment directory
# See Installation Instructions for more info on this directory
cd [dspace-ui-deploy]
# Then restart the UI via Node.js
node ./dist/server/main.js |
...