Domain and Node Directories Upgrade Method

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 5.2021.10, created a domain, and then wanted to use Payara Server 5.2022.2, you would use the following process:

/opt/payara/payara-5.2021.10/payara5 bin/asadmin create-domain --domaindir /tmp myTempDomain
/opt/payara/payara-5.2021.10/payara5 cd ../../payara-5.2021.10/payara5
/opt/payara/payara-5.2022.2/payara5 bin/asadmin start-domain --domaindir /tmp myTempDomain

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

Nodes can also be created in a separate directory by using the --nodedir property when creating a node.

/opt/payara/payara-5.2021.10/payara5 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 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.

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

If you choose not to use symbolic links, 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 the following:

/opt/payara/5.2021.10/payara5/...
/opt/payara/5.2022.1/payara5/...
/opt/payara/5.2022.2/payara5/....
/opt/payara/domains/myDomain
/opt/payara/nodes/myLocalNode

Then you could start your domain with whatever version of Payara Server you wanted by running the tart-domain command from the corresponding Payara installation directory.

/opt/payara/5.2021.10/payara5/bin/asadmin start-domain --domaindir /opt/payara/domains myDomain
/opt/payara/5.2022.1/payara5/bin/asadmin start-domain --domaindir /opt/payara/domains myDomain
/opt/payara/5.2022.2/payara5/bin/asadmin start-domain --domaindir /opt/payara/domains myDomain

Just as you can create nodes by using the --domaindir property, you can also start nodes in the same way.

/opt/payara/5.2021.10/payara5/bin/asadmin start-local-instance --nodedir /opt/payara/nodes myLocalNode
/opt/payara/5.2022.1/payara5/bin/asadmin start-local-instance --nodedir /opt/payara/nodes myLocalNode
/opt/payara/5.2022.2/payara5/bin/asadmin start-local-instance --nodedir /opt/payara/nodes myLocalNode