Search code examples
upgradepayara

Payara 4 to 5 upgrade via export/import failing


I'm attempting to upgrade a Payara 4 instance to Payara 5 on Debian via the recommended method in the Payara Server 4 to 5 Migration Guide , specifically exporting the domain out from the Payara 4 one and then importing it again, using the following commands:

cd /opt/payara41/bin
sudo ./asadmin backup-domain --backupDir /opt/backups domain1

cd /opt/payara5/bin
sudo ./asadmin delete-domain domain1
sudo ./asadmin restore-domain --filename /opt/backups/domain1/domain1_2022_04_06_v00001.zip --long domain1

The import reports it completed successfully:

Restored the domain (domain1) to /opt/payara5/glassfish/domains/domain1
Description               : domain1 backup created on 2022_04_06 by user root
GlassFish Version         : Payara Server  4.1.2.172 #badassfish (build 235)
Backup User               : root
Domain Name               : domain1
Backup Type               : full
Backup Config Name        :
Backup Filename (origin)  : /opt/backups/domain1/domain1_2022_04_06_v00001.zip
Domain Directory          : /opt/payara41/glassfish/domains/domain1
Command restore-domain executed successfully.

However once I start the service back up (I've created a new service file as well but this is working fine) and try to load my application, the Payara control panel's logon page throws an SSL error, one of my two applications just shows a blank page, and the other throws a load of errors talking about the javac compiler failing, amongst others.

I was able to fix the control panel accessibility by changing the value of key-store="keystore.jks" to key-store="config/keystore.jks" in the domain.xml but this has made no change to the two applications - and in fact if I try viewing the list of installed applications within Payara 5 the page shows 0 installed and has an error box with a java.lang.NullPointerException message. Going to https://localhost:4848/management/domain/list-components shows the same NullPointer error, yet the application list is visible elsewhere in this /management/domain path (I forget the exact location off the top of my head, the point is that a different area is listing them).

The official guide states that the process of upgrading should be a simple export/import if you don't want to use any of the new features like H2 databases or HTTP/2, so I'm unsure how to proceed. Has anyone else seen this before?


Solution

  • For anyone who happens to find this, I believe I have solved it by replacing the default-web.xml file under the glassfish/domains/domain1/config directory with one from a fresh Payara 5 domain (i.e. one created from scratch in Payara 5, not Payara 4). There are several instances in this file of modules named jakarta rather than javax ; swapping it out appears to get Payara 5 to look in the right places for modules.