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
Wireless Earbuds Bluetooth Headphones 80hrs Playback Ear Buds Power Display with Noise Canceling Mic Headsets for Sports/Workout/Running Black
$24.63 (as of December 18, 2024 06:15 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.)Introducing Amazon Kindle Colorsoft Signature Edition (32 GB) – With color display, auto-adjusting front light, wireless charging, and long battery life - Metallic Black
$279.99 (as of December 18, 2024 06:15 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.)Beats Studio Pro x Kim Kardashian – Bluetooth Noise Cancelling Headphones, Personalized Spatial Audio, USB-C Lossless Audio, Apple & Android Compatibility, Up to 40 Hours Battery Life – Moon
$163.19 (as of December 18, 2024 06:15 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.