For some time now, PostgreSQL has been gaining so much ground that even Liferay itself has made the decision to replace MySQL with PostgreSQL.
At this point, many of us are faced with the non-trivial task of performing the same operation in our on-premise installations and, above all, how to do it properly.
Liferay published a tool for this purpose, divided into two parts:
-
The data exporter
-
The migration script
Both my colleagues and I have tried to use this tool to perform this operation, but the process (at least in my case) did not achieve the desired outcome. In fact, Liferay DXP 2026 already warns in the control panel that this tool is in its Beta phase.
Faced with this inconvenience, I have been running tests to develop a tool that allows this operation to be performed.
Requirements
To carry out the procedure, you must have downloaded the tool, have an empty PostgreSQL database, and have Java 21 installed.
Procedure
The procedure to perform the migration with this tool is as follows:
-
Create an empty database on a PostgreSQL server
-
Stop the application server of the Liferay installation
-
Change the database connection configuration to PostgreSQL
-
Start the server again
-
Wait for the table creation process to finish
-
Stop the server again
-
Run the tool (see documentation)
-
Start the server again
Once the entire procedure is completed, the Liferay installation will start up using the PostgreSQL database with all the data transferred.

