Skip to content

Commit d572336

Browse files
bkrolltechknowlogick
authored andcommitted
Add documentation on how to update Gitea to new version (#4500)
1 parent b11ddd8 commit d572336

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/content/doc/installation/from-binary.en-us.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,20 @@ cp gitea /usr/local/bin/gitea
9090

9191
See how to create [Linux service]({{< relref "run-as-service-in-ubuntu.en-us.md" >}})
9292

93+
## Updating to a new version
94+
95+
You can update to a new version of gitea by stopping gitea, replacing the binary at `/usr/local/bin/gitea` and restarting the instance.
96+
The binary file name should not be changed during the update to avoid problems
97+
in existing repositories.
98+
99+
It is recommended you do a [backup]({{< relref "doc/usage/backup-and-restore.en-us.md" >}}) before updating your installation.
100+
101+
If you have carried out the installation steps as described above, the binary should
102+
have the generic name `gitea`. Do not change this, i.e. to include the version number.
103+
104+
See below for troubleshooting instructions to repair broken repositories after
105+
an update of your gitea version.
106+
93107
## Troubleshooting
94108

95109
### Old glibc versions
@@ -107,3 +121,25 @@ For errors like `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:30
107121
bind: address already in use` gitea needs to be started on another free port. This
108122
is possible using `./gitea web -p $PORT`. It's possible another instance of gitea
109123
is already running.
124+
125+
### Git error after updating to a new version of gitea
126+
127+
If the binary file name has been changed during the update to a new version of gitea,
128+
git hooks in existing repositories will not work any more. In that case, a git
129+
error will be displayed when pushing to the repository.
130+
131+
```
132+
remote: ./hooks/pre-receive.d/gitea: line 2: [...]: No such file or directory
133+
```
134+
135+
The `[...]` part of the error message will contain the path to your previous gitea
136+
binary.
137+
138+
To solve this, go to the admin options and run the task `Resynchronize pre-receive,
139+
update and post-receive hooks of all repositories` to update all hooks to contain
140+
the new binary path. Please note that this overwrite all git hooks including ones
141+
with customizations made.
142+
143+
If you aren't using the built-in to Gitea ssh server you will also need to re-write
144+
the authorized key file by running the `Update the '.ssh/authorized_keys' file with
145+
Gitea SSH keys.` task in the admin options.

0 commit comments

Comments
 (0)