3 # gitlab-ctl implementing similar commands as gitlab omnibus package does
7 auto_migrations_skip_file=/etc/gitlab/skip-auto-migrations
18 # Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
20 gitlab-rake db:migrate "$@"
23 # GitLab | Create a backup of the GitLab system
25 gitlab-rake gitlab:backup:create "$@"
28 # http://docs.gitlab.com/ce/administration/restart_gitlab.html#installations-from-source
33 # Run backup before package upgrade
34 # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8.8.1+ce.0/config/templates/package-scripts/preinst.erb#L10
36 if [ -f $auto_migrations_skip_file ]; then
37 notice "preinstall: Found $auto_migrations_skip_file, skipping auto backup..."
41 notice "preinstall: Automatically backing up only the GitLab SQL database (excluding everything else!)"
43 if ! backup SKIP=repositories,uploads,builds,artifacts,lfs,registry; then
46 Backup failed! If you want to skip this backup, run the following command and try again:
48 touch ${auto_migrations_skip_file}
55 # Run migrations after a package upgrade
56 # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8.8.1+ce.0/config/templates/package-scripts/posttrans.erb
57 # https://gitlab.com/gitlab-org/omnibus-gitlab/blob/8.8.1+ce.0/files/gitlab-ctl-commands/upgrade.rb
64 If you need to roll back to the previous version you can
65 use the database backup made during the upgrade (scroll up for the filename).