Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
30 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Hans Schou
Hi

I am about to upgrade a lot of Tomcat 8.0 instances to 9.0 on Windows.
The way I am doing it is by:
  SET JAVA_HOME=C:\Java\ jdk-11
  SET CATALINA_BASE=C:\inst\example
  SET CATALINA_HOME=C:\tomcat-8.0
  C:\tomcat-8.0\bin\service remove example
  SET CATALINA_HOME=C:\tomcat-9.0
  C:\tomcat-9.0\bin\service install example

But in this process I loose some parameters like "Log on", "Initial memory pool" and "Java options" which has been set with
  tomcat8w.exe //ES//example
or
 tomcat8w.exe //US//example

Is there a way where I can get the say "Java options" parameters with a command line tool so I don't have to start the GUI for every instans?

Or is there a better way to upgrade from 8.0 to 9.0?

Any hint much appreciated.

Best regards
Hans Schou


Reply | Threaded
Open this post in threaded view
|

Re: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Bill Stewart
On Thu, Jul 23, 2020 at 6:24 AM Hans Schou wrote:

I am about to upgrade a lot of Tomcat 8.0 instances to 9.0 on Windows.

> ...
> But in this process I loose some parameters like "Log on", "Initial memory
> pool" and "Java options" which has been set with
>   tomcat8w.exe //ES//example
> or
>  tomcat8w.exe //US//example
>
> Is there a way where I can get the say "Java options" parameters with a
> command line tool so I don't have to start the GUI for every instans?
>
> Or is there a better way to upgrade from 8.0 to 9.0?
>

Simplifying upgrades on the Windows platform is one of the main reasons I
created an alternative Windows installer. Latest version here:

https://github.com/Bill-Stewart/ApacheTomcatSetup/releases

Documentation is here:

https://github.com/Bill-Stewart/ApacheTomcatSetup

Basically the steps would be:

1. Back up/document your 8.x configuration.

2. If you used Apache's Windows installer, uninstall it (unfortunately this
removes the service and service configuration info).

3. Install the latest Tomcat version using the alternative installer, and
configure Tomcat as needed.

In the future, upgrades using the alternative installer are pretty simple:

1. Update the timestamps of the config files you don't want the installer
to overwrite.

2. Download and run the latest version of the alternative installer to
perform the upgrade. The installer automatically stops the service,
upgrades the files, and restarts the service. All service configuration
information is preserved.

Of course, I would strongly recommend testing all of the above in a test
environment first.

Bill
Reply | Threaded
Open this post in threaded view
|

SV: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Hans Schou
Fra: Bill Stewart <[hidden email]>


> https://github.com/Bill-Stewart/ApacheTomcatSetup/releases

I will look into that.

> Basically the steps would be:
> 1. Back up/document your 8.x configuration.

"document" manually? Like copy&paste into a text file?

> 2. If you used Apache's Windows installer, uninstall it (unfortunately this removes the service and service configuration info).

I use the zip file version, roughly I do this:
  CD D:\Apache
  unzip apache-tomcat-9.0.37.zip
  MKLINK /D tomcat-9.0 apache-tomcat-9.0.37
And then I make all my instances have CATALINA_BASE=D:\Apache\tomcat-9.0 so I can minor upgrade several instances at the same time just by changing the symlink (services must be stopped first).


> 1. Update the timestamps of the config files you don't want the installer to overwrite.

Is this necessary when using zip-package?

> Of course, I would strongly recommend testing all of the above in a test environment first.

No problem. I have all three: dev- test- production- environment

./hans

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Bill Stewart
On Fri, Jul 24, 2020 at 2:26 AM Hans Schou wrote:

"document" manually? Like copy&paste into a text file?
>

Yes, however you customarily do so.


> > 2. If you used Apache's Windows installer, uninstall it (unfortunately
> this removes the service and service configuration info).
>
> I use the zip file version, roughly I do this:
>   CD D:\Apache
>   unzip apache-tomcat-9.0.37.zip
>   MKLINK /D tomcat-9.0 apache-tomcat-9.0.37
> And then I make all my instances have CATALINA_BASE=D:\Apache\tomcat-9.0
> so I can minor upgrade several instances at the same time just by changing
> the symlink (services must be stopped first).
>

Sounds like you have a fairly robust procedure already in place, and the
alternative installer may not provide too much benefit.

> 1. Update the timestamps of the config files you don't want the installer
> to overwrite.
>
> Is this necessary when using zip-package?
>

That depends on where you extract the files and if your unzip tool is set
to skip or overwrite newer files when extracting.
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Bill, Hans,

On 7/24/20 09:42, Bill Stewart wrote:
> On Fri, Jul 24, 2020 at 2:26 AM Hans Schou wrote:
>
> "document" manually? Like copy&paste into a text file?
>>
>
> Yes, however you customarily do so.

Note that everything you can configure using tomcatXw.exe //ES/svcname
you can also install from the command-line. So if you need to create a
service from scratch, you just need to make sure you provide all those
values each time you create a new service.

If you find yourself needing to make changes to the system properties,
for example, then instead of editing them directly using //ES/svcname,
you could also put that into a script and re-run the script.

You get (a) documentation of what's necessary and also (b)
reproducibility of creating that service, instead of having to
remember that something specific was in there.

For example, if you need to set -Duser.locale=fr_FR for your service,
then do:

REM
REM Script to install Apache Tomcat service for Foo Tech Ltd.
REM

SET SERVICE_NAME=MyGreatWebapp
SET SERVICE_DESC=My Great Web App
SET HEAP_MIN=1024
SET HEAP_MAX=1024

%CATALINA_HOME%\bin\tomcat9w.exe ^
  "//IS//%SERVICE_NAME%" ^
  --Description "%SERVICE_DESC%" ^
  --JvmMs "%HEAP_MIN%" ^
  --JvmMx "%HEAP_MAX%" ^
  --JvmOptions "-Xrs;-Duser.locale=fr_FR"

I typed that in without any checks to make sure it will work. But you
get the idea.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8a/58ACgkQHPApP6U8
pFhpGw/+Oqv0W+SQbApHWHbr4043U0sJsJewGAUS/et4EnAPDFpzIj/xceqffMwc
6wIWhk65w6oKilP/jDZCzhUbF0Oxzr16/38dzjvYHNdFrC3isLetZEMIXDu6410s
gOH3C1I0GCtQHTUWo9NvVIFRkTJxWc0QpTuLccVvyAjm5mwfhqrhLuaPR+lTSs80
darql64xNR3n79tGgDgr0UCYFuL6upcGxcUH2GuTU9xy2pLi1Y3aLYifNRKz2hp7
tBo0/irqO52ZstMLJvqA7bAduoYR/Hl65WS6TMLT9BW1YYjGsYo5NVRibUR/Ab+R
SYHM/P6+m//dzyp3c3VaBxpeuIPTKrF/b/eO5cuMKiQD0G8Q3OU4tq7WneXPZ730
f008+RbAmuQLiNjso7li6dklEaEhYMNtg9jtP6yADw7RGRc8cB7tH14CDLCxKHpr
rqya8OvZhybLxx2q3ujJbNPTNTjy6/bdIulr5vPFzsclJjpaHbji6wpQiBZ/lZ3r
aAZ78UMvAO33FkmDZKoWIF1KpVuEBJ16wU1eNGFU9SikI1Zcx7GkFTvC5fBkx0qu
6IEpTzb3j6ktLJWqZvF1OSs66coMNjv48PnDX61EvZR19f2WVGIVSIQRDJ+qmNnU
3SFKjwAbEmuH9lX+tfqhRtaaMhDCW5wMoY/E9c+JIywBI+ELlcg=
=u415
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Bill Stewart
On Fri, Jul 24, 2020 at 9:36 AM Christopher Schultz wrote:

Note that everything you can configure using tomcatXw.exe //ES/svcname
> you can also install from the command-line.
>

Correct. See the InstallService PascalScript procedure in the installer
which performs the equivalent:

https://github.com/Bill-Stewart/ApacheTomcatSetup/blob/master/ApacheTomcat.iss

Bill
Reply | Threaded
Open this post in threaded view
|

SV: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Hans Schou
In reply to this post by Christopher Schultz-2
> Fra: Christopher Schultz <[hidden email]>
> Note that everything you can configure using tomcatXw.exe //ES/svcname
> you can also install from the command-line.

Yes I can add and change information, but how can I get the information out so I can use that for an upgrade to a new major version?

To change I run
  tomcat8.exe //US//svcname --JvmOptions "-D...."
I miss a extract command like
  tomcat8.exe //XS//svcname
which will give me the --JvmOptions and others so I can use them from a command line and upgrade to Tomcat9.

Best regards

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Bill Stewart
On Mon, Jul 27, 2020 at 12:22 AM Hans Schou wrote:

Yes I can add and change information, but how can I get the information out
> so I can use that for an upgrade to a new major version?
>

From an elevated command line, run:

tomcat8w.exe "//ES//servicename"

This displays the GUI configuration dialog. From there you can manually
document your settings.
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

All,

On 7/27/20 10:43, Bill Stewart wrote:

> On Mon, Jul 27, 2020 at 12:22 AM Hans Schou wrote:
>
> Yes I can add and change information, but how can I get the
> information out
>> so I can use that for an upgrade to a new major version?
>>
>
> From an elevated command line, run:
>
> tomcat8w.exe "//ES//servicename"
>
> This displays the GUI configuration dialog. From there you can
> manually document your settings.

Seems like it would be kind of awesome to have a feature like //PS//
which would dump-out the service as a .BAT file, like:

C:> tomcat9w.exe //PS//my-service-name

REM ******************************************************
REM * Exported Configuration for Service my-service-name *
REM * Export date: 2020-07-27 11:57:00 EDT               *
REM ******************************************************
REM
REM This script will install the service named my-service-name
REM including all configured settings at the time of export.
REM Edit this script and run it to update the service description
REM for my-service-name.

SET CATALINA_HOME=\path\to\tomcat_home
SET CATALINA_BASE=\path\to\tomcat_base
SET TOMCAT_SERVICE_NAME=my-service-name

%CATALINA_HOME%\bin\tomcat9w.exe "//IS//%TOMCAT_SERVICE_NAME%" ^
  --Jvm [jvm] ^
  --JvmOptions [blah]
  ...

I have absolutely no idea how to do that, since I know absolutely
nothing about the tomcatXw.exe program. But I'll bet someone who DOES
understand it would be able to write that up in a few hours.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8e+rgACgkQHPApP6U8
pFiqKRAAprSehcfxrw+WEqT9wD25dDOixRrBQ1yjsV53hTnthblTsd1v3hLzI0PA
aeXeMDofQKK7D+mv5fAkL7+PXTBwx+z4/jgZrFfsrffArcZWr2MnTcTrU79+7Orm
u9dWJbXHbcw3zxHxkDe7jNGcI1q/N2tg3cIDVqdC96oaCxEJQJCqvc4/CrV/CpLy
OK2sQsRaZBOtNX17vFTLUhfLRj5YqxAOKVhLntPA76JYYbIdWS/0tUzaZasi0Hi9
5RqsLGG4hab2s1MudODp5lTdFjzztW+XncPTOCRnTM9Ya7X0ENbMPNO48ll4htOv
Y/HWjecR8zlbBIaXEq04glUn3j2xdppedQS+VqiZ56kPKEdb/Xi02wwyVBiFNfOB
OqcVgd7P5E4aKk/ydm9fq2OFiR1zBoE6ARj5ONyzz8SNOu6KVIo8X5OuqGbHI3Hf
DWiXPmB68jCnpObqnom+ksMYq81/KjmjIyaXXtrW6pyrBn63a+GbcPovvFlbz0J/
tLPYngN5OTWEB0h6q5k789rpTY9C1l7F7OgeJqXLR1PBRdYi6ZYlMPrPXrFeeBIB
Hzqsm/y2nNwarglaRDzsSflPah7yy7vArInJI1tAs9lzYTnzUgtRSb64A8auRJoh
+FHTlr7+8TadaYwBN9VERhkYp9zJ4BnwICfJLyHb6cknMv9duGY=
=+kY+
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

SV: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Hans Schou


> Fra: Christopher Schultz <[hidden email]>

> Seems like it would be kind of awesome to have a feature like //PS// which would dump-out the service as a .BAT file, like:

>  C:> tomcat9w.exe //PS//my-service-name

Yes, that would be great.
And with JAVA_HOME also.

Right now I have solved my upgrade task with a script which can only upgrade from Tomcat 8.5 to 9.0
As I can not see from command line which tomcat are being used, I had to look that up first.
Then I also have to check if the instance is running Java 8 or Java 11.
I run tomcat8w.exe to get and set Java options and memory usage.

Here is the script:

IF [%1] == [] (
        ECHO Error
        EXIT /B
)
SET INSTANCE=%1
SET JAVA_HOME=D:\Java\jdk1.8
rem SET JAVA_HOME=D:\Java\jdk11
SET CATALINA_HOME=D:\Apache\tomcat-8.5
SET CATALINA_BASE=D:\tomcat\%INSTANCE%
%CATALINA_HOME%\bin\tomcat8w.exe //ES//%INSTANCE%
PAUSE
"C:\Program Files (x86)\Notepad++\notepad++.exe" %CATALINA_BASE%\conf\server.xml
PAUSE
NET STOP %INSTANCE%
CALL %CATALINA_HOME%\bin\service remove %INSTANCE%
SET CATALINA_HOME=D:\Apache\tomcat-9.0
CALL %CATALINA_HOME%\bin\service install %INSTANCE%
%CATALINA_HOME%\bin\tomcat9.exe //US//%INSTANCE% ^
 --Startup auto ^
 --DisplayName "Apache Tomcat 9.0 %INSTANCE%" ^
 --Description "Tomcat 9.0 %CATALINA_BASE% %CATALINA_HOME%"
PAUSE
NET START %INSTANCE%
%CATALINA_HOME%\bin\tomcat9w.exe //ES//%INSTANCE%

Best regards


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Igal Sapir
Hans,

On Tue, Jul 28, 2020 at 5:51 AM Hans Schou <[hidden email]> wrote:

>
>
> > Fra: Christopher Schultz <[hidden email]>
>
> > Seems like it would be kind of awesome to have a feature like //PS//
> which would dump-out the service as a .BAT file, like:
>
> >  C:> tomcat9w.exe //PS//my-service-name
>
> Yes, that would be great.
> And with JAVA_HOME also.
>
> Right now I have solved my upgrade task with a script which can only
> upgrade from Tomcat 8.5 to 9.0
> As I can not see from command line which tomcat are being used, I had to
> look that up first.
> Then I also have to check if the instance is running Java 8 or Java 11.
> I run tomcat8w.exe to get and set Java options and memory usage.
>
> Here is the script:
>
> IF [%1] == [] (
>         ECHO Error
>         EXIT /B
> )
> SET INSTANCE=%1
> SET JAVA_HOME=D:\Java\jdk1.8
> rem SET JAVA_HOME=D:\Java\jdk11
> SET CATALINA_HOME=D:\Apache\tomcat-8.5
> SET CATALINA_BASE=D:\tomcat\%INSTANCE%
> %CATALINA_HOME%\bin\tomcat8w.exe //ES//%INSTANCE%
> PAUSE
> "C:\Program Files (x86)\Notepad++\notepad++.exe"
> %CATALINA_BASE%\conf\server.xml
> PAUSE
> NET STOP %INSTANCE%
> CALL %CATALINA_HOME%\bin\service remove %INSTANCE%
> SET CATALINA_HOME=D:\Apache\tomcat-9.0
> CALL %CATALINA_HOME%\bin\service install %INSTANCE%
> %CATALINA_HOME%\bin\tomcat9.exe //US//%INSTANCE% ^
>  --Startup auto ^
>  --DisplayName "Apache Tomcat 9.0 %INSTANCE%" ^
>  --Description "Tomcat 9.0 %CATALINA_BASE% %CATALINA_HOME%"
> PAUSE
> NET START %INSTANCE%
> %CATALINA_HOME%\bin\tomcat9w.exe //ES//%INSTANCE%
>
>
You should be able to set the Java Options with service.bat.  There is an
Environment variable called JvmArgs [1] which is appended to JvmOptions and
allows you to add different Java Options, e.g. set it like so before
calling `service.bat install`:

    set "JvmArgs=-Dsome.property=SomeValue;-XX:+HeapDumpOnOutOfMemoryError"

For the heap size set the JvmMs and JvmMx environment variables.

Igal

[1] https://github.com/apache/tomcat/blob/master/bin/service.bat#L228



> Best regards
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
Reply | Threaded
Open this post in threaded view
|

Re: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

markt
In reply to this post by Christopher Schultz-2
On July 27, 2020 4:03:04 PM UTC, Christopher Schultz <[hidden email]> wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA256
>
>All,
>
>On 7/27/20 10:43, Bill Stewart wrote:
>> On Mon, Jul 27, 2020 at 12:22 AM Hans Schou wrote:
>>
>> Yes I can add and change information, but how can I get the
>> information out
>>> so I can use that for an upgrade to a new major version?
>>>
>>
>> From an elevated command line, run:
>>
>> tomcat8w.exe "//ES//servicename"
>>
>> This displays the GUI configuration dialog. From there you can
>> manually document your settings.
>
>Seems like it would be kind of awesome to have a feature like //PS//
>which would dump-out the service as a .BAT file, like:
>
>C:> tomcat9w.exe //PS//my-service-name
>
>REM ******************************************************
>REM * Exported Configuration for Service my-service-name *
>REM * Export date: 2020-07-27 11:57:00 EDT               *
>REM ******************************************************
>REM
>REM This script will install the service named my-service-name
>REM including all configured settings at the time of export.
>REM Edit this script and run it to update the service description
>REM for my-service-name.
>
>SET CATALINA_HOME=\path\to\tomcat_home
>SET CATALINA_BASE=\path\to\tomcat_base
>SET TOMCAT_SERVICE_NAME=my-service-name
>
>%CATALINA_HOME%\bin\tomcat9w.exe "//IS//%TOMCAT_SERVICE_NAME%" ^
>  --Jvm [jvm] ^
>  --JvmOptions [blah]
>  ...
>
>I have absolutely no idea how to do that, since I know absolutely
>nothing about the tomcatXw.exe program. But I'll bet someone who DOES
>understand it would be able to write that up in a few hours.
>
>- -chris
>-----BEGIN PGP SIGNATURE-----
>Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
>iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8e+rgACgkQHPApP6U8
>pFiqKRAAprSehcfxrw+WEqT9wD25dDOixRrBQ1yjsV53hTnthblTsd1v3hLzI0PA
>aeXeMDofQKK7D+mv5fAkL7+PXTBwx+z4/jgZrFfsrffArcZWr2MnTcTrU79+7Orm
>u9dWJbXHbcw3zxHxkDe7jNGcI1q/N2tg3cIDVqdC96oaCxEJQJCqvc4/CrV/CpLy
>OK2sQsRaZBOtNX17vFTLUhfLRj5YqxAOKVhLntPA76JYYbIdWS/0tUzaZasi0Hi9
>5RqsLGG4hab2s1MudODp5lTdFjzztW+XncPTOCRnTM9Ya7X0ENbMPNO48ll4htOv
>Y/HWjecR8zlbBIaXEq04glUn3j2xdppedQS+VqiZ56kPKEdb/Xi02wwyVBiFNfOB
>OqcVgd7P5E4aKk/ydm9fq2OFiR1zBoE6ARj5ONyzz8SNOu6KVIo8X5OuqGbHI3Hf
>DWiXPmB68jCnpObqnom+ksMYq81/KjmjIyaXXtrW6pyrBn63a+GbcPovvFlbz0J/
>tLPYngN5OTWEB0h6q5k789rpTY9C1l7F7OgeJqXLR1PBRdYi6ZYlMPrPXrFeeBIB
>Hzqsm/y2nNwarglaRDzsSflPah7yy7vArInJI1tAs9lzYTnzUgtRSb64A8auRJoh
>+FHTlr7+8TadaYwBN9VERhkYp9zJ4BnwICfJLyHb6cknMv9duGY=
>=+kY+
>-----END PGP SIGNATURE-----
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]

Enhancement requests for this should go to Commons Daemon. Should be simple enough just to dump current config.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

All,

On 8/2/20 12:00, Mark Thomas wrote:
> On July 27, 2020 4:03:04 PM UTC, Christopher Schultz
<[hidden email]> wrote:

> All,
>
> On 7/27/20 10:43, Bill Stewart wrote:
>>>> On Mon, Jul 27, 2020 at 12:22 AM Hans Schou wrote:
>>>>
>>>> Yes I can add and change information, but how can I get the
>>>> information out
>>>>> so I can use that for an upgrade to a new major version?
>>>>>
>>>>
>>>> From an elevated command line, run:
>>>>
>>>> tomcat8w.exe "//ES//servicename"
>>>>
>>>> This displays the GUI configuration dialog. From there you
>>>> can manually document your settings.
>
> Seems like it would be kind of awesome to have a feature like
> //PS// which would dump-out the service as a .BAT file, like:
>
> C:> tomcat9w.exe //PS//my-service-name
>
> REM ****************************************************** REM *
> Exported Configuration for Service my-service-name * REM * Export
> date: 2020-07-27 11:57:00 EDT               * REM
> ****************************************************** REM REM This
> script will install the service named my-service-name REM including
> all configured settings at the time of export. REM Edit this script
> and run it to update the service description REM for
> my-service-name.
>
> SET CATALINA_HOME=\path\to\tomcat_home SET
> CATALINA_BASE=\path\to\tomcat_base SET
> TOMCAT_SERVICE_NAME=my-service-name
>
> %CATALINA_HOME%\bin\tomcat9w.exe "//IS//%TOMCAT_SERVICE_NAME%" ^
> --Jvm [jvm] ^ --JvmOptions [blah] ...
>
> I have absolutely no idea how to do that, since I know absolutely
> nothing about the tomcatXw.exe program. But I'll bet someone who
> DOES understand it would be able to write that up in a few hours.
>
> -chris
>>
>> ---------------------------------------------------------------------
>>
>>
To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>
> Enhancement requests for this should go to Commons Daemon. Should
> be simple enough just to dump current config.

Done.

https://issues.apache.org/jira/browse/DAEMON-422

Thanks,
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8pZuAACgkQHPApP6U8
pFhGrw/7BrR3Ot4DytZ3meJcjjM4Q0YEm9M8FX2SwMtBgtvXFHwWE2x8LIE275TF
wmWmGo5AXJO49NU68AdEolmZKSWiifH7QQvi4vnDHY+DwjeoF54ibkZLL0HwzvJ5
fGP6vr9Ayh+wz6nnKc/F388jaFy3FJ8N4StWGLxbPtJJMVPdF4MjKxukAIfiO1e3
njrLNa8MuUGTy/uPNcaWYsG6vBp4S8F+SE6LmJbYKebXzK5kj3Jk+FWPtGXYMI/O
w+vFKuZggr/zPNhNRKT9DWt8a9x2fBOQdH+eTRH0gIE380XeAivbeUbRCBq7MyxH
HbELHS8W9mf1V+xkvqHLAxjtkvWso9moBTa6CGiGhjx+ej/XRqlE0GBZD1K8cv0z
5GaW6icjmwkOSEnjZDEMkzHLJsXMFNheN1/DqyY2dp2ZY4QOjmvWFsh+ql2xhNyh
+cVujHUhc5u9lP/8l//0JZkB5lAm49yQsXoj7WjxcgYbBb/2/TkT9Gh3kaJaBVQ/
X4dgtPXWjB/IXbdLrdU+tnfzzxx7TXOaZeG2w5Z6nBlqwz0mt9XhjLsFi+tDQgbS
RYrXL7+I/XcDPDk3T0OF+7FzPbJ4uYPYju9vE2InAsC08XfzOtQZbThSKPwxcbjZ
ykW3WBE3RzaAjUfojOnNBWFdwLWinsY+VyH5oY7YVHDPDcQ0PW4=
=1no6
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Bill Stewart
On Tue, Aug 4, 2020 at 7:47 AM Christopher Schultz wrote:

Done.
>
> https://issues.apache.org/jira/browse/DAEMON-422
>

I like this idea as an enhancement to procrun.

I would also point out, for anyone interested, that my alternate installer
supports upgrading without needing to document the settings: It
automatically stops the service, updates the files, and restarts the
service (preserving all configuration details).

https://github.com/Bill-Stewart/ApacheTomcatSetup

Bill
Reply | Threaded
Open this post in threaded view
|

Re: [OT Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Bill,

(Marking OT because this isn't about tomcatXw.exe anymore)

On 8/4/20 10:48, Bill Stewart wrote:

> On Tue, Aug 4, 2020 at 7:47 AM Christopher Schultz wrote:
>
> Done.
>>
>> https://issues.apache.org/jira/browse/DAEMON-422
>>
>
> I like this idea as an enhancement to procrun.
>
> I would also point out, for anyone interested, that my alternate
> installer supports upgrading without needing to document the
> settings: It automatically stops the service, updates the files,
> and restarts the service (preserving all configuration details).

So how do you switch Java versions?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8pwnoACgkQHPApP6U8
pFghwg//Q3BKxB+8OeWCwwEfevRYNgbuI8OzgU6uYWmbysux8DpNZscrMHY4dbOk
fOCxJFXsPvqMEldlqChcOJObUESCtUnvgdwKlLeGzEgDWNT7RXXsCMt414UGNqCn
pp6EgYwdwj4jqQ+yUcsUFCdrBfHG2HXonI+jsgNhImdvHQcpEYmpFY6Li6atFXzT
yA4vE1mxBy+h18ShSi6Z4k5XfOQgISqEeMA3GSZz/sME8i7vWFtBtUpxrTQq0LA/
9OxEQaLTn+rGXB+nngBIkJkTqebeEpiyvL6sziUzX2saByFYpU5u/u+5gfUxHp7B
TieU+DDJSb8kIcqG4cXsqMoVzsdjCuc2NWak6zEC+lYQHgk8mLkmSLS2DNyu81uh
H3PKLyKq9Ibxf/dJVlev5kqKrjivTaX79BzcnvYlfxt3U0SM7LyCWANj6ezzYnMY
Uv2mmmCHCZL1vnawXJH3fQI8l5M0PjtubKH00sIhhhNVZIvQNGAcJlD6TT34m/5K
L3qzzHRmir/NAcb11JD+qribkEoBXExbsjAzieNPyBH2XDBWuWrpCl7O0pZYWLjN
IsOvo4WlU8yl7e2MrIUyG/btwzPVOA+gRKnz329oo7bqHtRzppkbe7N8kI/F/xM+
GYsMtBFj5ZoqQxgJ4vJYiGmEY7Lbd8KIuAadGPMAEB76XADa1e8=
=w+Y0
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [OT Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Bill Stewart
On Tue, Aug 4, 2020 at 2:18 PM Christopher Schultz wrote:

So how do you switch Java versions?
>

What do you mean? 1. Point an existing Tomcat instance to a different Java
runtime, or 2. Upgrade an existing instance of Java?

For 1:

Use the procrun GUI and change the path to the jvm.dll file. Naturally you
would need to restart Tomcat instance.

For 2:

My alternative installer is for upgrading Tomcat, not the Java instance. To
do that, you would need to:

a. Stop the Tomcat instance
b. Upgrade/install the Java you want
c. (If path to jvm.dll changed) Use the procrun GUI to change the path to
the jvm.dll file
d. Start the Tomcat instance

Bill
Reply | Threaded
Open this post in threaded view
|

Re: [OT Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Bill,

On 8/4/20 17:06, Bill Stewart wrote:

> On Tue, Aug 4, 2020 at 2:18 PM Christopher Schultz wrote:
>
> So how do you switch Java versions?
>>
>
> What do you mean? 1. Point an existing Tomcat instance to a
> different Java runtime, or 2. Upgrade an existing instance of
> Java?
>
> For 1:
>
> Use the procrun GUI and change the path to the jvm.dll file.
> Naturally you would need to restart Tomcat instance.
>
> For 2:
>
> My alternative installer is for upgrading Tomcat, not the Java
> instance. To do that, you would need to:
>
> a. Stop the Tomcat instance b. Upgrade/install the Java you want c.
> (If path to jvm.dll changed) Use the procrun GUI to change the path
> to the jvm.dll file d. Start the Tomcat instance

Okay, so you edit the service directly; same as with Tomcat's provided
tools.

> [My alternative installer] automatically stops the service,
> updates the files, and restarts the service (preserving all
> configuration details).
Does this support multiple side-by-side Tomcat-based services?

I have a client who runs our product on Windows (we usually run it on
Linux) and there are 2-4 separate Tomcat-based services on each node,
so they have "Tomcat 8.5.x for FOO", "Tomcat 8.5.x for BAR", etc. in
their service descriptions. Can they use your installer to upgrade
just one of those with a new Tomcat version?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8p2qwACgkQHPApP6U8
pFizrBAAxlI/lvrLg97BolT1t15kn3tCs2UCYnK1grl1tCrh+6ufhpMHmOVleggr
VBAZrXIV3b9i96GrB7Gi+XHgJ9iSS0I2/AAnghe6Qb9aHEiAnNKjWv+WhFzTTp67
I9v2sS50QEjX3AEUqN/3fH3+AG+ZMFhkChKalWW22Lm/TJUBqXyeNsApbzaKRAwG
cx30a/t6NPgVXzh4xRx3Bk1JIPA23kjXG40gdLnQg3Lchd2Nx3Hjqlk2C2ZGtNlq
ejrnYyj5Kz2715MAWQBJRo/UxEx2SfpEI/KWuwgh5KFCURFyM4gfYCGGaEqIlErx
dMpeZ2e2krLg7kTz3mbly7BwBa1WG2XqeHGPCV4XjDKqy2MkMgQjbbjZHal1PyBE
FpkX4VKnfEWwbSO/89mgsVwxwrVLnKvZrLI57QI0DvtT6ssB5dyVlTGP7XY4bHCo
s6beEsgnSmtJxm8j9j/vrH1zkD1fCUzjH8bOxNB098XhsDK/DZKs0q5IDycaTI0v
z6FauOTVoVk0Z8SB0j6FK9VMGKoquI9/JInFh2NozBX0M9fSL9hOYrulhQpAEMw9
HbMfno2cPAnwXYraA/N/G1xEITV2jX7xtNP0UlZNgQGBMHku27xe+eHT4uEGZVrP
1T0EoPlmm++y3tLRwLTIZ13r/6fMnvNZCNpjNvF8apuCkJfj5aQ=
=dw1h
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [OT Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Bill Stewart
On Tue, Aug 4, 2020 at 4:01 PM Christopher Schultz wrote:

I have a client who runs our product on Windows (we usually run it on
> Linux) and there are 2-4 separate Tomcat-based services on each node,
> so they have "Tomcat 8.5.x for FOO", "Tomcat 8.5.x for BAR", etc. in
> their service descriptions. Can they use your installer to upgrade
> just one of those with a new Tomcat version?
>

The alternative installer can only upgrade Tomcat instances it installs.
(It can't upgrade instances installed using Apache's installer or manual
installations; it doesn't know about those.)

The process in your case would be something like this:

1. Document the Tomcat service installation details for the instance you
want to replace and back up its config files.

2. Remove it (reverse whatever process you used to install, whether Apache
installer, manual, etc.).

3. Install using alternate installer; e.g.:

apache-tomcat-a.b.c-setup.exe /instance="FOO"

4. Update the config files, copy application server files, etc.

See the documentation - https://github.com/Bill-Stewart/ApacheTomcatSetup -
for details. (Without /instance it installs a default instance - i.e.,
default directory of "\Program Files\Apache Tomcat", "Apache Tomcat" as the
service name, etc.)

To upgrade (in general):

1. Touch (update timestamps of) config files you don't want the installer
to overwrite.

2. Run the above install commands with the new version of the installer.
Don't forget the /instance parameter if you used it to install initially
(otherwise, the installer will install or upgrade the default instance).

Note that each instance installed using the alternate installer (default or
otherwise) installs to a separate directory and appears as a separate entry
in the Windows "installed application" list. (This is typically the
expected behavior for application installations on Windows machines.)

I certainly don't claim that the alternative installer is suitable for all
applications and configurations, but for fairly common use cases on Windows
machines, the two-step upgrade process noted above (I think) is pretty
simple.

Bill
Reply | Threaded
Open this post in threaded view
|

Re: [OT Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Bill,

On 8/4/20 18:59, Bill Stewart wrote:

> On Tue, Aug 4, 2020 at 4:01 PM Christopher Schultz wrote:
>
> I have a client who runs our product on Windows (we usually run it
> on
>> Linux) and there are 2-4 separate Tomcat-based services on each
>> node, so they have "Tomcat 8.5.x for FOO", "Tomcat 8.5.x for
>> BAR", etc. in their service descriptions. Can they use your
>> installer to upgrade just one of those with a new Tomcat
>> version?
>>
>
> The alternative installer can only upgrade Tomcat instances it
> installs. (It can't upgrade instances installed using Apache's
> installer or manual installations; it doesn't know about those.)
>
> The process in your case would be something like this:
>
> 1. Document the Tomcat service installation details for the
> instance you want to replace and back up its config files.
>
> 2. Remove it (reverse whatever process you used to install, whether
> Apache installer, manual, etc.).

Oh, I wasn't expecting to be able to upgrade the official Tomcat
installer's services. But this is good information for anyone to have.

> 3. Install using alternate installer; e.g.:
>
> apache-tomcat-a.b.c-setup.exe /instance="FOO"
>
> 4. Update the config files, copy application server files, etc.
>
> See the documentation -
> https://github.com/Bill-Stewart/ApacheTomcatSetup - for details.
> (Without /instance it installs a default instance - i.e., default
> directory of "\Program Files\Apache Tomcat", "Apache Tomcat" as
> the service name, etc.)
>
> To upgrade (in general):
>
> 1. Touch (update timestamps of) config files you don't want the
> installer to overwrite.
>
> 2. Run the above install commands with the new version of the
> installer. Don't forget the /instance parameter if you used it to
> install initially (otherwise, the installer will install or upgrade
> the default instance).
>
> Note that each instance installed using the alternate installer
> (default or otherwise) installs to a separate directory and appears
> as a separate entry in the Windows "installed application" list.
> (This is typically the expected behavior for application
> installations on Windows machines.)

Yes, this is exactly what I'd expect.

> I certainly don't claim that the alternative installer is suitable
> for all applications and configurations, but for fairly common use
> cases on Windows machines, the two-step upgrade process noted above
> (I think) is pretty simple.

Definitely. I remember having to upgrade these for my client once and
it was a PITA. We really only do it each time we upgrade Tomcat to a
new major version (when we went from 8.0 -> 8.5). It was a pain
because of all the copy/pasting which would definitely be solved
either with your installer or with a new "dump config to script"
feature on Tomcat's installer.

I don't know if you are interested in such things, but being table to
export a configuration from one machine to another might be useful for
your installer, too. Something like "deploy to server A,
manually-configure, tweak, test, prove" and then "copy deployment
configuration to servers B - Z".

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8sHQ8ACgkQHPApP6U8
pFiEOQ//a4q36Z4zt61C3rgmrXrPTTHfPKi+z+4s5EKvnHGx76kOCM8BugetuDA9
AAsOdU28uOqdsi2t2oLbnEluu3Xy7StS7vakIksH38Vanuhwu1vkTK6hwweeU+fW
JHbG7tIt3AllX8PDqFwE0LXgDOeJ8pRAI6Y2fJUDaPXM7KgmxpifeP0cFxt0N9Qx
/ZH7/VWLs/PbkB/mCZSd8OgFpal7fcDocQfvisOnu/6wGQrYU1z9p56xjaOBLDpc
jSMRCRQUtsSbsWOKmm+SVx15RU5QK0z7S5bzjcPI/Kce6mdOM3hqQUuqM2xcoKwg
lP3M+SvDt1kjtLFp/FEgr1hm6kPDOf2Jb0mV1Zq+2LNaCX1cowAYA2NFdDb7fX/o
XW8zEztINlj9RJZpas15lxameUdjSf5GUWqOqtm9vwj6BIEq55FDBbGMKrSRbP2Q
7GiYI4amHzZgr36hF87UnW65fW+p1eMq03b7dI5mrydcYYGGPUPLzfPv/Ho/EZuR
I1nwYWRzZ9RaiP4QPOthewSiFlDlE21l1zZBqQxNUxWh50BvItzJ1NhGlVQPHoKh
H9AV0+k+BrRLAejHGoG8b04pFI7XHo12LIj6joA+6MUBmioIzy43rKerx1zbojA/
gTN0UD5QR8CqhhelDpOIfpaBnGhzoE93agRMcRFeD2wSrh7OxoM=
=WvXy
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [OT Upgrade: tomcat8w.exe //ES//example - dump Java Options and other information to tomcat9

Bill Stewart
On Thu, Aug 6, 2020 at 9:09 AM Christopher Schultz wrote:

I don't know if you are interested in such things, but being table to
> export a configuration from one machine to another might be useful for
> your installer, too. Something like "deploy to server A,
> manually-configure, tweak, test, prove" and then "copy deployment
> configuration to servers B - Z".
>

The alternative installer doesn't export a configuration, but it does let
you repeat an installation using command-line options to get a similar
effect; e.g.:

apache-tomcat-a.b.c-setup.exe /type=core /serviceusername="domain\account"
/jvmoptions="-Djavax.net.ssl.trustStoreType=WINDOWS-ROOT" /jvmms=2048
/jvmmx=2048 /silent /log="c:\windows\temp\tomcatinstall.log"

(all on one line of course)

For reference:

 /type="core" - installs only the core components (no docs, Manager, Host
Manager, or examples web apps)

/serviceusername="domain\account" - runs the service using the specified
account (and also, by default permissions are set on the install
directories to allow this account to write to the logs, temp, and work
directories)

/jvmoptions="-Djavax.net.ssl.trustStoreType=WINDOWS-ROOT" - tells the Java
instance running Tomcat to trust the Windows certificate store

/jvmms=2048 /jvmmx=2048 - sets the Java memory pool sizes for the service

/silent - hands-free installation

/log="c:\windows\temp\tomcatinstall.log" - logs to the specified file

See the documentation - https://github.com/Bill-Stewart/ApacheTomcatSetup -
for further information.

Bill
12