Upgrading Payara Server

There are two valid methods of fully upgrading to a new release of Payara Server Enterprise. Either of the following two methods would work in most circumstances:

  1. Backing up and restoring the existing configuration to a new installation.

  2. Maintaining completely separate domain and node directories and pointing the new version to the existing directories.

Method 1: Backup and Restore

This method involves the following steps:

  1. Stop the running domain

    The asadmin backup-domain subcommand will only work if the domain is not running so, if this method is chosen for a production system, there would need to be an arranged period of downtime.
  2. Run asadmin backup-domain from the existing Payara Server Enterprise installation

  3. Once the domain has been backed up, restore the domain to the newly downloaded Payara Server Enterprise installation by running asadmin restore-domain from the bin directory of the new Payara Server Enterprise installation

After following these steps, you should be left with a similar directory structure to the following:


This method only backs up the domain directory and its contents. Any instances you have in node directories will need to regenerated by using the --sync=full option of the start-local-instance subcommand:

asadmin start-local-instance --sync=full myInstance

This will recreate the instance from scratch. Be aware, though, that this will not recreate things stored in the instance directory which are outside of the configuration like JMS file stores. If there is any JMS persistence which does not use a database, these must be handled manually.

See Restore a Payara Domain for more detail.

Method 2: Move the domain directory and node directories

An alternative to backing up and restoring the domain, then recreating the instances, would be to create the domain and node directories in a location separate to the installation. For example, if you download Payara Server, created a domain, and then wanted to use Payara Server, you would use the following process:

/opt/payara/payara-4.1.154/payara41 bin/asadmin create-domain --domaindir /tmp myTempDomain
/opt/payara/payara-4.1.154/payara41 cd ../../payara-4.1.162/payara41
/opt/payara/payara-4.1.162/payara41 bin/asadmin start-domain --domaindir /tmp myTempDomain

This will use the installation to create a new domain, and then run it with the installation.

You can do the same thing with nodes too:

/opt/payara/payara-4.1.154/payara41 bin/asadmin create-node --nodedir /tmp myLocalNode

In this way, the user configuration is always kept separate to the installation, and rollback is as simple as using the previous installation directory.

If you are using Payara Server Enterprise on Linux, you could take advantage of "symbolic links" to make life easier. When your domain directory is in a non-standard location, it means that you need to specify its location with each start/stop/restart command. If you were to create a symbolic link to the domain directory inside the default domains directory, then all of your existing scripts will carry on as normal.

You could even extend this further to create a symbolic link to whichever Payara Server installation was currently used in production, for example:


This means that any rollback is as simple as stopping the server, updating a symbolic link and starting it again.

Without the use of symbolic links, things get a bit more manual (though still quite straightforward). The asadmin start-domain subcommand has a --domaindir option which allows you to specify the location of a domain directory. So you could have a directory structure like this:


Then you could start your domain with whatever version of Payara Server you wanted:

/opt/payara/154/payara41/bin/asadmin start-domain --domaindir /opt/payara/domains myDomain

…​or like this:

/opt/payara/162/payara41/bin/asadmin start-domain --domaindir /opt/payara/domains myDomain
The --domaindir option specifies the parent directory for your domain and where you would store all of your domains if needed.

You can also start nodes in the same way:

/opt/payara/162/payara41/bin/asadmin start-local-instance --nodedir /opt/payara/nodes myLocalNode

JDK 11: Upgrade considerations

From Payara Server 5.192 onwards domain.xml contains instructions for handling JDK 11. Without these instructions, Payara will not start up on JDK 11 and/or will throw many exceptions during runtime.

If older, pre-5.192, domains are being migrated this has to be taken into account. The following jvm-options have to be added to the java-config element in domain.xml:


The following jvm-options have to be removed:


Note that in Payara 5.192 support for JDK 11 is limited to a technical preview.