-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
doc: Upgrade from an old Gitea #16918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4ac8a03
doc: Upgrade from an old Gitea
wxiaoguang 4be679e
update backup steps
wxiaoguang 01e16aa
Update docs/content/doc/upgrade/from-gitea.en-us.md
wxiaoguang c616765
Update docs/content/doc/upgrade/from-gitea.en-us.md
wxiaoguang 73a3996
Update docs/content/doc/upgrade/from-gitea.en-us.md
wxiaoguang dc1543d
Update docs/content/doc/upgrade/from-gitea.en-us.md
wxiaoguang 7fea5cf
Update docs/content/doc/upgrade/from-gitea.en-us.md
wxiaoguang 231e9c1
Update docs/content/doc/upgrade/from-gitea.en-us.md
wxiaoguang f6bc5c0
Update docs/content/doc/upgrade/from-gitea.en-us.md
wxiaoguang 84484a7
update backup tips
wxiaoguang 078ca65
update table header
wxiaoguang ae40d53
Merge branch 'main' into doc
lunny 48b6ba6
Update docs/content/doc/upgrade/from-gitea.en-us.md
wxiaoguang a3d8206
Update docs/content/doc/upgrade/from-gitea.en-us.md
wxiaoguang f45a6a1
Update docs/content/doc/upgrade/from-gitea.en-us.md
wxiaoguang c06c731
Update docs/content/doc/upgrade/from-gitea.en-us.md
wxiaoguang 4b16d8c
Update from-gitea.en-us.md
wxiaoguang 10f44f3
Update from-gitea.en-us.md
wxiaoguang 24612aa
Update from-gitea.en-us.md
wxiaoguang f45d4e1
Update from-gitea.en-us.md
wxiaoguang f6fd5f6
Update from-gitea.en-us.md
wxiaoguang 3ac5dc5
Update from-gitea.en-us.md
wxiaoguang abdd4ea
Update from-gitea.en-us.md
wxiaoguang 42214f4
Merge branch 'main' into doc
techknowlogick File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
date: "2021-09-02T16:00:00+08:00" | ||
title: "Upgrade from an old Gitea" | ||
slug: "upgrade-from-gitea" | ||
weight: 10 | ||
toc: false | ||
draft: false | ||
menu: | ||
sidebar: | ||
parent: "upgrade" | ||
name: "From Gitea" | ||
weight: 10 | ||
identifier: "upgrade-from-gitea" | ||
--- | ||
|
||
# Upgrade from an old Gitea | ||
|
||
**Table of Contents** | ||
|
||
{{< toc >}} | ||
|
||
To update Gitea, download a newer version, stop the old one, perform a backup, and run the new one. | ||
Every time a Gitea instance starts up, it checks whether a database migration should be run. | ||
If a database migration is required, Gitea will take some time to complete the upgrade and then serve. | ||
|
||
## Backup for downgrade | ||
|
||
Gitea keeps compatibility for patch versions whose first two fields are the same (`a.b.x` -> `a.b.y`), | ||
these patch versions can be upgraded and downgraded with the same database structure. | ||
Otherwise (`a.b.?` -> `a.c.?`), a newer Gitea version will upgrade the old database | ||
to a new structure that may differ from the old version. | ||
|
||
For example: | ||
|
||
| From | To | Result | | ||
| --- | --- | --- | | ||
| 1.4.0 | 1.4.1 | ✅ | | ||
| 1.4.1 | 1.4.0 | ⚠️ Not recommended, take your own risk! Although it may work if the database structure doesn't change, it's highly recommended to use a backup to downgrade. | | ||
| 1.4.x | 1.5.y | ✅ Database gets upgraded. You can upgrade from 1.4.x to the latest 1.5.y directly. | | ||
| 1.5.y | 1.4.x | ❌ Database already got upgraded and can not be used for an old Gitea, use a backup to downgrade. | | ||
|
||
**Since you can not run an old Gitea with an upgraded database, | ||
a backup should always be made before a database upgrade.** | ||
|
||
If you use Gitea in production, it's always highly recommended to make a backup before upgrade, | ||
even if the upgrade is between patch versions. | ||
|
||
Backup steps: | ||
|
||
* Stop Gitea instance | ||
* Backup database | ||
* Backup Gitea config | ||
* Backup Gitea data files in `APP_DATA_PATH` | ||
* Backup Gitea external storage (eg: S3/MinIO or other storages if used) | ||
|
||
If you are using cloud services or filesystems with snapshot feature, | ||
a snapshot for the Gitea data volume and related object storage is more convenient. | ||
|
||
|
||
## Upgrade with Docker | ||
|
||
* `docker pull` the latest Gitea release. | ||
* Stop the running instance, backup data. | ||
* Use `docker` or `docker-compose` to start the newer Gitea Docker container. | ||
|
||
## Upgrade from package | ||
|
||
* Stop the running instance, backup data. | ||
* Use your package manager to upgrade Gitea to the latest version. | ||
* Start the Gitea instance. | ||
|
||
## Upgrade from binary | ||
|
||
* Download the latest Gitea binary to a temporary directory. | ||
* Stop the running instance, backup data. | ||
* Replace the installed Gitea binary with the downloaded one. | ||
* Start the Gitea instance. | ||
|
||
## Take care about customized templates | ||
|
||
Gitea's template structure and variables may change between releases, if you are using customized templates, | ||
do pay attention if your templates are compatible with the Gitea you are using. | ||
|
||
If the customized templates don't match Gitea version, you may experience: | ||
`50x` server error, page components missing or malfunctioning, strange page layout, ... | ||
Remove or update the incompatible templates and Gitea web will work again. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.