Upgrade guide


目录

This guide helps Forgejo admins perform upgrades safely and provides guidance to troubleshoot problems. It also covers upgrades from Gitea back to version 1.2.0.

Release life cycle

Each Forgejo release undergoes the following states:

To be notified in advance of security releases, watch or subscribe to the RSS feed of the security-announcements repository. The details of the vulnerability will not be revealed, only the expected release date, for administrators to plan ahead and better secure their instance.

Semantic version compliance

Forgejo is compliant with semantic versioning as of 7.0.0. In a nutshell it means that there is no breaking change unless the first number changes (e.g. when 8.0.0 is published it will contain breaking changes compared to 7.0.0). The release notes document those breaking changes and they may require manual intervention depending on the Forgejo installation.

In versions prior to 7.0.0, the releases 1.19, 1.20 and 1.21 all contained breaking changes and the versioning scheme was not compliant with semantic versioning.

Backup

To be safe, make sure to perform a full backup before upgrading. It is a requirement when upgrading to a new stable release (going from v1.20 to v1.21 for instance) but is also a good precaution when installing a minor or patch release (going from v7.0.0 to v7.0.1 for instance).

The reliable way to perform a backup is with a synchronized point-in-time snapshot of all the storage used by Forgejo.

For instance, if everything (SQLite database + repositories etc.) is on a single QCOW2 disk attached to a virtual machine, a qemu snapshot guarantees the backup is consistent and can be done while the Forgejo server is running.

However, if Forgejo uses a S3 storage for attachments with a PostgresQL database, stores Git repositories on a remote file system and queues in a Redis server, the only way to ensure a consistent state is to shutdown Forgejo during the backup.

In the simplest case where everything is on a single file system and if the instance is not busy (no mirrors, no users), the backup can be done with:

Verify Forgejo works

It is critical to verify that Forgejo works very carefully. Restoring the backup done before the upgrade is easy and does not lose any information. But if a problem is discovered days or weeks after the upgrade, it will not be an option and fixing it on a live Forgejo instance will be much more challenging.

Preparing an upgrade from Gitea

Upgrades to Forgejo are transparently supported up to Gitea v1.22 included, in two steps:

Preparing the Forgejo upgrade

Note: Forgejo installations using Docker requires docker >= 20.10.6 otherwise mysterious problems will happen (mysterious in the sense that the problem will be about something unrelated to the Docker version").

Performing the upgrade

Troubleshooting

Unexpected database version

The database version is stored in the database and used to prevent an accidental downgrade. For instance, if a running Forgejo v1.20 instance is downgraded to Forgejo v1.19, it will refuse to start because it would damage the content of the database.

Unexplained upgrade failures & workarounds

When upgrading from ... (known problematic versions or upgrade paths)

A list of things to be aware depending on which version you have installed. The list is sorted by Forgejo and Gitea versions. Upgrades from Gogs have an extra section below. Please read them if you originally installed Gogs, even if you already migrated to Gitea.

Known problems when upgrading from Gogs:


版本号 #2
由 cocobook-sync 创建于 2023-08-15 07:19:15 UTC
由 cocobook-sync 更新于 2026-07-26 05:23:37 UTC