Issue
We are planning to migrate our Liferay PaaS database from MySQL to PostgreSQL and need to understand the process, the required steps, and the scope of Liferay Support's involvement.
Environment
- Liferay PaaS
Resolution
Migrating a Liferay PaaS database from MySQL to PostgreSQL is a complex, manual process that your team must perform directly. While Liferay Support can prepare your target PaaS environment with a new, empty PostgreSQL database, your team (and not Liferay Support) must prepare the data and execute the migration.
Follow these high-level steps to perform the migration:
- Take a complete backup of the source Liferay PaaS environment. Stop the environment first to prevent new data from being generated after the backup.
- Download the backup archive and extract the MySQL database dump file.
- Set up a local MySQL server and import the database dump into it.
- Follow the process outlined in Migrating Your Database to PostgreSQL to convert the local MySQL database to a local PostgreSQL database using Liferay's database migration tool. On releases before 2026.Q3, this tool is a beta feature and you may encounter issues.
- Export the newly created local PostgreSQL database in a plain-text format. Before you repackage it, confirm that all Liferay tables are in the public schema and that table names use the correct capitalization.
- Repackage the modified PostgreSQL database dump along with the original document library files (from the initial backup) into a new PaaS-compatible backup archive.
- Coordinate with Liferay Support to have the target PaaS environment's database changed to PostgreSQL. This involves deleting the old MySQL database and creating a new, empty PostgreSQL service.
- Once the environment is ready, upload the newly created backup archive and perform a restore.
Additional Information
Due to the potential complexity of migrating to a new database vendor, consider exploring migration assistance through Liferay's Global Services (GS) offerings.