2014-04-24 18:48:22 -04:00
|
|
|
# GitLab Upgrader
|
2013-12-23 07:15:22 -05:00
|
|
|
|
2014-01-27 07:51:01 -05:00
|
|
|
GitLab Upgrader - a ruby script that allows you easily upgrade GitLab to latest minor version.
|
2014-04-24 18:48:22 -04:00
|
|
|
|
2014-01-27 07:51:01 -05:00
|
|
|
For example it can update your application from 6.4 to latest GitLab 6 version (like 6.6.1).
|
2014-04-24 18:48:22 -04:00
|
|
|
|
|
|
|
You still need to create a backup and manually restart GitLab after running the script but all other operations are done by this upgrade script.
|
|
|
|
|
2014-01-27 07:51:01 -05:00
|
|
|
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.
|
2013-12-23 07:15:22 -05:00
|
|
|
|
2014-04-24 18:48:22 -04:00
|
|
|
**GitLab Upgrader is available only for GitLab version 6.4.2 or higher.**
|
2013-12-23 09:41:06 -05:00
|
|
|
|
2014-04-24 18:48:22 -04:00
|
|
|
## 0. Backup
|
2013-12-23 07:15:22 -05:00
|
|
|
|
|
|
|
cd /home/git/gitlab
|
|
|
|
sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
|
|
|
|
|
2014-04-24 18:48:22 -04:00
|
|
|
## 1. Stop server
|
2013-12-23 07:15:22 -05:00
|
|
|
|
|
|
|
sudo service gitlab stop
|
|
|
|
|
2014-04-24 18:48:22 -04:00
|
|
|
## 2. Run GitLab upgrade tool
|
2013-12-23 07:15:22 -05:00
|
|
|
|
2014-06-02 03:39:43 -04:00
|
|
|
# Starting with GitLab version 7.0 upgrader script has been moved to bin directory
|
2013-12-23 07:15:22 -05:00
|
|
|
cd /home/git/gitlab
|
2014-06-02 03:39:43 -04:00
|
|
|
if [ -f bin/upgrade.rb ]; then sudo -u git -H ruby bin/upgrade.rb; else sudo -u git -H ruby script/upgrade.rb; fi
|
2013-12-23 07:15:22 -05:00
|
|
|
|
2014-01-23 05:44:53 -05:00
|
|
|
# to perform a non-interactive install (no user input required) you can add -y
|
2014-06-02 03:39:43 -04:00
|
|
|
# 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
|
2013-12-23 07:15:22 -05:00
|
|
|
|
2014-04-24 18:48:22 -04:00
|
|
|
## 3. Start application
|
2013-12-23 07:15:22 -05:00
|
|
|
|
|
|
|
sudo service gitlab start
|
|
|
|
sudo service nginx restart
|
2014-02-13 23:50:02 -05:00
|
|
|
|
2014-04-24 18:48:22 -04:00
|
|
|
## 4. Check application status
|
2014-02-13 23:50:02 -05:00
|
|
|
|
2014-05-28 03:28:39 -04:00
|
|
|
Check if GitLab and its dependencies are configured correctly:
|
2014-02-13 23:50:02 -05:00
|
|
|
|
|
|
|
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
|
2014-05-27 08:25:34 -04:00
|
|
|
|
2014-02-13 23:50:02 -05:00
|
|
|
If all items are green, then congratulations upgrade is complete!
|
2014-04-04 04:19:40 -04:00
|
|
|
|
2014-04-24 18:48:22 -04:00
|
|
|
## 5. Upgrade GitLab Shell (if needed)
|
|
|
|
|
|
|
|
If the `gitlab:check` task reports an outdated version of `gitlab-shell` you should upgrade it.
|
2014-05-27 08:25:34 -04:00
|
|
|
|
2014-05-28 03:28:39 -04:00
|
|
|
Upgrade it by running the commands below after replacing 1.9.4 with the correct version number:
|
2014-05-27 08:25:34 -04:00
|
|
|
|
|
|
|
```
|
|
|
|
cd /home/git/gitlab-shell
|
|
|
|
sudo -u git -H git fetch
|
|
|
|
sudo -u git -H git checkout v1.9.4
|
|
|
|
```
|
2014-04-04 04:19:40 -04:00
|
|
|
|
2014-04-24 18:48:22 -04:00
|
|
|
## One line upgrade command
|
2014-04-04 04:19:40 -04:00
|
|
|
|
2014-05-28 03:28:39 -04:00
|
|
|
You've read through the entire guide and probably already did all the steps one by one.
|
2014-04-24 18:48:22 -04:00
|
|
|
|
2014-05-28 03:28:39 -04:00
|
|
|
Here is a one line command with step 1 to 4 for the next time you upgrade:
|
2014-04-04 04:19:40 -04:00
|
|
|
|
2014-04-22 00:22:55 -04:00
|
|
|
```bash
|
|
|
|
cd /home/git/gitlab; sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production; \
|
2014-06-02 03:48:55 -04:00
|
|
|
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; \
|
2014-04-22 00:22:55 -04:00
|
|
|
sudo service nginx restart; sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
|
|
|
|
```
|