upgrader.md 2.39 KB
Newer Older
1
# GitLab Upgrader 
2

dosire's avatar
dosire committed
3 4 5 6
GitLab Upgrader - a ruby script that allows you easily upgrade GitLab to latest minor version.
For example it can update your application from 6.4 to latest GitLab 6 version (like 6.6.1).
You still need to create a a backup and manually restart GitLab after runnning the script but all other operations are done by this upgrade script.
If you have local changes to your GitLab repository the script will stash them and you need to use `git stash pop` after running the script.
7

dosire's avatar
dosire committed
8
__GitLab Upgrader is available only for GitLab version 6.4.2 or higher__
9

10 11 12 13 14 15 16 17 18 19 20
### 0. Backup

    cd /home/git/gitlab
    sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production

### 1. Stop server

    sudo service gitlab stop

### 2. Run gitlab upgrade tool

21
    # Starting with GitLab version 7.0 upgrader script has been moved to bin directory
22
    cd /home/git/gitlab
23
    if [ -f bin/upgrade.rb ]; then sudo -u git -H ruby bin/upgrade.rb; else sudo -u git -H ruby script/upgrade.rb; fi
24

25
    # to perform a non-interactive install (no user input required) you can add -y
26
    # if [ -f bin/upgrade.rb ]; then sudo -u git -H ruby bin/upgrade.rb -y; else sudo -u git -H ruby script/upgrade.rb -y; fi
27 28 29 30 31

### 3. Start application

    sudo service gitlab start
    sudo service nginx restart
32 33 34

### 4. Check application status

35
Check if GitLab and its dependencies are configured correctly:
36 37

    sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
38

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

41
### 5. Upgrade GitLab Shell (if needed)
42

43 44
If the `gitlab:check` task reports an outdated version of gitlab-shell you should upgrade it.
Upgrade it by running the commands below after replacing 1.9.4 with the correct version number:
45 46 47 48 49 50

```
cd /home/git/gitlab-shell
sudo -u git -H git fetch
sudo -u git -H git checkout v1.9.4
```
51 52 53

### One line upgrade command

54 55
You've read through the entire guide and probably already did all the steps one by one.
Here is a one line command with step 1 to 4 for the next time you upgrade:
56

57 58
```bash
cd /home/git/gitlab; sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production; \
Marin Jankovski's avatar
Marin Jankovski committed
59 60 61
  sudo service gitlab stop; \
  if [ -f bin/upgrade.rb ]; then sudo -u git -H ruby bin/upgrade.rb -y; else sudo -u git -H ruby script/upgrade.rb -y; fi; \
  sudo service gitlab start; \
62 63
  sudo service nginx restart; sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
```