Commit 1f7d485d33b38acf77d26295945a9392708b5ff0
1 parent
97b58d14
Exists in
master
and in
4 other branches
Prepare doc for update from 6.0 to 6.1
Showing
1 changed file
with
91 additions
and
0 deletions
Show diff stats
| @@ -0,0 +1,91 @@ | @@ -0,0 +1,91 @@ | ||
| 1 | +# From 6.0 to 6.1 | ||
| 2 | + | ||
| 3 | +### 0. Backup | ||
| 4 | + | ||
| 5 | +It's useful to make a backup just in case things go south: | ||
| 6 | +(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version) | ||
| 7 | + | ||
| 8 | +```bash | ||
| 9 | +cd /home/git/gitlab | ||
| 10 | +sudo -u git -H RAILS_ENV=production bundle exec rake gitlab:backup:create | ||
| 11 | +``` | ||
| 12 | + | ||
| 13 | +### 1. Stop server | ||
| 14 | + | ||
| 15 | + sudo service gitlab stop | ||
| 16 | + | ||
| 17 | +### 2. Get latest code | ||
| 18 | + | ||
| 19 | +```bash | ||
| 20 | +cd /home/git/gitlab | ||
| 21 | +sudo -u git -H git fetch | ||
| 22 | +sudo -u git -H git checkout 6-1-stable | ||
| 23 | +``` | ||
| 24 | + | ||
| 25 | +### 3. Update gitlab-shell | ||
| 26 | + | ||
| 27 | +```bash | ||
| 28 | +cd /home/git/gitlab-shell | ||
| 29 | +sudo -u git -H git fetch | ||
| 30 | +sudo -u git -H git checkout v1.7.0 | ||
| 31 | +``` | ||
| 32 | + | ||
| 33 | +### 4. Install libs, migrations, etc. | ||
| 34 | + | ||
| 35 | +```bash | ||
| 36 | +cd /home/git/gitlab | ||
| 37 | + | ||
| 38 | +# MySQL | ||
| 39 | +sudo -u git -H bundle install --without development test postgres --deployment | ||
| 40 | + | ||
| 41 | +#PostgreSQL | ||
| 42 | +sudo -u git -H bundle install --without development test mysql --deployment | ||
| 43 | + | ||
| 44 | + | ||
| 45 | +sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production | ||
| 46 | +sudo -u git -H bundle exec rake migrate_iids RAILS_ENV=production | ||
| 47 | +sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production | ||
| 48 | +``` | ||
| 49 | + | ||
| 50 | +### 5. Update config files | ||
| 51 | + | ||
| 52 | +* Make `/home/git/gitlab/config/gitlab.yml` same as https://github.com/gitlabhq/gitlabhq/blob/5-4-stable/config/gitlab.yml.example but with your settings. | ||
| 53 | +* Make `/home/git/gitlab/config/unicorn.rb` same as https://github.com/gitlabhq/gitlabhq/blob/5-4-stable/config/unicorn.rb.example but with your settings. | ||
| 54 | + | ||
| 55 | +### 6. Update Init script | ||
| 56 | + | ||
| 57 | +```bash | ||
| 58 | +sudo rm /etc/init.d/gitlab | ||
| 59 | +sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/6-1-stable/lib/support/init.d/gitlab | ||
| 60 | +sudo chmod +x /etc/init.d/gitlab | ||
| 61 | +``` | ||
| 62 | + | ||
| 63 | +### 7. Start application | ||
| 64 | + | ||
| 65 | + sudo service gitlab start | ||
| 66 | + sudo service nginx restart | ||
| 67 | + | ||
| 68 | +### 8. Check application status | ||
| 69 | + | ||
| 70 | +Check if GitLab and its environment are configured correctly: | ||
| 71 | + | ||
| 72 | + sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production | ||
| 73 | + | ||
| 74 | +To make sure you didn't miss anything run a more thorough check with: | ||
| 75 | + | ||
| 76 | + sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production | ||
| 77 | + | ||
| 78 | +If all items are green, then congratulations upgrade complete! | ||
| 79 | + | ||
| 80 | +## Things went south? Revert to previous version (6.0) | ||
| 81 | + | ||
| 82 | +### 1. Revert the code to the previous version | ||
| 83 | +Follow the [`upgrade guide from 5.4 to 6.0`](5.4-to-6.0.md), except for the database migration | ||
| 84 | +(The backup is already migrated to the previous version) | ||
| 85 | + | ||
| 86 | +### 2. Restore from the backup: | ||
| 87 | + | ||
| 88 | +```bash | ||
| 89 | +cd /home/git/gitlab | ||
| 90 | +sudo -u git -H RAILS_ENV=production bundle exec rake gitlab:backup:restore | ||
| 91 | +``` |