Project

General

Profile

Support #452

Updated by Daniel Curtis over 10 years ago

This is a brief guide for upgrading GitLab 7.1 to the latest current version, 7.2. 

 h3. Backup 

 * Its good to back everything up, in case the upgrade fails: 
 <pre> 
 cd /home/git/gitlab 
 sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production 
 </pre> 

 h2. Upgrade GitLab 

 * Stop the GitLab server: 
 <pre> 
 sudo service gitlab stop 
 </pre> 

 * Get latest GitLab code: 
 <pre> 
 cd /home/git/gitlab 
 sudo -u git -H git fetch --all 
 </pre> 
 #* For GitLab Community Edition: 
 <pre> 
 sudo -u git -H git checkout 7-2-stable 
 </pre> 

 * Update gitlab-shell: 
 <pre> 
 cd /home/git/gitlab-shell 
 sudo -u git -H git fetch 
 sudo -u git -H git checkout v1.9.7 
 </pre> 

 h3. Install new system dependencies 

 * The latest version of the 'rugged' gem requires pkg-config and cmake to build its native extensions: 
 <pre> 
 sudo apt-get install pkg-config cmake 
 </pre> 

 * Install libs, migrations, etc.: 
 <pre> 
 cd /home/git/gitlab 
 </pre> 
 *# For MySQL installations (note: the line below states '--without ... postgres') 
 <pre> 
 sudo -u git -H bundle install --without development test postgres --deployment 
 </pre> 
 *# For PostgreSQL installations (note: the line below states '--without ... mysql') 
 <pre> 
 sudo -u git -H bundle install --without development test mysql --deployment 
 </pre> 
 *# Run database migrations 
 <pre> 
 sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production 
 </pre> 
 *# Clean up assets and cache 
 <pre> 
 sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production 
 </pre> 
 *# Update init.d script 
 <pre> 
 sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab 
 </pre> 

 h3. Update config files 

 New configuration options for gitlab.yml 

 * There are new configuration options available for gitlab.yml. View them with the command below and apply them to your current gitlab.yml: 
 <pre> 
 git diff 7-1-stable:config/gitlab.yml.example 7-2-stable:config/gitlab.yml.example 
 </pre> 

 * Update rack attack middleware config 
 <pre> 
 sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb 
 </pre> 

 h2. Restore GitLab service 

 * Start application 
 <pre> 
 sudo service gitlab start 
 sudo service nginx restart 
 </pre> 

 h3. Check application status 

 * Check if GitLab and its environment are configured correctly: 
 <pre> 
 sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production 
 </pre> 

 * To make sure you didn't miss anything run a more thorough check with: 
 <pre> 
 sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production 
 </pre> 

 If all items are green, then congratulations upgrade is complete! 

 h3. Update OmniAuth configuration 

 When using Google omniauth login, changes of the Google account required. Ensure that Contacts API and the Google+ API are enabled in the Google Developers Console. More details can be found at the integration documentation. 

 h2. Things went south? Revert to previous version (7.1) 

 # Revert the code to the previous version 
 Follow the upgrade guide from 7.0 to 7.1, except for the database migration (The backup is already migrated to the previous version) 
 # Restore from the backup: 
 <pre> 
 cd /home/git/gitlab 
 sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production 
 </pre> 

 h2. Resources 

 * https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/7.1-to-7.2.md 

Back