date: “2016-12-01T16:00:00+02:00” title: “從 Gogs 升級” slug: “upgrade-from-gogs” weight: 10 toc: false draft: false menu: sidebar:
parent: "upgrade"
name: "從 Gogs"
weight: 10
identifier: "upgrade-from-gogs"
目錄
{{< toc >}}
若您正在執行 Gogs 0.9.146 以下版本,您可以很簡單地遷移到 Gitea。
請參考下列步驟。在 Linux 系統上請以 Gogs 的使用者身份執行:
gogs backup
建立 Gogs 的備份。這會建立檔案 gogs-backup-[timestamp].zip
包含所有重要的 Gogs 資料。
如果稍後您要恢復到 gogs
時會用到它。1.0.x
版,從 gogs
遷移到其它版本是不可行的。gogs/custom/conf/app.ini
到 gitea/custom/conf/app.ini
。gogs/custom/
複製自訂 templates, public
到 gitea/custom/
。gogs/custom/conf
中的其它自訂資料夾如: gitignore, label, license, locale, readme
,
請複製到 gitea/custom/options
。gogs/data/
到 gitea/data/
。它包含了問題附件和大頭貼。gitea web
啟動 Gitea 驗證上列設定是否正確。Rewrite '.ssh/authorized_keys' file
。1.1.4
→ 1.2.3
→ 1.3.4
→ 1.4.2
→ 等等 ) 以遷移資料庫。Rewrite all update hook of repositories
。gogs-repositories/
為 gitea-repositories/
gogs-data/
為 gitea-data/
gitea/custom/conf/app.ini
中修改:修改前:
[database]
PATH = /home/:USER/gogs/data/:DATABASE.db
[attachment]
PATH = /home/:USER/gogs-data/attachments
[picture]
AVATAR_UPLOAD_PATH = /home/:USER/gogs-data/avatars
[log]
ROOT_PATH = /home/:USER/gogs/log
修改後:
[database]
PATH = /home/:USER/gitea/data/:DATABASE.db
[attachment]
PATH = /home/:USER/gitea-data/attachments
[picture]
AVATAR_UPLOAD_PATH = /home/:USER/gitea-data/avatars
[log]
ROOT_PATH = /home/:USER/gitea/log
gitea web
啟動 Gitea 檢查是否正確執行gitea
成功從 gogs
升級到 gitea 1.0.x
後再用 2 個步驟即可升級到最新版的 gitea
。
請先升級到 gitea 1.6.4
,先從下載頁下載
您平臺的二進位檔取代既有的。至少執行一次 Gitea 並確認一切符合預期。
接著重複上述步驟,但這次請使用最新發行版本。
您也可以從更新版本的 Gogs 升級,但需要更多步驟。 請參考 #4286。
gitea/custom/templates
中 的自訂樣板有關,請試著逐一移除它們。
它們可能和 Gitea 或更新不相容。從 gitea/contrib 更新必要的檔案以取得正確的環境變數。
使用 systemd 的發行版:
/etc/systemd/system/gitea.service
sudo systemctl enable gitea
sudo systemctl disable gogs
使用 SysVinit 的發行版:
/etc/init.d/gitea
sudo rc-update add gitea
sudo rc-update del gogs