How to Install Java 21 and Set Java Environment Variables System-Wide on Ubuntu
DSpace 8.x → 10.x Migration Guide
Fresh installation + database, assetstore, Solr, metadata, DOI, and frontend migration
- Back up the DSpace 8.x database, assetstore, configuration, and Solr data.
- Create and prepare the DSpace 10.x PostgreSQL database.
- Restore the database and migrate the schema.
- Restore the assetstore with correct ownership and permissions.
- Handle Solr cores safely without copying old cores into
configsets/. - Reindex Discovery and import OAI data.
- Review DOI metadata and metadata registries.
- Merge configuration changes and address Angular UI breaking changes.
- Restart services and perform final verification against the old repository.
📚 Table of Contents
- Backup the 8.x source
- Create the target database
- Grant PostgreSQL schema permissions
- Restore the database
- Point local.cfg to the restored DB
- Migrate the schema
- Restore the assetstore
- Configure and verify Solr
- Reindex
- Migrate DOI metadata
- Load metadata registries
- Merge configuration changes
- Update the Angular frontend
- Verify scheduled tasks
- Restart and verify everything
- Known migration gotchas
Environment Reference
Fill in and confirm these values before running commands on a new server.
| Component | Reference |
|---|---|
| Old server | DSpace 8.x — hostname dspace-8x |
| New installation | Fresh DSpace 10.x at /dspace |
| Solr | /opt/solrSolr home: /opt/solr/server/solr |
| Target database | dspace10 — PostgreSQL 16 — role dspace |
| 8.x backup | /home/dspace/Downloads/Dspace_8.X_BKP/Dspace_8X._BKP_July_2026/ |
This is the migration approach (fresh 10.x install + move data over), not an in-place upgrade — recommended since you're skipping a major version (9.x) and already had 10.x installed fresh.
Step 1Backup the 8.x source (if not already done)
# DB dump
pg_dump -U [dspace8-db-user] -f dspace8_backup.sql [dspace8-db-name]
# Assetstore, config, solr
tar czf assetstore_backup.tar.gz -C [dspace8]/assetstore .
tar czf dspace8_config.tar.gz -C [dspace8]/config .
tar czf solr_backup.tar.gz -C [dspace8]/solr .Create the target database
sudo -u postgres createuser --username=postgres --no-superuser --pwprompt dspace # skip if exists
sudo -u postgres createdb --username=postgres --owner=dspace --encoding=UTF8 --locale=en_US.UTF-8 dspace10Grant schema permissions (required on Postgres 15+)
sudo -u postgres psql -d dspace10GRANT ALL PRIVILEGES ON DATABASE dspace10 TO dspace;
GRANT ALL ON SCHEMA public TO dspace;
ALTER SCHEMA public OWNER TO dspace;
\qsudo -u postgres psql -d dspace10 -c "CREATE EXTENSION IF NOT EXISTS pgcrypto;"Restore the DB dump
-h 127.0.0.1.psql -U dspace -h 127.0.0.1 -d dspace10 -f /path/to/dspace8_backup.sqlVerify the restored database:
psql -U dspace -h 127.0.0.1 -d dspace10 -c "\dt" | head -20
psql -U dspace -h 127.0.0.1 -d dspace10 -c "SELECT count(*) FROM item;"
psql -U dspace -h 127.0.0.1 -d dspace10 -c "SELECT count(*) FROM eperson;"Point local.cfg at the restored DB
nano /dspace/config/local.cfgdb.url = jdbc:postgresql://127.0.0.1:5432/dspace10
db.username = dspace
db.password = [password]
db.dialect = org.dspace.util.DSpacePostgreSQLDialectMigrate the schema
/dspace/bin/dspace database info # check pending/ignored migrations first
/dspace/bin/dspace database migrate ignored
/dspace/bin/dspace database info # confirm all Success, no Pending/Ignoredmigrate ignored? The guide requires it specifically when coming from 8.x because it also picks up legacy migrations flagged “Ignored” in the older database history. An “Out of Order” status on old entries after this is described as expected/harmless.Restore the assetstore
Check the source versus the backup archive for freshness first, then restore the assetstore:
rsync -av [8x-backup]/dspace/assetstore/ /dspace/assetstore/
chown -R tomcat:tomcat /dspace/assetstore # match your actual service user
chmod -R 750 /dspace/assetstoreVerify:
du -sh /dspace/assetstore
find /dspace/assetstore -type f | wc -l
psql -U dspace -h 127.0.0.1 -d dspace10 -c "SELECT count(*) FROM bitstream WHERE deleted=false;"
grep -r "assetstore" /dspace/config/local.cfg /dspace/config/spring/api/bitstore.xml 2>/dev/nullSolr — do NOT copy old core folders into configsets/
/dspace/solr/* contains full core directories, including core.properties and data/. They are not bare configsets. Do not copy them into /opt/solr/server/solr/configsets/. Doing so can create duplicate core-name conflicts and crash the CoreContainer.Your fresh DSpace 10.x installation already creates the correct live cores under /opt/solr/server/solr/<corename>/. Leave those cores alone and confirm Solr starts cleanly:
systemctl restart solr
systemctl status solr
tail -30 /opt/solr/server/logs/solr.logLook for:
Cores are: [statistics, qaevent, authority, audit, oai, suggestion, search]There should be no duplicate cores and no CoreContainerProvider error.
If the configsets mistake was previously made:
cd /opt/solr/server/solr/configsets
rm -rf statistics qaevent authority audit oai suggestion search
systemctl restart solrVerify the search and statistics cores:
curl http://localhost:8983/solr/search/select?q=*:*
curl http://localhost:8983/solr/statistics/select?q=*:*data/index contents from the corresponding 8.x cores into the already-created DSpace 10.x core data directories. Never route these through configsets/.Reindex
/dspace/bin/dspace index-discovery -b
/dspace/bin/dspace oai importDOI metadata migration (DSpace 10 changed the DOI field/format)
Metadata registries (usually auto-triggered by step 6, run manually if not)
cd /dspace/bin/
./dspace registry-loader -metadata ../config/registries/dcterms-types.xml
./dspace registry-loader -metadata ../config/registries/dublin-core-types.xml
./dspace registry-loader -metadata ../config/registries/eperson-types.xml
./dspace registry-loader -metadata ../config/registries/local-types.xml
./dspace registry-loader -metadata ../config/registries/sword-metadata.xml
./dspace registry-loader -metadata ../config/registries/workflow-types.xmlConfig diff — don’t overwrite, merge selectively
diff -rq [8x-backup]/dspace/config /dspace/configlocal.cfg values that remain valid, custom modules/*.cfg overrides, and any customized config/spring/api/bitstore.xml. Check DSpace 10.x release notes for renamed or removed keys.Frontend (Angular UI) — breaking changes inherited from 9.x AND 10.x
- Bootstrap 5 (introduced 9.0): migrate custom theme CSS/SASS using the Bootstrap 5 migration guide.
- Angular control-flow syntax (required as of 10.0): convert
ngIf/ngForto@if/@forin*.component.html:
cd [dspace-angular]
npx @angular/cli generate @angular/core:control-flow --path src/themes/[your-theme]Theme configuration was also simplified in 10.0. Check the “Upgrading from 9.x to 10.x” guidance on the User Interface Customization wiki before editing theme.config.ts.
Build the frontend:
cd [dspace-angular]
npm run clean
npm install
npm run build:prodCron / scheduled tasks
subscription-send is present in crontab. It replaces the old sub-daily task and is required since 7.5.Restart everything and verify
# Backend (PM2/runnable JAR)
pm2 stop dspace-ui.json
pm2 start dspace-ui.json
# or Tomcat
$CATALINA_HOME/bin/shutdown.sh && $CATALINA_HOME/bin/startup.shtail -100 /dspace/log/dspace.log.$(date +%Y-%m-%d)/server/api and the UI. Confirm that items, search, and browse are populated, then spot-check several records against the old DSpace 8.x site.Known Migration Gotchas
Connecting as
root or the wrong OS user through the local socket can fail even with -U dspace. Use -h 127.0.0.1 to force password authentication, or use sudo -u dspace psql.PostgreSQL 15+ does not grant
CREATE on public to all roles by default. The target schema therefore needs to be explicitly owned by dspace./dspace/solr/* contains full cores, not configsets. Copying them into configsets/ can create duplicate-core-name failures during Solr startup.- Database restored and item/eperson counts checked.
- All required database migrations show the expected status.
- Assetstore restored with correct ownership and permissions.
- Solr starts without duplicate-core or CoreContainer errors.
- Discovery reindex completed.
- OAI import completed.
- DOI metadata migration reviewed before production DOI use.
- Metadata registries verified.
- Custom configuration merged selectively.
- Angular UI built successfully.
- Scheduled tasks verified.
- REST API, UI, search, browse, and sample records checked against DSpace 8.x.
[8x-backup], [password], [dspace-angular], and database names with values from your own environment before executing commands.
Comments
Post a Comment