Uninstall Gitlab, import new backup

Table of contents

1. Uninstall gitlab

2. Backup and restore

3. Click to report error 500

    A while ago, I tested the restoration of gtlab backup on the server. Now considering that all the backups are too large, I ignore the artifacts and test the consistency of the backup data after ignoring the artifacts.

1. Uninstall gitlab

1. stop gitlab

gitlab-ctl stop

 

2. Uninstall gitlab

rpm -e gitlab-ce

3. View the gitlab process

ps aux | grep gitlab

 4. Kill the process with many dots:

kill -9 26872

5. Delete all files containing gitlab

sudo find / -name gitlab | xargs sudo rm -rf

 

2. Backup and restore

1. After copying the backup file that ignores the artifacts, start reinstalling Gitlab

 rpm -ivh gitlab-ce-15.4.0-ce.0.el7.x86_64.rpm

2. Set the configuration file

vim /etc/gitlab/gitlab.rb

 

3. Overload configuration

gitlab-ctl reconfigure

 Stuck, and later checked the status after the artificial stop and reported an error

 Solution:

Restart the gitlab-runsvdir service and reload the configuration and restart

systemctl restart gitlab-runsvdir

gitlab-ctl reconfigure

gitlab-ctl restart

4. Set root account and password

5. Browser access: http://172.16.67.191:8089/    root/password, you can see that this is a brand new gitlab server

 6. Copy the backup that ignores the artifacts to the /var/opt/gitlab/backups directory for backup and recovery

gitlab-rake gitlab:backup:restore BACKUP=1666717259_2022_10_26_15.4.0

7. After recovery, the browser access test found that the root password is not the password just set, but the root password of gitlab on the backed up server.

3. Click to report error 500

When clicking on the runner of the group, it will be 500. I don’t know if it is because there are no backup artifacts, so I uninstalled this backup and restored a full backup for testing.

Result: 500 errors will still be reported.
Solution: The secret key file gitlab-secrets.json in the backup file is not copied back.
1. Overwrite the gitlab-secrets.json of the original server to the new server, which is in the /etc/gitlab directory

2. Execute the gitlab-ctl reconfigure command to make the configuration take effect

3. Restart the service gitlab-ctl restart, and then access will be normal

Guess you like

Origin blog.csdn.net/xiaodaiwang/article/details/127531872