You need to share more details about your setup, but as others have already mentioned, it could be an database issue, because usually Gitea is configured to use a Postgresql database.
Also make sure you don't combine an upgrade with a migration, the Gitea and Forgejo versions need to be roughly the same. Especially around the 1.20 version there was a need to change the folder structure before upgrading.