Created
March 4, 2023 10:46
-
-
Save alansenairj/d9862acd9c9ca7af921f9d30c89a835b to your computer and use it in GitHub Desktop.
setps to upgrade gitlab server from 11.8.2 to 15.9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# instalação limpa | |
yum update | |
yum remove kernel* kernel-uek* | |
yum install -y policycoreutils-python openssh-server perl wget screen | |
systemctl enable --now postfix | |
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash | |
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash | |
systemctl disable firewalld | |
systemctl stop firewalld | |
yum install nfs-utils | |
yum install -y oracle-golang-release-el7 | |
yum install -y golang | |
yum install rsync | |
EXTERNAL_URL="http://gitlab3.csivix.com.br" yum install -y gitlab-ce | |
# instalar git mais recente | |
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | |
yum install -y epel-release | |
yum remove -y git | |
yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm | |
yum install -y git | |
git --version | |
# passos do upgrade | |
yum install gitlab-ee-11.8.2-ee.0.el7 | |
gitlab-ctl reconfigure | |
## montar backup e restaurar | |
showmount -e 10.1.1.245 | |
vi /etc/fstab | |
mount -a | |
## mover arquivo de backup | |
cd /backup/ | |
gzip -d 1677189846_2023_02_23_11.8.2-ee_gitlab_backup.tar.gz | |
cp 1677189846_2023_02_23_11.8.2-ee_gitlab_backup.tar /var/opt/gitlab/backups | |
cd /var/opt/gitlab/backups | |
chown git:git 1677189846_2023_02_23_11.8.2-ee_gitlab_backup.tar | |
# restaurar | |
yum install gitlab-ee-11.8.2 | |
gitlab-ctl reconfigure | |
gitlab-ctl stop unicorn | |
gitlab-ctl stop sidekiq | |
gitlab-ctl stop puma | |
gitlab-ctl status | |
gitlab-rake gitlab:backup:restore BACKUP=1677189846_2023_02_23_11.8.2-ee | |
gitlab-ctl restart | |
gitlab-rake gitlab:check SANITIZE=true | |
gitlab-rake gitlab:artifacts:check | |
gitlab-rake gitlab:lfs:check | |
gitlab-rake gitlab:uploads:check | |
yum install -y gitlab-ee-11.11.8 | |
gitlab-ctl pg-upgrade | |
# path de upgrade | |
12.0.12 => 12.1.17 => 12.10.14 => 13.0.14 => 13.1.11 => 13.8.8 => 13.12.15 => 14.0.12 => 14.3.6 => 14.9.5 => 14.10.5 => 15.0.5 => 15.4.6 => 15.9.1 | |
## upgrade https://gitlab-com.gitlab.io/support/toolbox/upgrade-path/?current=11.11.8&distro=centos&auto=true&edition=ce | |
yum install -y gitlab-ce-12.0.12 | |
# erro que não consegue migrar para hashed | |
#https://gitlab3.csivix.com.br/admin/background_jobs = OpenSSL::Cipher::CipherError: | |
### https://docs.gitlab.com/ee/raketasks/backup_restore.html#reset-runner-registration-tokens | |
#### https://forum.gitlab.com/t/problem-with-background-migration/73436/5 | |
gitlab-rake db:migrate | |
gitlab-rails dbconsole | |
UPDATE projects SET runners_token = null, runners_token_encrypted = null; | |
UPDATE namespaces SET runners_token = null, runners_token_encrypted = null; | |
UPDATE application_settings SET runners_registration_token_encrypted = null; | |
UPDATE application_settings SET encrypted_ci_jwt_signing_key = null; | |
UPDATE ci_runners SET token = null, token_encrypted = null; | |
UPDATE ci_builds SET token = null, token_encrypted = null; | |
ctrl+d | |
gitlab-rake gitlab:storage:migrate_to_hashed | |
gitlab-rake gitlab:storage:hashed_projects | |
gitlab-rake gitlab:storage:legacy_projects | |
yum install -y gitlab-ce-12.1.17 | |
yum install -y gitlab-ce-12.10.14 | |
gitlab-ctl restart | |
yum install -y gitlab-ce-13.0.14 | |
yum install -y gitlab-ce-13.1.11 | |
yum install -y gitlab-ce-13.8.8 | |
yum install -y gitlab-ce-13.12.15 | |
gitlab-rake gitlab:env:info | |
yum install -y gitlab-ce-14.0.12 | |
gitlab-rake db:migrate | |
gitlab-ctl reconfigure | |
gitlab-ctl restart | |
yum install -y gitlab-ce-14.3.6 | |
# olhar o tempo que a migração está rodando antes de atualizar. demorou uns 10 minutos | |
https://gitlab3.csivix.com.br/admin/background_migrations | |
gitlab-rake db:migrate | |
gitlab-ctl reconfigure | |
gitlab-ctl restart | |
### testar acesso aos repos | |
## acessar novamente https://gitlab3.csivix.com.br/admin/background_migrations -->demorou mais uns 5 minutos | |
yum install -y gitlab-ce-14.9.5 | |
https://gitlab3.csivix.com.br/admin/background_migrations --> demorou 20 minutos | |
gitlab-ctl reconfigure | |
gitlab-ctl restart | |
yum install -y gitlab-ce-14.3.6 | |
yum install -y gitlab-ce-14.9.5 | |
gitlab-ctl restart | |
sleep 20m && yum install -y gitlab-ce-14.10.5 && sleep 30m && yum install -y gitlab-ce-15.0.5 && sleep 25m | |
yum install -y gitlab-ce-14.10.5 && sleep 30m && yum install -y gitlab-ce-15.0.5 && gitlab-ctl restart | |
sleep 25m && yum install -y gitlab-ce-15.4.6 && sleep 30m && yum install -y gitlab-ce-15.9.1 && gitlab-ctl restart | |
# comandos úteis | |
gitlab-rake gitlab:env:info | |
gitlab-rake gitlab:storage:legacy_projects | |
gitlab-rake gitlab:storage:legacy_attachments | |
gitlab-rake gitlab:storage:hashed_projects | |
gitlab-rake gitlab:storage:migrate_to_hashed | |
# pastas gitlab | |
/etc/gitlab | |
/var/log/gitlab | |
/var/opt/gitlab | |
/opt/gitlab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment