mysql - 如何从 gitlab 源库迁移到 gitlab 综合库?

标签 mysql postgresql gitlab-omnibus gitlab-ce

我正在尝试将 gitlab-ce 8.5 源库移动到 gitlab-ce 8.15 综合。我们在源代码库中使用 MySQL,但现在我们必须将 psql 与 gitlab-ce 综合使用。当我尝试进行备份时,由于一些空的存储库而失败。

问题:是否有其他方法可以将源库移动到具有完整备份的综合库?

最佳答案

我已将 gitlab 从源库移至综合库。您可以使用下面的链接将数据库转储从 MySQL 转换为 psql。

https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/mysql_to_postgresql.md

我手动创建了一个存储库的 zip 文件,并将其复制到 gitlab 综合服务器并将其恢复到/var/opt/gitlab/git-data/repository/上。

完成这些步骤后,将以下脚本复制到/var/opt/gitlab/git-data/xyz.sh 并执行以更新 Hook 。

#!/bin/bash
for i in repositories/* ; do
  if [ -d "$i" ]; then
    for o in $i/* ; do
     if [ -d "$i" ]; then
       rm "$o/hooks"
       # change the paths if required
       ln -s  "/opt/gitlab/embedded/service/gitlab-shell/hooks" /var/opt/gitlab/git-data/"$o"/hooks 
       echo "HOOKS CHANGED ($i/$o)"
     fi
    done
  fi
done

注意:Repos 权限应为 git:git

迁移过程中的一些有用命令:

sudo gitlab-ctl start postgres **to start the Postgres service only**

sudo gitlab-psql **to use the gitlab bundle postgres.**

如果您在 gitlab 页面上遇到 5xx 错误代码,请随时发表评论。

关于mysql - 如何从 gitlab 源库迁移到 gitlab 综合库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41196891/

相关文章:

mysql - 使用两个左连接mysql时出现重复值

mysql - mysql的特殊条件查询

sql - 插入新表时更新外键

用于 web 应用程序中频繁 "save"操作的 PostgreSQL 表设计

gitlab - 将gitlab密码与cas同步

mysql - 重置关系表mysql中的行ID

mysql - 即使 SQL 查询找到行,Cakephp Auth 登录也会返回 false

postgresql - 使用 pg_dump,导出所有表的整个架构和一张表的数据

docker - 为什么 gitlab-registry.key 是 "skipped due to only_if"?

elasticsearch - 使用外部托管的Elasticsearch实例进行高级搜索