在CentOS系统上迁移和恢复GitLab的过程涉及多个步骤,包括安装依赖包、下载和安装GitLab RPM包、修改配置文件、备份数据以及恢复数据。以下是详细的步骤:
cat /proc/version
cat /etc/redhat-release
yum install policycoreutils openssh-server openssh-clients postfix
systemctl enable sshd
systemctl start sshd
systemctl enable postfix
systemctl start postfix
cd /usr/local/rpm
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-15.0.0-ce.0.el7.x86_64.rpm
chown -R git:git /usr/local/rpm
rpm -ivh gitlab-ce-15.0.0-ce.0.el7.x86_64.rpm
policycoreutils-python
,则需要安装相应的包。/etc/gitlab/gitlab.rb
文件:external_url 'http://x.x.x.x' # 修改为服务器公网IP
gitlab_rails['backup_path'] = "/var/opt/gitlab/backups"
systemctl status firewalld
systemctl start firewalld
gitlab-backup create
/var/opt/gitlab/backups
目录下。/var/opt/gitlab/backups
目录。vi /var/opt/gitlab/postgresql/data/postgresql.conf
listen_addresses='*'
vi /var/opt/gitlab/postgresql/data/pg_hba.conf
local all all trust
gitlab-ctl restart
su gitlab
gitlab-psql
ALTER USER gitlab WITH SUPERUSER;
gitlab-backup restore FORCE=yes
以上步骤涵盖了从准备工作到数据恢复的完整流程,确保了GitLab在CentOS系统上的顺利迁移与恢复。