迁移Gogs(从Window Server 2019中迁移到CentOS7.9)

迁移Gogs(从Window Server 2019中迁移到CentOS7.9)

摘要:
Gogs从Window Server 2019中迁移到CentOS7.9;
CentOS中Gogs为新安装的,没有其他仓库;
CentOS中操作用户为root;


1、在window中执行备份命令

当前目录生成【gogs-backup-20210223111220.zip】类似的压缩包。

F:\ProgramFiles\windows_amd64\gogs>gogs backup2021/02/23 11:12:20 [ INFO] Backup root directory: C:\Users\ZEQIPC~1\AppData\Local\Temp\gogs-backup-4623446352021/02/23 11:12:20 [ INFO] Packing backup files to: gogs-backup-20210223111220.zip2021/02/23 11:12:20 [ INFO] Dumping repositories in 'F:/ProgramFiles/windows_amd64/config/systemprofile/gogs-repositories'2021/02/23 11:13:23 [ INFO] Repositories dumped to: C:\Users\ZEQIPC~1\AppData\Local\Temp\gogs-backup-462344635/repositories.zip2021/02/23 11:14:13 [ INFO] Backup succeed! Archive is located at: gogs-backup-20210223111220.zipF:\ProgramFiles\windows_amd64\gogs>

【扩展】通过 help查看backup命令使用方法(在Windows中敲的)

F:\ProgramFiles\windows_amd64\gogs>gogs backup --helpNAME:   gogs backup - Backup files and databaseUSAGE:   gogs backup [command options] [arguments...]DESCRIPTION:   Backup dumps and compresses all related files and database into zip file,which can be used for migrating Gogs to another server. The output format is meant to beportable among all supported database engines.OPTIONS:   --config value, -c value   Custom configuration file path (default: "custom/conf/app.ini")   --verbose, -v              Show process details   --tempdir value, -t value  Temporary directory path (default: "C:\\Users\\ZEQIPC~1\\AppData\\Local\\Temp")   --target value             Target directory path to save backup archive (default: "./")   --archive-name value       Name of backup archive (default: "gogs-backup-20210223111203.zip")   --database-only            Only dump database   --exclude-repos            Exclude repositories

2、在CentOS中恢复备份数据

2.1、将【gogs-backup-20210223111220.zip】上传至centos系统中
2.2、开始恢复数据

相关命令

 ./gogs restore --config /usr/local/gogs/custom/conf/app.ini --tempdir  /data/tmp  --from gogs-backup-20210223111220.zip

2.3、使用CentOS中的配置文件替换恢复的配置文件(为了解决错误:User configured to run Gogs is "git", but the current user is)

[root@localhost gogs]# mv custom custom.backup[root@localhost gogs]# mv custom.bak custom

【扩展】通过 help查看restore命令使用方法(在CentOS中敲的)

[root@localhost gogs]# ./gogs restore --helpNAME:   gogs restore - Restore files and database from backupUSAGE:   gogs restore [command options] [arguments...]DESCRIPTION:   Restore imports all related files and database from a backup archive.The backup version must lower or equal to current Gogs version. You can also importbackup from other database engines, which is useful for database migrating.If corresponding files or database tables are not presented in the archive, they willbe skipped and remain unchanged.OPTIONS:   --config value, -c value   Custom configuration file path   --verbose, -v              Show process details   --tempdir value, -t value  Temporary directory path (default: "/tmp")   --from value               Path to backup archive   --database-only            Only import database   --exclude-repos            Exclude repositories

3、检查恢复情况

3.1、数据库中【repository】等表的数据已经恢复
3.2、仓库根目录下的数据已经恢复

4、重启访问

恢复完成,正常使用。

来源:https://www.icode9.com/content-3-867351.html

(0)

相关推荐

  • SVN仓库备份和迁移

    author: yunqimg(ccxtcxx0) 前言 本文主要是讲 SVN 仓库的全量备份和增量备份,只包括基本操作. 如有疑问请参考 References. 仓库备份 svnadmin dump ...

  • Windows Server 2019中安装.NET Framework 3.5功能出错解决方法

    问题描述:Windows server 2019系统安装net framework3.5时默认情况下会出现报错,提示错误:error  0x800F0954. 问题说明:根据网上资料尝试了几种方式都不 ...

  • 伍冬睿教授:脑机接口中迁移学习的完整流程

    更多技术干货第一时间送达 大家好,今天Rose分享一篇关于脑机接口中的迁移学习的完整流程.本文由华中科技大学伍冬睿教授授权分享. 关于脑机接口中迁移学习方面的研究,伍教授团队做过大量的工作.之前社区分 ...

  • 运动想象脑机接口中迁移学习的完整流程

    更多技术干货第一时间送达 脑机接口(Brain-Computer Interface, BCI)可以让用户使用脑电信号直接与计算机或其他外部设备进行交互.该名词是由美国加州大学洛杉矶分校Vidal教授 ...

  • 习题研究:模型迁移在曲率圆与向心力问题中的应用

    习题研究:模型迁移在曲率圆与向心力问题中的应用

  • 用户时间迁移史:家庭场景进入中屏时代

    "一屋一屏"的屏幕革命,正在悄然上演. 撰文 /   Alter 编辑 /    胖爷 新一轮的"屏幕战争",正在悄然上演. 先别急于否认这样的结论,至少下面几 ...

  • 知识点|高一地理2019中图版必修二3.2

    高一地理2019中图版必修二3.2工业区位因素 一.影响工业的区位因素主导因素原因区位选择原则工业区位类型典型工业原材料原材料不便于长距离运输或运输成本较高接近原材料产地原材料指向型制糖厂,水果罐头加 ...

  • 知识点|高一地理2019中图版必修二3.1

    高一地理2019中图版必修二3.1农业区位因素 一.农业产业形式: 种植业.林业.畜牧业.渔业.养殖业.栽培业等 二.农业的类型: 原始农业.传统农业.现代农业 三.影响农业的区位因素 (一)自然因素 ...

  • 知识点|高一地理2019中图版必修二2.3

    高一地理2019中图版必修二2.3不同地区城镇化的过程和特点 1.城镇化具体反映的方面: (1)人口的集中过程(人口向城镇集中,城镇规模扩大) (2)乡村向城镇的转化过程(农业用地发展为城市建设用地) ...

  • 知识点|高一地理2019中图版必修二2.1、2.2

    高一地理2019中图版必修二2.1乡村和城镇内部的空间结构 1.乡村内部的空间结构 2.城镇内部的空间结构 3.内部空间结构的形成原因 (1)历史原因:北京的市中心没有形成高楼大厦的CBD,而是文化区 ...