vim /var/opt/gitlab/nginx/conf/gitlab-http.conf
-------------------
# 外网访问的端口,如果已经有服务占用了80,修改这个即可
listen *:8888;
server_name gitlab.zuiyoujie.com;
set $http_host_with_default "gitlab.zuiyoujie.com:8888";
-------------------
gitlab-rails console production
user = User.where(id:1).first
user.password=‘123456‘
user.save!
# 可以将此命令写入crontab,以实现定时备份
---------------
10 04 * * * /usr/bin/gitlab-rake gitlab:backup:create
---------------
数据备份位置 /var/opt/gitlab/backups
修改自定义参数 gitlab_rails [‘backup_path‘],即可改变默认值。
# 停止unicorn和sidekiq,保证数据库没有新的连接,不会有写数据情况
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq
# 进入备份目录进行恢复,1476900742为备份文件的时间戳
cd /var/opt/gitlab/backups
gitlab-rake gitlab:backup:restore BACKUP=1476900742
# 启动unicorn和sidekiq
sudo gitlab-ctl start unicorn
sudo gitlab-ctl start sidekiq
# 会在前面加上协议头和端口号“ssh://git@gitlab.zuiyoujie.com:22061/zhaoshuai/tools.git”
gitlab_rails[‘gitlab_shell_ssh_port‘] = 22061
https://www.jianshu.com/p/b04356e014fa
原文:https://www.cnblogs.com/tssc/p/12918744.html