In this document, $TOMCAT_HOME is used to refer to the absolute path of the directory containing the working Tomcat server, and $WORK_DIR is used to refer to the directory you prefer to work in.
Steps to upgrade Tomcat
1. Unzip the new downloaded Tomcat9.zip archive into the $WORK_DIR
$ cp Tomcat9x.zip $WORK_DIR
$ cd WORK_DIR
$ unzip Tomcat9x.zip
2. Change directory to new Tomcat conf.
$ cd tomcat-as/conf
3. Edit the new context.xml file and configure the database connection pool by referring to the working context.xml and save the file.
$ vi context.xml
4. Edit the new server.xml file and configure the Tomcat ports by referring to the working server.xml file and save the file.
$ vi server.xml
5. Copy the openspecimen.properties from working tomcat-as/conf/ directory to new tomcat-as/conf directory.
$ cp $TOMCAT_HOME/tomcat-as/conf/openspecimen.properties $WORK_DIR/tomcat-as/conf/.
6. Rename the working Tomcat directory to old_tomcat-as and compress that directory.
$ cd $TOMCAT_HOME
$ mv tomcat-as old_tomcat-as
$ zip -r old_tomcat-as.zip old_tomcat-as
7. Copy the new tomcat-as directory from OpenSpecimen build to the current Tomcat directory path.
$ cp -r $WORK_DIR/tomcat-as $TOMCAT_HOME
8. configure the Tomcat to run as a service.
Please refer to this Wiki page.