Gitea upgrade from 1.11.0+rc1-23-g42663a687 to 1.16.8
Following the HOWTO Gitea upgrades, a guide for admins
I'll assist Raphaël in upgrading a Gitea instance running 1.11.0+rc1-23-g42663a687 to 1.16.8.
It is an ancient installation that was never upgraded. The plan is to try an upgrade using a backup so as to detect problems without disturbing the production instance.
- upload the backup to a virtual machine and restore the backup
- verify the database version is v118
- install gitea v1.11.8
gitea migrateverify it does no migration with select * from version == 118
- follow the upgrade steps
gitea doctor --all
- manually verify it works
- summarize findings
- install 1.16.8
It seems to work but the doctor found errors.
$ ./gitea --config /tmp/a/app.ini doctor --all  Check paths and basic configuration - [I] Configuration File Path: "/tmp/a/app.ini" - [I] Repository Root Path: "/home/git/gitea-repositories" - [I] Data Root Path: "/home/git/data" - [I] Custom File Root Path: "/home/git/custom" - [W] NOTICE: is not accessible (Error: stat /home/git/custom: no such file or directory) - [I] Work directory: "/home/git" - [I] Log Root Path: "/var/log/gitea/" OK  Check if there is garbage storage files OK  Check Database Version OK  Check consistency of database - [C] Error: pq: syntax error at or near "." whilst counting Orphaned OAuth2Grant without existing User ERROR  Check if user with wrong type exist OK  Check if OpenSSH authorized_keys file is up-to-date OK  Check if SCRIPT_TYPE is available - [I] ScriptType bash is on the current PATH at /bin/bash OK  Check if hook files are up-to-date and executable OK  Recalculate Stars number for all user OK  Check old archives - [I] 8 old archives in repository need to be deleted OK  Enable push options - [I] Checked 25 repositories, 0 need updates. OK  Check for incorrectly dumped repo_units (See #16961) - [W] Found 0 broken repo_units OK  Recalculate merge bases - [W] Unable to get merge base for PR ID 16, #102 onto feature-config_managment in <redacted>. Error: exit status 128 - fatal: Not a valid object name feature-config_managment & exit status 128 - fatal: ambiguous argument 'refs/heads/feature-config_managment': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' - [W] Unable to get merge base for PR ID 30, #112 onto feature-ASCII_backward_compatibility in <redacted>. Error: exit status 128 - fatal: Not a valid object name feature-ASCII_backward_compatibility & exit status 128 - fatal: ambiguous argument 'refs/heads/feature-ASCII_backward_compatibility': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' - [W] 0 PRs with incorrect mergebases of 36 PRs total in 25 repos OK  Check git-daemon-export-ok files - [I] Checked 25 repositories, 0 need updates. OK
- - [C] Error: pq: syntax error at or near "." whilst counting Orphaned OAuth2Grant without existing User
bug in the doctor command (fixed here) will likely be backported. It fails three checks but the database has no oauth2 configured so it does not really matter.
- Unable to get merge base for PR ID 16, #102 + Unable to get merge base for PR ID 30, #112
these are because the associated branches were removed but the PR contain the commits and otherwise look good. The doctor should not issue a warning in this case.
- 8 old archives in repository need to be deleted
they are empty, they can be left where they are: it is a cache
- NOTICE: is not accessible (Error: stat /home/git/custom: no such file or directory)
The doctor should not issue a warning in this case.
The upgrade is completed using the upgrade.sh script with the following changes:
- add set -x at the beginning to see what is happenening (in case the GPG key server takes a long time to answer, for instance)
- comment out the flush queue command that does not exist in 1.11.
- the emails of all users were manually verified to not be subject to this regression
An attempt was made to run gitea doctor before the upgrade only to realize that it was not available in 1.11
Deleting a branch is permanent. It CANNOT be undone. Continue?