From f566b5f89477db157575b161256f06599aa149ac Mon Sep 17 00:00:00 2001 From: stephan48 Date: Wed, 6 Mar 2024 01:37:52 +0100 Subject: [PATCH] --- posts/2024-03-06-restore-gitlab.mdwn | 59 +++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/posts/2024-03-06-restore-gitlab.mdwn b/posts/2024-03-06-restore-gitlab.mdwn index 1fb77da..8f3906c 100644 --- a/posts/2024-03-06-restore-gitlab.mdwn +++ b/posts/2024-03-06-restore-gitlab.mdwn @@ -2,7 +2,7 @@ This is opinionated for gitlab.xiph.org, the old VM is a buster, the new one a b - Get a VM - Follow https://about.gitlab.com/install/#debian until just before installing gitlab itself -- Make sure to downgrade the apt sources list as needed if your OS is too new for the old gitlab version :/ +- Make sure to downgrade the apt sources list as needed if your OS is too new for the old gitlab version(for me bullseye worked) :/ - Do apt update - Install the gitlab version from the backup i.e. if the Backupfile is named "/var/opt/gitlab/backups/1687588575_2023_06_24_16.0.5_gitlab_backup.tar" you want 16.0.5-ce.0 - Copy over the requesite file from /etc/gitlab/config_backup/gitlab_config_*2023_06_24* and extract to /etc/gitlab/ @@ -95,3 +95,60 @@ gitlab-ctl start ``` apt install gitlab-ce=16.0.8-ce.0 ``` +- oh you are no admin? follow - https://forum.gitlab.com/t/how-do-i-change-my-profile-to-admin/35888 + +``` +# gitlab-rails console -e production +-------------------------------------------------------------------------------- + Ruby: ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux] + GitLab: 16.0.8 (267ff69e3cc) FOSS + GitLab Shell: 14.20.0 + PostgreSQL: 13.11 +------------------------------------------------------------[ booted in 41.50s ] +Loading production environment (Rails 6.1.7.2) +irb(main):001:0> +irb(main):002:0> user = User.find_by(username: 'stephan48') +=> # +irb(main):003:0> user.admin = true +=> true +irb(main):004:0> user.save! +=> true +irb(main):005:0> +``` + +- Check for background migrations - https://gitlab-restore.xiph.org/admin/background_migrations +- Before the next step change the /etc/apt/sources.list.d/gitlab_gitlab-ce.list back to bookworm +- Perform the next upgrade + +``` +apt update +apt install gitlab-ce=16.1.6-ce.0 +``` + +- Wait +- In the meantime do a backup on "prod" + +``` +gitlab-backup create +``` + +- Gitlab wants a redis restart after the upgrade + +``` +gitlab-ctl restart redis +``` + +- Wait for the instance coming up and check background migrations - it actually had to do stuff here + +- Do the next step (hint you can add "-d" to already download the package while waiting...) + +``` +apt install gitlab-ce=16.2.9-ce.0 +``` + +- After we are finished, gitlab wants us to upgrade postgres - we oblige + +``` +gitlab-ctl pg-upgrade -V 14 +``` + -- 2.30.2