2013-04-30 03:29:30 -04:00
# From 4.1 to 4.2
2017-02-06 09:46:58 -05:00
*Make sure you view this [upgrade guide from the `master` branch ](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/4.1-to-4.2.md ) for the most up to date instructions.*
2013-04-30 03:29:30 -04:00
2014-04-24 18:48:22 -04:00
## 1. Stop server & Resque
2013-04-30 03:29:30 -04:00
sudo service gitlab stop
2014-04-24 18:48:22 -04:00
## 2. Update code & DB
2013-04-30 03:29:30 -04:00
```bash
2013-05-06 22:12:02 -04:00
#Set the working directory
cd /home/gitlab/gitlab/
2013-04-30 03:29:30 -04:00
# Get latest code
2013-10-02 03:29:40 -04:00
sudo -u gitlab -H git fetch
2013-04-30 03:29:30 -04:00
2013-10-02 03:29:40 -04:00
sudo -u gitlab -H git checkout 4-2-stable
2013-04-30 03:29:30 -04:00
2016-06-01 11:01:14 -04:00
# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0
# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to
# `gem "modernizr-rails", "2.7.1"``
sudo -u gitlab -H vim Gemfile
# Run a bundle install without deployment to generate the new Gemfile
sudo -u gitlab -H bundle install --without development test postgres --no-deployment
# Install libs (with deployment this time)
2013-10-02 03:29:40 -04:00
sudo -u gitlab -H bundle install --without development test postgres --deployment
2013-04-30 03:29:30 -04:00
# update db
2013-10-02 03:29:40 -04:00
sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production
2013-04-30 03:29:30 -04:00
```
2014-04-24 18:48:22 -04:00
## 3. Check GitLab's status
2013-04-30 03:29:30 -04:00
```bash
sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production
```
2014-04-24 18:48:22 -04:00
## 4. Start all
2013-04-30 03:29:30 -04:00
sudo service gitlab start