Upgrading Gitea 1.14 to 1.22.3 And MySQL DB to Postgresql, wipes my database on start

Hi,

I am currently trying to upgrade a Gitea service that is quite outdated to version 1.22.3. As part of the request, I am also migrating the database from MySQL to PostgreSQL. However, I am facing a problem.

I transferred (and adjusted the settings for PostgreSQL) the app.ini file to use a custom configuration and avoid the initial setup process. I migrated all the data from MySQL to a PostgreSQL database using PGloader, which completed without issues. I also updated the version in the new database to match the version I am installing.

The issue arises when starting the service:

  • Starting the service with only the new app.ini file and an empty database works fine.
  • Starting the service with the migrated data (MySQL → PostgreSQL) does not throw any errors, but all users, emails, and other related data are deleted from the new PostgreSQL database.

Does anyone have an idea why this is happening? I’ve tried debugging with all available settings, but finding the cause in such a large database feels like searching for a needle in a haystack…