Date: Fri, 29 Mar 2024 07:55:49 -0400 (EDT) Message-ID: <372507479.30340.1711713349999@lyrasis1-roc-mp1> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_30339_1104079751.1711713349998" ------=_Part_30339_1104079751.1711713349998 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
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 -&g= t; 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 reference=
s, 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 botc= hed install/upgrade is very difficult if not impossible to recover from. Th= e DSpace specific things to backup are: configs, source code modifications,= database, and assetstore. On your server that runs DSpace, you might addit= ionally 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 d= atabase use Postgres' pg_dump&= nbsp;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.#" set=
tings)[dspac=
e]/config
.Depending on your local use cases and needs, there are two primary optio= ns 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 dif= ficult, but the advantage is that it is more likely to bring forward any cu= stomizations you have made locally (e.g. in branding your UI or similar).= p>
As an example, if you wanted to upgrade from DSpace 1.5.x to DSp= ace 4.x, you'd perform each of these upgrade= s, one-by-one, in order:
Likely, you'd want to perform some local testing between each upgrad= e to ensure that each upgrade is successful. Otherwise, if there are l= ater issues, you may not be able to easily tell which upgrade caused the pr= oblems.
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 lat= est version of DSpace, and then simply upgrade your data (primarily the dat= abase). This is a much easier multi-version upgrade process, however = it does not automatically upgrade all of your configu= rations or customizations (as you'll be migrating to a fresh, uncustomized = installlation). So, depending on how complex (or important) your customizat= ions were, this may not fully meet your needs.
For example, in PostgreSQL use the "pg_dump" command to backup all y= our 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:= p>
# Creat= e a replica database. I've called this one "dspace-upgrade" just as an exam= ple 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]/ds=
pace/etc/postgres/
folder.=20
For example, suppose you are upgrading from DSpace 1.5.x to 4.x. Tha= t means you'll be upgrading your database from being 1.5.x compatible to be= ing 4.x compatible. In order to do that, you will run all these dat= abase upgrade scripts in order (again this example is just for Pos= tgreSQL):
# Upgra= de 'dspace-upgrade' database from 1.5.x to 1.6.x compatibility psql -U [database-user] -f [dspace-source]/dspace/etc/postgres/database_sch= ema_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_sch= ema_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_sch= ema_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_sch= ema_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_sch= ema_3-4.sql dspace-upgrade
For example, to dump "dspace-upgrade" to a file named "my-dspace-upg= raded-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 don= e by removing the default "fresh installation" database, and replacing it w= ith your upgraded version:
# Delet= e the default (MAKE SURE IT IS EMPTY) "fresh install" Database on the NEW D= Space 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 newl= y 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 v= ersion of DSpace. For example, assuming you are using Discovery faceted/fil= tered search/browse (the default in DSpace 4.x), you'd run:
[dspace= ]/bin/dspace index-discovery -f