@@ -20,7 +20,7 @@ or you can run the following command
20
20
groupmod -g 500 git
21
21
```
22
22
23
- Amended the ` /etc/passwd ` file to change the uid, gid and the home directory for git
23
+ Amend the ` /etc/passwd ` file to change the uid, gid and the home directory for git
24
24
25
25
``` bash
26
26
git:x:500:500:GitLab,,,:/var/lib/git:/bin/bash
@@ -31,7 +31,7 @@ or you can run the following command
31
31
usermod -d /var/lib/git -g 500 -u 500 git
32
32
```
33
33
34
- ### 2. Move the git folder
34
+ ### 2. Copy the git folder
35
35
36
36
``` bash
37
37
cp -r /home/git /var/lib/
@@ -44,7 +44,8 @@ chown -R git:git /var/lib/git
44
44
```
45
45
46
46
### 4. Update Gitlab config files
47
- update ` ~git/gitlab/config/gitlab.yml ` , using the following command
47
+
48
+ Update ` ~git/gitlab/config/gitlab.yml ` , using the following command
48
49
49
50
``` bash
50
51
sed -i -e ' s/\/home/\/var\/lib/g' ~ git/gitlab/config/gitlab.yml
@@ -123,7 +124,8 @@ You should see the following difference after running the command
123
124
```
124
125
125
126
### 5. Update Gitlab shell config file
126
- update ` ~git/gitlab-shell/config.yml ` , using the following command
127
+
128
+ Update ` ~git/gitlab-shell/config.yml ` , using the following command
127
129
128
130
``` bash
129
131
sed -i -e ' s/\/home/\/var\/lib/g' ~ git/gitlab-shell/config.yml
@@ -159,42 +161,14 @@ sed -i -e 's/\/home/\/var\/lib/g' ~git/.ssh/authorized_keys
159
161
160
162
### 7. Update nginx config file
161
163
162
- update ` /etc/nginx/sites-enabled/gitlab ` , using the following command
164
+ Update ` /etc/nginx/sites-enabled/gitlab ` , using the following command
163
165
164
166
``` bash
165
167
sed -i -e ' s/\/home/\/var\/lib/g' /etc/nginx/sites-enabled/gitlab
166
168
```
167
169
168
170
### 8. Add/Update gitlab service and default files
169
171
170
- We need to apply the following patch to ` /etc/init.d/gitlab ` , This has been submitted as a
171
- PR already to gitlabhq. This enables to read the default file, and initialises other variables.
172
- Without this diff, other variables then also need to be defined in ` /etc/default/gitlab `
173
-
174
- ``` diff
175
- --- gitlab 2013-12-20 16:27:14.919395198 -0500
176
- +++ /etc/init.d/gitlab 2014-01-06 08:51:18.253120785 -0500
177
- @@ -31,14 +31,15 @@
178
- # internal /bin/sh variables such as PATH, EDITOR or SHELL.
179
- app_user="git"
180
- app_root="/home/$app_user/gitlab"
181
- +
182
- + # Read configuration variable file if it is present
183
- + test -f /etc/default/gitlab && . /etc/default/gitlab
184
- +
185
- pid_path="$app_root/tmp/pids"
186
- socket_path="$app_root/tmp/sockets"
187
- web_server_pid_path="$pid_path/unicorn.pid"
188
- sidekiq_pid_path="$pid_path/sidekiq.pid"
189
-
190
- - # Read configuration variable file if it is present
191
- - test -f /etc/default/gitlab && . /etc/default/gitlab
192
- -
193
- # Switch to the app_user if it is not he/she who is running the script.
194
- if [ "$USER" != "$app_user" ]; then
195
- sudo -u "$app_user" -H -i $0 "$@"; exit;
196
- ```
197
-
198
172
If you haven't already, copy the service default file, then do so, and then update the file to point to the new home directory
199
173
200
174
``` bash
@@ -217,27 +191,39 @@ cd ~git
217
191
sudo -u git -H gitlab-shell/support/rewrite-hooks.sh
218
192
```
219
193
220
- ### 10. Restart application
194
+ ### 11. Update logrotate files
195
+
196
+ ```
197
+ sed -i -e 's/\/home/\/var\/lib/g' /etc/logrotate.d/gitlab
198
+ ```
199
+
200
+ ### 12. Restart application
221
201
222
202
``` bash
223
203
sudo service gitlab restart
224
204
sudo service nginx restart
225
205
```
226
206
227
- ### 11 . Check application status
207
+ ### 13 . Check application status
228
208
229
209
Check if GitLab and its environment are configured correctly:
230
210
231
- cd ~git/gitlab
232
- sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
211
+ ``` bash
212
+ cd ~ git/gitlab
213
+ sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
214
+ ```
233
215
234
216
To make sure you didn't miss anything run a more thorough check with:
235
217
236
- cd ~git/gitlab
237
- sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
218
+ ``` bash
219
+ cd ~ git/gitlab
220
+ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
221
+ ```
238
222
239
- ### 12 . Remove old home
223
+ ### 14 . Remove old home
240
224
241
225
Once you are happy that everything is now working in the new directory, you can remove the old ` /home/git `
242
226
243
- rm -rf /home/git
227
+ ``` bash
228
+ rm -rf /home/git
229
+ ```
0 commit comments