Commit 20c3cbb18cfc414e144e5cb214d6b663ba17f828

Authored by Jacob Vosmaer
1 parent 1c42cc35

Update monster update guide to 6.0-to-6.7

Showing 2 changed files with 142 additions and 127 deletions   Show diff stats
doc/update/6.0-to-6.5.md
... ... @@ -1,127 +0,0 @@
1   -# From 6.0 to 6.5
2   -
3   -# In 6.1 we remove a lot of deprecated code.
4   -# You should update to 6.0 before installing 6.1 or higher so all the necessary conversions are run.
5   -
6   -### Deprecations
7   -
8   -#### Global issue numbers
9   -
10   -As of 6.1 issue numbers are project specific. This means all issues are renumbered and get a new number in their url. If you use an old issue number url and the issue number does not exist yet you are redirected to the new one. This conversion does not trigger if the old number already exists for this project, this is unlikely but will happen with old issues and large projects.
11   -
12   -### 0. Backup
13   -
14   -It's useful to make a backup just in case things go south:
15   -(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
16   -
17   -```bash
18   -cd /home/git/gitlab
19   -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
20   -```
21   -
22   -### 1. Stop server
23   -
24   - sudo service gitlab stop
25   -
26   -### 2. Get latest code
27   -
28   -```bash
29   -cd /home/git/gitlab
30   -sudo -u git -H git fetch --all
31   -sudo -u git -H git checkout 6-5-stable
32   -# For GitLab Enterprise Edition: sudo -u git -H git checkout 6-5-stable-ee
33   -```
34   -
35   -
36   -### 3. Install additional packages
37   -
38   -```bash
39   -# Add support for lograte for better log file handling
40   -sudo apt-get install logrotate
41   -```
42   -
43   -### 4. Update gitlab-shell
44   -
45   -```bash
46   -cd /home/git/gitlab-shell
47   -sudo -u git -H git fetch
48   -sudo -u git -H git checkout v1.8.0 # Addresses multiple critical security vulnerabilities
49   -```
50   -
51   -### 5. Install libs, migrations, etc.
52   -
53   -```bash
54   -cd /home/git/gitlab
55   -
56   -# MySQL installations (note: the line below states '--without ... postgres')
57   -sudo -u git -H bundle install --without development test postgres --deployment
58   -
59   -# PostgreSQL installations (note: the line below states '--without ... mysql')
60   -sudo -u git -H bundle install --without development test mysql --deployment
61   -
62   -
63   -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
64   -sudo -u git -H bundle exec rake migrate_iids RAILS_ENV=production
65   -sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production
66   -sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
67   -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production
68   -```
69   -
70   -### 6. Update config files
71   -
72   -TIP: to see what changed in gitlab.yml.example in this release use next command:
73   -
74   -```
75   -git diff 6-0-stable:config/gitlab.yml.example 6-5-stable:config/gitlab.yml.example
76   -```
77   -
78   -* Make `/home/git/gitlab/config/gitlab.yml` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-5-stable/config/gitlab.yml.example but with your settings.
79   -* Make `/home/git/gitlab/config/unicorn.rb` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-5-stable/config/unicorn.rb.example but with your settings.
80   -* Copy rack attack middleware config
81   -
82   -```bash
83   -sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
84   -```
85   -
86   -* Set up logrotate
87   -
88   -```bash
89   -sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
90   -```
91   -
92   -### 7. Update Init script
93   -
94   -```bash
95   -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
96   -```
97   -
98   -### 8. Start application
99   -
100   - sudo service gitlab start
101   - sudo service nginx restart
102   -
103   -### 9. Check application status
104   -
105   -Check if GitLab and its environment are configured correctly:
106   -
107   - cd /home/git/gitlab
108   - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
109   -
110   -To make sure you didn't miss anything run a more thorough check with:
111   -
112   - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
113   -
114   -If all items are green, then congratulations upgrade complete!
115   -
116   -## Things went south? Revert to previous version (6.0)
117   -
118   -### 1. Revert the code to the previous version
119   -Follow the [`upgrade guide from 5.4 to 6.0`](5.4-to-6.0.md), except for the database migration
120   -(The backup is already migrated to the previous version)
121   -
122   -### 2. Restore from the backup:
123   -
124   -```bash
125   -cd /home/git/gitlab
126   -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production
127   -```
doc/update/6.0-to-6.7.md 0 → 100644
... ... @@ -0,0 +1,142 @@
  1 +# From 6.0 to 6.7
  2 +
  3 +# In 6.1 we remove a lot of deprecated code.
  4 +# You should update to 6.0 before installing 6.1 or higher so all the necessary conversions are run.
  5 +
  6 +### Deprecations
  7 +
  8 +#### Global issue numbers
  9 +
  10 +As of 6.1 issue numbers are project specific. This means all issues are renumbered and get a new number in their url. If you use an old issue number url and the issue number does not exist yet you are redirected to the new one. This conversion does not trigger if the old number already exists for this project, this is unlikely but will happen with old issues and large projects.
  11 +
  12 +### 0. Backup
  13 +
  14 +It's useful to make a backup just in case things go south:
  15 +(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
  16 +
  17 +```bash
  18 +cd /home/git/gitlab
  19 +sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
  20 +```
  21 +
  22 +### 1. Stop server
  23 +
  24 + sudo service gitlab stop
  25 +
  26 +### 2. Get latest code
  27 +
  28 +```bash
  29 +cd /home/git/gitlab
  30 +sudo -u git -H git fetch --all
  31 +```
  32 +
  33 +For Gitlab Community Edition:
  34 +
  35 +```bash
  36 +sudo -u git -H git checkout 6-7-stable
  37 +```
  38 +
  39 +OR
  40 +
  41 +For GitLab Enterprise Edition:
  42 +
  43 +```bash
  44 +sudo -u git -H git checkout 6-7-stable-ee
  45 +```
  46 +
  47 +
  48 +### 3. Install additional packages
  49 +
  50 +```bash
  51 +# Add support for lograte for better log file handling
  52 +sudo apt-get install logrotate
  53 +```
  54 +
  55 +### 4. Update gitlab-shell
  56 +
  57 +```bash
  58 +cd /home/git/gitlab-shell
  59 +sudo -u git -H git fetch
  60 +sudo -u git -H git checkout v1.9.1 # Addresses multiple critical security vulnerabilities
  61 +```
  62 +
  63 +### 5. Install libs, migrations, etc.
  64 +
  65 +```bash
  66 +cd /home/git/gitlab
  67 +
  68 +# MySQL installations (note: the line below states '--without ... postgres')
  69 +sudo -u git -H bundle install --without development test postgres --deployment
  70 +
  71 +# PostgreSQL installations (note: the line below states '--without ... mysql')
  72 +sudo -u git -H bundle install --without development test mysql --deployment
  73 +
  74 +
  75 +# Run database migrations
  76 +sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
  77 +
  78 +# Enable internal issue IDs (introduced in GitLab 6.1)
  79 +sudo -u git -H bundle exec rake migrate_iids RAILS_ENV=production
  80 +
  81 +# Clean up assets and cache
  82 +sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
  83 +```
  84 +
  85 +### 6. Update config files
  86 +
  87 +TIP: to see what changed in gitlab.yml.example in this release use next command:
  88 +
  89 +```
  90 +git diff 6-0-stable:config/gitlab.yml.example 6-7-stable:config/gitlab.yml.example
  91 +```
  92 +
  93 +* Make `/home/git/gitlab/config/gitlab.yml` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-7-stable/config/gitlab.yml.example but with your settings.
  94 +* Make `/home/git/gitlab/config/unicorn.rb` same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-7-stable/config/unicorn.rb.example but with your settings.
  95 +* Copy rack attack middleware config
  96 +
  97 +```bash
  98 +sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
  99 +```
  100 +
  101 +* Set up logrotate
  102 +
  103 +```bash
  104 +sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab
  105 +```
  106 +
  107 +### 7. Update Init script
  108 +
  109 +```bash
  110 +sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
  111 +```
  112 +
  113 +### 8. Start application
  114 +
  115 + sudo service gitlab start
  116 + sudo service nginx restart
  117 +
  118 +### 9. Check application status
  119 +
  120 +Check if GitLab and its environment are configured correctly:
  121 +
  122 + cd /home/git/gitlab
  123 + sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
  124 +
  125 +To make sure you didn't miss anything run a more thorough check with:
  126 +
  127 + sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
  128 +
  129 +If all items are green, then congratulations upgrade complete!
  130 +
  131 +## Things went south? Revert to previous version (6.0)
  132 +
  133 +### 1. Revert the code to the previous version
  134 +Follow the [`upgrade guide from 5.4 to 6.0`](5.4-to-6.0.md), except for the database migration
  135 +(The backup is already migrated to the previous version)
  136 +
  137 +### 2. Restore from the backup:
  138 +
  139 +```bash
  140 +cd /home/git/gitlab
  141 +sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production
  142 +```
... ...