当前位置: 首页 > news >正文

百度站长资源平台c2c代表性企业网站

百度站长资源平台,c2c代表性企业网站,做装修的应该去哪网站找客户,博海博海网站建设Gitlab全量迁移 一、背景1.前提条件 一、背景 公司研发使用的Gitlab由于服务器下架需要迁移到新的Gitlab服务器上。Gitlab官方推荐了先备份然后再恢复的方法。个人采用官方的另外一种方法,就写这篇文章给需要的小伙伴参考。 源Gitlab: http://old.mygitlab.com #地…

Gitlab全量迁移

  • 一、背景
    • 1.前提条件

一、背景

公司研发使用的Gitlab由于服务器下架需要迁移到新的Gitlab服务器上。Gitlab官方推荐了先备份然后再恢复的方法。个人采用官方的另外一种方法,就写这篇文章给需要的小伙伴参考。

源Gitlab: http://old.mygitlab.com #地址需更换为自己的gitlab地址

目标Gitlab: http://new.mygitlab.com

1.前提条件

(1)Linux主机一台并安装Docker

(2)服务器磁盘需要能够存储源Gitlab的代码,迁移工具会先把代码全部拉到本地,然后再推送到目标Gitlab

① 步骤

  1. root 账号登录Linux服务器,并拉取迁移工具的镜像
docker pull 镜像

② 依次运行以下命令

#获取镜像id
docker images|grep congregate
registry.cn-hangzhou.aliyuncs.com/dockerforkevin/congregate                                  centos-20220312   4bd6a78c0a68   2 months ago   2.3GB#运行容器,并在容器中修改/var/run/docker.sock权限
docker run \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /etc/hosts:/etc/hosts \
-p 8000:8000 \
-it 4bd6a78c0a68
/bin/bash#容器内部命令
[ps-user@a4e8ef2730ed congregate]$sudo chmod 666 /var/run/docker.sock
#按Ctrl+D退出容器#再次启动容器
docker start <container-id>

③ 进入容器中添加配置文件

#Linux主机
[root@minikube ~]# docker exec -it <container-id> /bin/bash 
#Docker容器中
[ps-user@a4e8ef2730ed congregate]$ mkdir -p data
[ps-user@a4e8ef2730ed congregate]$vi data/congregate.conf 

congregate.conf文件内容

[DESTINATION]
dstn_hostname = http://new.mygitlab.com  #目标Gitlab仓库地址
dstn_access_token = ek04Xy1RbzVpVk5IWnFYYVY3enM= #目标Gitlab管理员Token
import_user_id = 4
shared_runners_enabled = True
project_suffix = False
max_import_retries = 3
username_suffix = gd
mirror_username = 
max_asset_expiration_time = 24[SOURCE]
src_type = GitLab
src_hostname = http://old.mygitlab.com #源Gitlab仓库地址
src_access_token = aW9uQ3B2TlhkWVpwRnNQV2h5SC0= #源Gitlab管理员Token
src_tier = core
export_import_timeout = 300 #这个时间很重要,控制导入和导出的超时时间,如果仓库很大,可以把这个时间调长一点,单位是秒[EXPORT]
location = filesystem
filesystem_path = /opt/congregate[USER]
keep_inactive_users = False
reset_pwd = True
force_rand_pwd = False[APP]
export_import_status_check_time = 10
wave_spreadsheet_path = wave
mongo_host = localhost
mongo_port = 27017
ui_port = 8000
processes = 4

④ 获取源仓库的元数据(MetaData)

#获取源仓库的元数据
[ps-user@a4e8ef2730ed congregate]$./congregate.sh list

⑤ 通过UI方式创建需要迁移的对象的列表

[ps-user@a4e8ef2730ed congregate]$./congregate.sh ui &

浏览器方式访问本地:8000端口,Projects是Git仓库,全选然后点击"Stage"按钮,切换到Groups(项目组),全选然后点击“Stage”,切换到Users(用户),全选然后点击“Stage”
在这里插入图片描述
所有的按钮点击完成以后,会在data目录下生成3个json文件

[ps-user@a4e8ef2730ed congregate]$ ls -ltr data/staged_*.json
-rw-rw-r-- 1 ps-user ps-user  70439 Mar 12 10:19 data/staged_groups.json
-rw-rw-r-- 1 ps-user ps-user 322311 Mar 12 10:19 data/staged_projects.json
-rw-rw-r-- 1 ps-user ps-user  61408 Mar 12 10:19 data/staged_users.json

⑥ 执行迁移

#先迁移Gitlab账户
[ps-user@a4e8ef2730ed congregate]$./congregate.sh migrate --skip-group-export --skip-group-import --skip-project-export --skip-project-import --commit
#再迁移Gitlab项目组
[ps-user@a4e8ef2730ed congregate]$./congregate.sh migrate --skip-users --skip-project-export --skip-project-import --commit
#最后迁移Gitlab仓库(也叫项目),这个比较耗时间,视源仓库代码量的多少
[ps-user@a4e8ef2730ed congregate]$./congregate.sh migrate --skip-users --skip-group-export --skip-group-import --commit

在这里插入图片描述

参考博客:

https://gitlab.com/gitlab-org/professional-services-automation/tools/migration/congregate/-/blob/master/docs/using-congregate.md#quick-start

http://www.yayakq.cn/news/74992/

相关文章:

  • 宁夏网站开发公司wordpress 浮窗
  • 做任务免费得晋江币网站一个专门做字画的网站
  • 网站百度云jeykll和wordpress
  • 建设网站要什么如何推广网站业务
  • 冠县品牌网站建设推广如何让百度快速收录网站文章
  • 下载学校网站模板下载地址宁波网页设计制作
  • 做一个网站一般需要多少钱网站被同行链接代替
  • 网站建设怎么问问题网络营销的定价策略6个
  • 网站信息优化的方式wordpress主题恢复默认
  • 加强廉政教育网站建设物流网站建设
  • 深圳做外贸网站公司哪家好微信公众号做特效的网站
  • 长春火车站到龙嘉机场动车时刻表设计素材网站合集
  • 怎么建立淘宝客网站网络营销的应用研究论文
  • 用现成的网站模板只套内容就可以有这样的吗十个最好的网站
  • 正定城乡建设网站球队排名世界
  • 惠州建设公司网站建设银行网上官方网站
  • 医院网站建设山东重庆发布的最新消息今天
  • 浙江新地标建设集团网站instant wordpress
  • 湖南涟钢建设有限公司网站网站重构
  • 长春火车站附近有什么好玩的地方中企动力温州分公司官网
  • 电商网站建设流程怎么用手机自创游戏
  • 性价比高的seo网站优化wordpress 被挂
  • 如何制作外贸网站 wordpress东莞娱乐场所最新通知
  • 网站在线优化工具wordpress头部信息
  • wordpress怎么删除预建网站做网站好还是做程序员好
  • 青海兴远建设工程有限公司网站推广网站怎么建设
  • 网站后台管理系统开发怎么减少wordpress网站cpu占用
  • 网站营销单页怎么做济南网站制作工具
  • 哪些网站可以用gif做头像建网站的软件
  • 开源的网站后台程序怎么选择佛山网站设计