5.0-to-5.1.md 2.57 KB
Newer Older
1 2 3 4
---
comments: false
---

Yves Senn's avatar
Yves Senn committed
5
# From 5.0 to 5.1
6
*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/5.0-to-5.1.md) for the most up to date instructions.*
Yves Senn's avatar
Yves Senn committed
7

8
## Warning
9

10
GitLab 5.1 is affected by critical security vulnerability CVE-2013-4490.
11

12
## Release notes
13

14 15
- `unicorn` replaced with `puma`
- merge request cached diff will be truncated
16

17
## 1. Stop server
18 19 20

    sudo service gitlab stop

21
## 2. Get latest code
22

23 24
```bash
cd /home/git/gitlab
25 26 27 28
sudo -u git -H git fetch
sudo -u git -H git checkout 5-1-stable
```

29
## 3. Update gitlab-shell
30

31 32 33 34
```bash
cd /home/git/gitlab-shell
sudo -u git -H git fetch
sudo -u git -H git checkout v1.3.0
35 36 37 38 39
# replace your old config with the new one
sudo -u git -H mv config.yml config.yml.old
sudo -u git -H cp config.yml.example config.yml
# edit options to match old config
sudo -u git -H vi config.yml
40 41
```

42
## 4. Install libs, migrations etc
Grégoire Paris's avatar
Grégoire Paris committed
43

44 45 46 47
```bash
cd /home/git/gitlab
sudo rm tmp/sockets/gitlab.socket
sudo -u git -H cp config/puma.rb.example config/puma.rb
Grégoire Paris's avatar
Grégoire Paris committed
48

49 50 51 52 53 54 55 56 57
# 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 git -H vim Gemfile

# Run a bundle install without deployment to generate the new Gemfile
sudo -u git -H bundle install --without development test postgres --no-deployment

# Install libs (with deployment this time)
58
sudo -u git -H bundle install --without development test postgres --deployment
59

60 61
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_merge_requests RAILS_ENV=production
62
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
63 64
```

65
## 5. Update init.d script with a new one
66 67 68 69

```bash
# init.d
sudo rm /etc/init.d/gitlab
70
sudo curl --location --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/5-1-stable/init.d/gitlab
71 72 73
sudo chmod +x /etc/init.d/gitlab
```

74
## 6. MySQL grant privileges
75

76
Only if you are using MySQL:
77 78 79 80 81 82 83

```bash
mysql -u root -p
mysql> GRANT LOCK TABLES ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
mysql> \q
```

84
## 7. Start application
85 86

    sudo service gitlab start
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105

## 8. Check installation


```bash
# In 5-10 seconds lets check gitlab-shell
sudo -u git -H /home/git/gitlab-shell/bin/check

# Example of success output
# Check GitLab API access: OK
# Check directories and files:
#         /home/git/repositories: OK
#         /home/git/.ssh/authorized_keys: OK


# Now check gitlab instance
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

```