Upgrading my Gitlab instance was long overdue. Since I had to upgrade over 2 major versions, I decided to share my upgrade approach and implementation plan in this post. There are some special commands involved in sameersbn/docker-gitlab.
Gitlab Upgrade Approach
Creating Backups
Advertisement Begins
Advertisement End
Make sure you configure GITLAB_BACKUP_DIR
external to your container and set up something like AWS S3 storage backups in addition to local harddrive backup. Your data is almost guaranteed to be safe of AWS S3, however the reason I recommend two modes of backup is in case one method fails (e.g. no internet connection or AWS credential expiry.) You will be very happy to realize that a local filesystem backup is still available.
Backup script
docker exec -it gitlab_gitlab_1 /bin/sh
# /sbin/entrypoint.sh app:rake gitlab:backup:create
Upgrade Procedure
Affiliate Content Start
New Amazon Fire HD 8 tablet, 8” HD Display, 3GB memory, 32GB, designed for portable entertainment, Black, (2024 release)
$99.99 (as of November 17, 2024 02:36 GMT +08:00 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Wireless Earbuds Bluetooth Headphones with Mic 50H Playback Deep Bass Stereo Ear Buds with LED Power Display Charging Case IPX7 Waterproof in-Ear Earphones for Laptop Pad Tablet Android/iOS Phones
$19.99 (as of November 17, 2024 02:36 GMT +08:00 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)USB-C to 3.5mm Audio Headphone Adapter - HiFi 2 Pack Compatible with Apple iPhone 16 15 Samsung Galaxy S24 S23 S22 S21 Plus Pro Max Ultra Pixel iPad - Type C to Jack Dongle Adapter
$9.99 (as of November 17, 2024 02:36 GMT +08:00 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Affiliate Content End
Advertisement Begins
Advertisement End
docker-compose down
echo "Upgrade postgres, redis versions"
docker-compose up
echo "Confirm new version of postgres and redis are running using docker ps"
docker-compose down
docker-compose stop gitlab
docker-compose rm gitlab
echo "Change version from x to 11.11.0 in your docker-compose.yml file - required migration path before going to 12.2.5"
docker-compose up
echo "confirm usng gitlab admin login that new version is installed."
docker-compose down
echo "Change version to 12.2.5 in docker-compose.yml"
Docker-compose stop gitlab
Docker-compose rm gitlab
Docker-compose up -d
docker-compose logs -tf
Setting up a DEV environment to practice the whole change implementation
Use this to setup a (local) dev environment, load in your data from backup and practise the whole change implementation before doing in Production. Any issues you find can be adopted into the change implementation plan.
Kitchen Multi-Timer Pro
Now you’re cooking
Multi Timer Pro is your ultimate meal prep companion, keeping track of multiple cooking times and making adjustments on the fly. Give it a try today and become a better home cook!
Create dev environment
Docker-compose down -v
Docker-compose up -d
Docker-compose logs -tf
docker exec -it gitlab_gitlab_1 /bin/sh
# /sbin/entrypoint.sh app:rake db:setup
# /sbin/entrypoint.sh app:rake gitlab:backup:restore BACKUP=1568373821
Yes
Yes
# exit
docker-compose restart
Conclusion
Let me know in the comments any issues you came across or clarifications you need. In another post I explain how to deploy Gitlab behind Traefik reverse proxy.