These scripts upgrade an existing Apache Tomcat install to the latest point release of the same major version (for example 9.0.85 → 9.0.109). They will never move you to a new major version (9 → 10).
The script detects the installed version, downloads the newest matching release from Apache (checksum-verified),
stops Tomcat, backs up lib, bin, and conf, replaces the Tomcat program files,
then restarts and verifies. If the upgraded server fails to start, the previous version is automatically restored.
Your configuration is never modified: conf (including server.xml), webapps,
setenv files, and any custom jars in lib (JDBC drivers etc.) are all preserved.
The new version's default config files are saved to conf.new-<version> for optional manual review.
If the install is already on the latest release, the script exits without changing anything.
This folder is expected to sit next to the Tomcat folder, both inside the m-power folder:
m-power/ tomcat/ <- upgraded upgrade-tomcat/ <- these scripts
Run with no arguments and the script finds Tomcat automatically. If Tomcat is elsewhere, pass its location as an argument.
Easiest: double-click upgrade-tomcat.bat. It asks for administrator rights (accept the UAC prompt),
runs the upgrade, and keeps the window open so you can read the result.
Or from an elevated Command Prompt / PowerShell (right-click → Run as administrator):
C:\m-power\upgrade-tomcat\upgrade-tomcat.bat
With arguments (only needed when the defaults don't apply):
upgrade-tomcat.bat -CatalinaHome "D:\somewhere\tomcat" -ServiceName Tomcat9 -HttpPort 8081
| Argument | Default when omitted |
|---|---|
-CatalinaHome | The sibling tomcat folder next to this script folder. |
-ServiceName | Auto-detected: the Windows service (any name) whose executable lives inside the Tomcat folder being upgraded. If none matches, shutdown.bat/startup.bat are used. |
-HttpPort | Read from that Tomcat's own conf\server.xml (used only to verify stop/start). |
Run as root:
cd /opt/m-power/upgrade-tomcat chmod +x upgrade-tomcat.sh # first time only ./upgrade-tomcat.sh
With arguments (only needed when the defaults don't apply):
./upgrade-tomcat.sh -c /opt/somewhere/tomcat -s tomcat.service -p 8081
| Argument | Default when omitted |
|---|---|
-c (catalina home) | The sibling tomcat folder next to this script folder. |
-s (systemd service) | Auto-detected: the systemd unit whose file references the Tomcat folder being upgraded. If none is found, shutdown.sh/startup.sh are used, run as the Tomcat folder's owner. Pass -s explicitly if the unit sets the Tomcat path indirectly (e.g. via EnvironmentFile). |
-p (HTTP port) | Read from that Tomcat's own conf/server.xml (used only to verify stop/start). |
tomcat folder. The script verifies the service and port belong to the Tomcat being upgraded and refuses to touch a different instance.backup-<old version>-<date>) is left inside the Tomcat folder — delete it once you're satisfied.dlcdn.apache.org.