3 # gitlab-ctl implementing similar commands as gitlab omnibus package does
7 auto_migrations_skip_file=/etc/gitlab/skip-auto-migrations
14 # Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
16 gitlab-rake db:migrate "$@"
19 # GitLab | Create a backup of the GitLab system
21 gitlab-rake gitlab:backup:create "$@"
24 # http://docs.gitlab.com/ce/administration/restart_gitlab.html#installations-from-source
29 # Run backup before package upgrade
30 # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8.8.1+ce.0/config/templates/package-scripts/preinst.erb#L10
32 if [ -f $auto_migrations_skip_file ]; then
33 echo >&2 "Found $auto_migrations_skip_file, skipping auto backup..."
37 if ! backup SKIP=repositories,uploads,builds,artifacts,lfs,registry; then
40 Backup failed! If you want to skip this backup, run the following command and try again:
42 touch ${auto_migrations_skip_file}
49 # Run migrations after a package upgrade
50 # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8.8.1+ce.0/config/templates/package-scripts/posttrans.erb
51 # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8.8.1+ce.0/files/gitlab-ctl-commands/upgrade.rb
58 If you need to roll back to the previous version you can
59 use the database backup made during the upgrade (scroll up for the filename).