Gitea旧库迁移(Win)
Gitea旧库迁移(Win)

Gitea旧库迁移(Win)

Gitea旧库迁移(Win)

1. 安装

https://docs.gitea.cn/installation/install-from-binary

前往官网 https://dl.gitea.com/gitea/ 或 github https://github.com/go-gitea/gitea/releases

  • 下载 gitea-xxxx-windows-xxx-amd64.exe 位exe
  • 在待运行目录新建data目录
  • 双击exe运行
  • 根据控制台提示进入安装页面,例如: http://localhost:3000/
  • 数据库建议选择SQLite便于维护

2. 注册服务

https://docs.gitea.cn/installation/windows-service/

# 使用管理员cmd运行
sc create gitea start= auto binPath= "\"J:\gitea\gitea.exe\" web --config \"J:\gitea\custom\conf\app.ini\""

3. 恢复

  • 打开旧的gitea-repositories,根据文件夹名,依次重新创建项目
  • 关闭gitea控制台
  • 压缩所有项目(稍后需要用到每个项目下的hooks文件夹)
  • 复制原来的项目xxxxx.git到安装目录下的data/gitea-repositories/xxxxx/xxxxx.git
  • 从刚才的压缩文件中,找到对应的hooks目录复制到当前xxxxx.git目录下替换
  • 重启gitea,完成恢复