Commit ca9f23d3 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'docs-bprescott-migrations-20200323' into 'master'

Improvements to migrations docs

See merge request gitlab-org/gitlab!27834
parents 2a5c9be1 df3f8dd8
...@@ -255,7 +255,10 @@ sudo gitlab-rake gitlab:exclusive_lease:clear[project_housekeeping:4] ...@@ -255,7 +255,10 @@ sudo gitlab-rake gitlab:exclusive_lease:clear[project_housekeeping:4]
## Display status of database migrations ## Display status of database migrations
To check the status of migrations, you can use the following rake task: See the [upgrade documentation](../../update/README.md#checking-for-background-migrations-before-upgrading)
for how to check that migrations are complete when upgrading GitLab.
To check the status of specific migrations, you can use the following rake task:
```shell ```shell
sudo gitlab-rake db:migrate:status sudo gitlab-rake db:migrate:status
......
...@@ -122,13 +122,15 @@ If using GitLab 12.9 and newer, run: ...@@ -122,13 +122,15 @@ If using GitLab 12.9 and newer, run:
sudo gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining' sudo gitlab-rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
``` ```
If using GitLab 12.8 and older, run the following using a Rails console: If using GitLab 12.8 and older, run the following using a [Rails console](../administration/troubleshooting/debug.md#starting-a-rails-console):
```ruby ```ruby
puts Sidekiq::Queue.new("background_migration").size puts Sidekiq::Queue.new("background_migration").size
Sidekiq::ScheduledSet.new.select { |r| r.klass == 'BackgroundMigrationWorker' }.size Sidekiq::ScheduledSet.new.select { |r| r.klass == 'BackgroundMigrationWorker' }.size
``` ```
---
**For installations from source** **For installations from source**
If using GitLab 12.9 and newer, run: If using GitLab 12.9 and newer, run:
...@@ -138,13 +140,16 @@ cd /home/git/gitlab ...@@ -138,13 +140,16 @@ cd /home/git/gitlab
sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::BackgroundMigration.remaining' sudo -u git -H bundle exec rails runner -e production 'puts Gitlab::BackgroundMigration.remaining'
``` ```
If using GitLab 12.8 and older, run the following using a Rails console: If using GitLab 12.8 and older, run the following using a [Rails console](../administration/troubleshooting/debug.md#starting-a-rails-console):
```ruby ```ruby
puts Sidekiq::Queue.new("background_migration").size puts Sidekiq::Queue.new("background_migration").size
Sidekiq::ScheduledSet.new.select { |r| r.klass == 'BackgroundMigrationWorker' }.size Sidekiq::ScheduledSet.new.select { |r| r.klass == 'BackgroundMigrationWorker' }.size
``` ```
There is also a [rake task](../administration/raketasks/maintenance.md#display-status-of-database-migrations)
for displaying the status of each database migration.
## Upgrading to a new major version ## Upgrading to a new major version
Major versions are reserved for backwards incompatible changes. We recommend that Major versions are reserved for backwards incompatible changes. We recommend that
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment