Payara Server Upgrade Tool
The Upgrade tool doesn’t support migrating from Payara Server Enterprise 5.x installations to 6.x or from Payara Server Enterprise 6.x to newer minor releases Both upgrade paths will be implemented on a future release of the tool. |
This tool can be used to upgrade an existing Payara Server installation to a newer version. The Upgrade Tool is bundled in Payara Server by default and is maintained as a separate JAR artifact under the fish.payara.extras:payara-upgrade-tool
GAV coordinates.
The upgrade tool can be manually upgraded to a newer version in case it is needed. To do so, download the latest JAR release from Nexus using this link and then replace the older version into your Payara Server installation under the ${PAYARA_SERVER_INSTALL}/glassfish/lib/asadmin folder.
|
Asadmin CLI Commands
The following are the Asadmin CLI commands available to the upgrade tool.
Upgrade Server Command
- Usage
-
asadmin> upgrade-server
- Aim
-
This command can be used to upgrade Payara Server to the specified distribution along with all SSH nodes in the
domain.xml
configuration file.
The command will also back up the old version and domains in the default location (payara5/glassfish/domains
) or the location specified using the --domaindir
option to allow for rolling back.
Command Options
Option | Type | Description | Default | Mandatory |
---|---|---|---|---|
|
String |
The username for the Payara Nexus server. |
Yes, unless |
|
|
String |
Specifies the version number of the new version of Payara to use. |
Yes, unless |
|
|
Enum |
Specifies the distribution of Payara Server to download. This can payara, payara-web, payara-ml, or payara-web-ml. |
payara |
No |
|
Boolean |
Determines if the upgrade should be installed in-place, or staged into "x.new" directories. Scripts are provided that can be used to apply and rollback the staged install. This option is automatically enabled when running the command on Windows. |
False on Unix, True on Windows |
No |
|
String |
The directory containing the domains. The domains in this directory are backed up, and their config is used to determine the nodes which will also be upgraded. |
|
No |
|
String |
The path to the local Payara Server zip archive to use for upgrading instead of downloading from the Payara Enterprise repository. When this parameter is specified, the |
No |
Rollback Server Command
- Usage
-
asadmin> rollback-server
- Aim
-
This command can be used to rollback Payara Server to the point before the upgrade-server command was run, restoring the most recent backup of the domain (expected to be the backup created during execution of the
upgrade-server
command).
This command is not supported on Windows OS, please use the rollbackUpgrade.bat script instead.
|
Staged Upgrades
When the upgrade-server
command is either used on Windows or with the --stage
option enabled, the new server files are installed next to the current installation in various .new directories (e.g. payara5/glassfish/bin.new
). The following helper scripts are available to interact with staged upgrades.
Apply Staged Upgrade Script
- Usage
-
> ./payara5/glassfish/bin/applyStagedUpgrade
- Aim
-
This script is used to apply an upgrade staged using the
upgrade-server
command. It will move the current installation into .old directories, and the staged .new installation into the expected "current" location. It will then upgrade the nodes of the domains in the default domain dir, or the domains in the directory provided using--domaindir
Rollback Upgrade Script
- Usage
-
> ./payara5/glassfish/bin/rollbackUpgrade
- Aim
-
This script is used to rollback a server upgrade applied using the
applyStagedUpgrade
script. It will move the .old installation back into the expected "current" location, and the applied upgrade back into .new directories. It will then rollback the nodes of the domains in the default domain dir, or the domains in the directory provided using--domaindir
Cleanup Upgrade Script
- Usage
-
> ./payara5/glassfish/bin/cleanupUpgrade
- Aim
-
This script is used to clean up any leftovers from a staged upgrade: any .old folders and any .new folders will be deleted.
Use of this script will prevent you from rolling back or applying a staged upgrade. |
This script cannot be used to clean up upgrades from releases prior to 5.26.0 , as it uses a config file to determine the directories to delete which is only generated by the upgrade-server command from release 5.26.0 onwards.
|
Configure Logging Levels
The upgrade tool commands and helper scripts will print a set of minimum details of the operations executed (upgrade, staging, rollback). For troubleshooting scenarios, or if wanting to review in detail all executed actions, the following 2 environment variables are available to control the level of logging done by the Upgrade tool:
AS_DEBUG
-
Set to
true
to configure the Upgrade Tool’s logging level toFINER
. AS_TRACE
-
Set to
true
to configure the Upgrade Tool’s logging level toFINESET
.
These variables can also be configured as system properties in the Asadmin CLI script file located in the {as-install}/bin
folder like this:
AS_INSTALL=`dirname "$0"`/../glassfish
AS_INSTALL_LIB="$AS_INSTALL/lib"
. "${AS_INSTALL}/config/asenv.conf"
JAVA=java
#Depends upon Java from ../config/asenv.conf
if [ ${AS_JAVA} ]; then
JAVA=${AS_JAVA}/bin/java
fi
exec "$JAVA" -DAS_DEBUG=true -XX:+IgnoreUnrecognizedVMOptions -jar "$AS_INSTALL_LIB/client/appserver-cli.jar" "$@"
Remember to turn off these logger level settings after executing a server upgrade, as this setting will affect all future executions of any Asadmin CLI commands, which will cause them to print out more information than usual. |