instructions of how to upgrade from non-Debian installations
This commit is contained in:
parent
418b1b81b1
commit
edec704950
1 changed files with 36 additions and 22 deletions
58
debian/README.Debian
vendored
58
debian/README.Debian
vendored
|
@ -64,10 +64,7 @@ In Debian, the rake command has to be called by the gitlab user from app home
|
||||||
directory /usr/share/gitlab and with the environment variables from
|
directory /usr/share/gitlab and with the environment variables from
|
||||||
/etc/gitlab/gitlab-debian.conf set. So above command could be run like:
|
/etc/gitlab/gitlab-debian.conf set. So above command could be run like:
|
||||||
|
|
||||||
# su gitlab
|
$ runuser -u gitlab -- sh -c 'cd /usr/share/gitlab && export $(cat /etc/gitlab/gitlab-debian.conf) && rake XXX RAILS_ENV=production'
|
||||||
$ cd /usr/share/gitlab
|
|
||||||
$ export $(cat /etc/gitlab/gitlab-debian.conf)
|
|
||||||
$ rake XXX RAILS_ENV=production
|
|
||||||
|
|
||||||
One useful command to run in this environment is:
|
One useful command to run in this environment is:
|
||||||
|
|
||||||
|
@ -96,29 +93,46 @@ Migrating from non-Debian gitlab
|
||||||
- the repositories/ directory
|
- the repositories/ directory
|
||||||
- the public/uploads/ directory
|
- the public/uploads/ directory
|
||||||
- your .ssh/authorized_keys
|
- your .ssh/authorized_keys
|
||||||
1. Rename your old database to gitlab_production and set the user gitlab as
|
1. Remove the init script for your old gitlab installation, like:
|
||||||
|
$ rm /etc/init.d/gitlab
|
||||||
|
2. Install Debian gitlab:
|
||||||
|
$ apt-get install gitlab
|
||||||
|
3. Stop gitlab services:
|
||||||
|
$ systemctl stop gitlab.target
|
||||||
|
4. Rename your old database to gitlab_production and set the user gitlab as
|
||||||
its owner and the owner of all its tables, sequences and views
|
its owner and the owner of all its tables, sequences and views
|
||||||
2. Copy your old repository directory to /var/lib/gitlab/repositories/
|
$ su - postgres
|
||||||
3. Copy your old public/uploads/ directory to /var/lib/gitlab/public/uploads/
|
$ psql
|
||||||
4. Copy your old .ssh/authorized_keys to /var/lib/gitlab/.ssh/authorized_keys
|
# drop database gitlab_production;
|
||||||
5. Start gitlab using `systemctl start gitlab.target`
|
# alter database gitlabhq_production rename to gitlab_production;
|
||||||
6. Check the status of your installation using gitlab:check (see section
|
# alter database gitlab_production owner to gitlab;
|
||||||
above). The output of that command will tell you the necessary remaining
|
# \q
|
||||||
fixes. You might be told to run:
|
$ for tbl in `psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" gitlab_production` ; do psql -c "alter table \"$tbl\" owner to gitlab" gitlab_production ; done
|
||||||
|
$ for tbl in `psql -qAt -c "select sequence_name from information_schema.sequences where sequence_schema = 'public';" gitlab_production` ; do psql -c "alter table \"$tbl\" owner to gitlab" gitlab_production ; done
|
||||||
$ sudo chmod -R ug+rwX,o-rwx /var/lib/gitlab/repositories/
|
5. Copy your old repository directory to /var/lib/gitlab/repositories/
|
||||||
$ sudo -u gitlab -H /usr/share/gitlab-shell/bin/create-hooks
|
6. Copy your old public/uploads/ directory to /var/lib/gitlab/public/uploads/
|
||||||
$ sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production
|
7. Copy your old .ssh/authorized_keys to /var/lib/gitlab/.ssh/authorized_keys
|
||||||
|
8. Fix your /var/lib/gitlab/.ssh/authorized_keys to contain the right path to gitlab-shell like:
|
||||||
See the last section of how to execute the db:migrate command.
|
$ sed -i 's/^command="[^ ]\+gitlab-shell /command="\/usr\/share\/gitlab-shell\/bin\/gitlab-shell /' /usr/share/gitlab/.ssh/authorized_keys
|
||||||
|
9. Fix permission:
|
||||||
|
$ chown -R gitlab:gitlab /var/lib/gitlab/repositories/ /var/lib/gitlab/public/uploads/ /var/lib/gitlab/.ssh/authorized_keys
|
||||||
|
$ chmod -R ug+rwX,o-rwx /var/lib/gitlab/repositories/
|
||||||
|
$ find /var/lib/gitlab/public/uploads -type f -exec chmod 0644 {} \;
|
||||||
|
$ find /var/lib/gitlab/public/uploads -type d -not -path /var/lib/gitlab/public/uploads -exec chmod 0700 {} \;
|
||||||
|
10. Migrate the database:
|
||||||
|
$ runuser -u gitlab -- sh -c 'cd /usr/share/gitlab && export $(cat /etc/gitlab/gitlab-debian.conf) && rake db:migrate RAILS_ENV=production'
|
||||||
|
11. Fix hooks:
|
||||||
|
# su gitlab
|
||||||
|
$ /usr/share/gitlab-shell/bin/create-hooks
|
||||||
|
12. Start gitlab:
|
||||||
|
$ systemctl start gitlab.target
|
||||||
|
13. Check the installation:
|
||||||
|
$ runuser -u gitlab -- sh -c 'cd /usr/share/gitlab && export $(cat /etc/gitlab/gitlab-debian.conf) && rake gitlab:check RAILS_ENV=production'
|
||||||
|
|
||||||
Resetting admin password without web interface
|
Resetting admin password without web interface
|
||||||
==============================================
|
==============================================
|
||||||
|
|
||||||
# su gitlab
|
$ runuser -u gitlab -- sh -c 'cd /usr/share/gitlab && export $(cat /etc/gitlab/gitlab-debian.conf) && rails console production'
|
||||||
$ cd /usr/share/gitlab
|
|
||||||
$ export $(cat /etc/gitlab/gitlab-debian.conf)
|
|
||||||
$ rails console production
|
|
||||||
irb(main):001:0> user = User.where(admin: true).first
|
irb(main):001:0> user = User.where(admin: true).first
|
||||||
irb(main):002:0> user.password = 'secret_pass'
|
irb(main):002:0> user.password = 'secret_pass'
|
||||||
irb(main):003:0> user.password_confirmation = 'secret_pass'
|
irb(main):003:0> user.password_confirmation = 'secret_pass'
|
||||||
|
|
Loading…
Reference in a new issue