Prerequisites
...
Code Block |
---|
|
sudo rm cspace-server-6.0.tar.gz |
Update Symbolic Links or Environment Variables
Change to the user you use to build and deploy CollectionSpace – typically, either cspace
or collectionspace
.
Code Block |
---|
|
sudo su - cspace # or sudo su - collectionspace |
If your installation is in /opt/collectionspace
, you will have a symbolic link in that directory named server
that points to the old tomcat directory. Update the link to point to the new tomcat directory.
Code Block |
---|
|
cd /opt/collectionspace
ls -l server
> lrwxrwxrwx 1 collectionspace collectionspace 41 May 26 17:01 server -> /opt/collectionspace/apache-tomcat-8.5.40
ln -sfn /opt/collectionspace/apache-tomcat-8.5.51 server
ls -l server
> lrwxrwxrwx 1 collectionspace collectionspace 41 May 26 17:01 server -> /opt/collectionspace/apache-tomcat-8.5.51 |
If your installation is in /opt/collectionspace
, updating the symbolic link is all you need to do. Continue to "Upgrade Source Code".
If your installation is not in /opt/collectionspace
:
Edit the file in which environment variables are set for the build – typically, .bashrc
in the home directory of the user used to build and deploy CollectionSpace.
In that file, find the lines where the CATALINA_HOME
, CATALINA_PID
, and CSPACE_JEESERVER_HOME
variables are set. The values will contain the path to the old Tomcat 8.5.40 directory. Change them to use path of the new Tomcat 8.5.51 directory. The changed lines should now look like the below examples:
Code Block |
---|
|
export CATALINA_HOME='/usr/local/share/apache-tomcat-8.5.51'
export CATALINA_PID='/usr/local/share/apache-tomcat-8.5.51/bin/tomcat.pid'
export CSPACE_JEESERVER_HOME='/usr/local/share/apache-tomcat-8.5.51' |
Source the file to update the environment variables:
Code Block |
---|
|
source ~/.bashrc |
Upgrade Source Code
Continue to perform the following steps as the user you use to build and deploy CollectionSpace – typically, either cspace
or collectionspace
.
CollectionSpace source code is normally located in /home/cspace/
collectionspace-source
or /opt/collectionspace
.
If you created a tenant on your system using the clone-tenant
tool, you will have edited the tenant.properties
files in the services
and application
source code directories. These changes will prevent some the next steps form working. Usually, there's no need to retain the changed tenant.properties
files after the tenant has been created, so you can remove your changes:
g Code Block |
---|
|
cd /home/cspace/collectionspace-source # or cd /opt/collectionspace
cd services
git checkout tenant.properties
cd ../application
git checkout tenant.properties |
Upgrade the source code to 6.0:
Code Block |
---|
|
cd /home/cspace/collectionspace-source # or cd cd
cd services
git fetch
git checkout v6.0-branch
cd ../application
git fetch
git checkout v6.0-branch |
Upgrade Tenant Back End (Services) Configuration
If you created a tenant in 5.2, there will be some back end configuration for the tenant in the application
source code directory, in the directory named tomcat-main/src/main/resources/tenants/{tenant_short_name}
, where {tenant_short_name}
is the short name of your tenant. There will also be a directory containing configuration for the tenant that you used as a template to create your tenant, at tomcat-main/src/main/resources/tenants/{
template_short_name}
. Copy all of the files from the template tenant directory to your tenant directory, except for settings.xml
. When copying, replace the template tenant's short name with your tenant's short name in each file name. For example, if your tenant's short name is mytenant
, and it was created from the anthro
tenant:
Code Block |
---|
|
cd /home/cspace/collectionspace-source # or cd /opt/collectionspace
cd application/tomcat-main/src/main/resources/tenants
ls anthro
> anthro-authority-concept.xml anthro-collectionobject.xml settings.xml
> anthro-authority-person-termList.xml domain-instance-vocabularies.xml
cp anthro/anthro-authority-concept.xml mytenant/mytenant-authority-concept.xml
cp anthro/anthro-authority-person-termList.xml mytenant/mytenant-authority-person-termList.xml
cp anthro/anthro-collectionobject.xml mytenant/mytenant-collectionobject.xml
cp anthro/domain-instance-vocabularies.xml mytenant/domain-instance-vocabularies.xml |
There is additional configuration for your tenant in the file tomcat-main/src/main/resources/{tenant_short_name}-tenant.xml
. This file was based on the corresponding file for the tenant you used as a template. That file is named tomcat-main/src/main/resources/{template_short_name}-tenant.xml
. You will need to check if the configuration for the template tenant has changed between 5.2 and 6.0. If so, make the same changes to your tenant's configuration file. For example, if your tenant is based on the anthro
tenant, use git
to check for changes to tomcat-main/src/main/resources/anthro-tenant.xml
:
Code Block |
---|
|
cd /home/cspace/collectionspace-source # or cd /opt/collectionspace
cd application
git diff -w v5.2-branch tomcat-main/src/main/resources/anthro-tenant.xml |
This shows that no changes were made to the configuration for the template tenant (in this example, the anthro
tenant) from 5.2 to 6.0. If there had been any changes, you would need to make the same changes to the configuration file for your tenant (tomcat-main/src/main/resources/{tenant_short_name}-tenant.xml
). Note that the results will vary, depending on the template tenant. Some tenants may require configuration changes.
If you created more than one tenant, repeat the above steps for each tenant.
Upgrade Tenant Front End (UI) Configuration
If you created a tenant in 5.2, the user interface for the tenant will be located in the services/cspace-ui
directory. Inside that directory, there will be a directory named with the short name of your tenant.
To upgrade your tenant, copy build.properties
from the tenant that you used as a template for creating your tenant. For example, if the short name of your tenant is mytenant
tenant, and your tenant was cloned from the anthro
tenant:
Code Block |
---|
|
cd /home/cspace/collectionspace-source # or cd /opt/collectionspace
cd services/cspace-ui
cp anthro/build.properties mytenant |
If you created more than one tenant, repeat for each tenant.
Build and Deploy
Build and deploy CollectionSpace from the source code. The final ant
command below includes the create_db
target. This will not delete any existing data, because the -Drecreate_db=true
parameter is not supplied.
Code Block |
---|
|
cd /home/cspace/collectionspace-source # or cd /opt/collectionspace
cd services
mvn clean install -DskipTests
cd ../application
mvn clean install -DskipTests
cd ../services
ant undeploy deploy create_db import |
Migrate Binary Data
Perform the following steps as the user you use to run CollectionSpace – typically, either cspace
or collectionspace
.
Move or copy the nuxeo-server/data
directory from Tomcat 8.5.40 to Tomcat 8.5.51. This directory contains the binary data that was uploaded in CollectionSpace media records, so it can be large. Moving the directory instead of copying it is faster, and prevents unnecessary duplication. If you need to revert the upgrade, remember to move the directory back.
Code Block |
---|
|
cd /usr/local/share # or cd /opt/collectionspace
mv apache-tomcat-8.5.40/nuxeo-server/data apache-tomcat-8.5.51/nuxeo-server |
Migrate Server Configuration
You may have made configuration changes to the server in the old tomcat directory, in the files lib/security.properties
and nuxeo-server/config/nuxeo.properties
. Copy those files from apache-tomcat-8.5.40
to apache-tomcat-8.5.51
.
Code Block |
---|
|
cd /usr/local/share # or cd /opt/collectionspace
cp apache-tomcat-8.5.40/lib/security.properties apache-tomcat-8.5.51/lib/security.properties
cp apache-tomcat-8.5.40/nuxeo-server/config/nuxeo.properties apache-tomcat-8.5.51/nuxeo-server/config/nuxeo.properties |
Verify the Upgrade
Start CollectionSpace, being sure to use the startup script in the new Tomcat 8.5.51 directory, not the old Tomcat 8.5.40. Ensure that there are no errors in the logs during startup, and that you can log in to your tenant, and open and save records.