diff options
119 files changed, 797 insertions, 18353 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 77ad4753c84..97e39ce99cb 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -268,7 +268,6 @@ Rails/Presence: - 'app/models/clusters/platforms/kubernetes.rb' - 'app/models/concerns/mentionable.rb' - 'app/models/concerns/token_authenticatable.rb' - - 'app/models/project_services/hipchat_service.rb' - 'app/models/project_services/irker_service.rb' - 'app/models/project_services/jira_service.rb' - 'app/models/project_services/kubernetes_service.rb' @@ -202,9 +202,6 @@ gem 'connection_pool', '~> 2.0' # Discord integration gem 'discordrb-webhooks-blackst0ne', '~> 3.3', require: false -# HipChat integration -gem 'hipchat', '~> 1.5.0' - # JIRA integration gem 'jira-ruby', '~> 1.4' diff --git a/Gemfile.lock b/Gemfile.lock index 0b2bd2c96bd..9aea8919287 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -363,9 +363,6 @@ GEM hashie (>= 3.0) health_check (2.6.0) rails (>= 4.0) - hipchat (1.5.2) - httparty - mimemagic html-pipeline (2.8.4) activesupport (>= 2) nokogiri (>= 1.4) @@ -1043,7 +1040,6 @@ DEPENDENCIES hangouts-chat (~> 0.0.5) hashie-forbidden_attributes health_check (~> 2.6.0) - hipchat (~> 1.5.0) html-pipeline (~> 2.8) html2text httparty (~> 0.13.3) diff --git a/app/models/project.rb b/app/models/project.rb index 8f746f6e094..58df4019450 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -147,7 +147,6 @@ class Project < ActiveRecord::Base has_one :pipelines_email_service has_one :irker_service has_one :pivotaltracker_service - has_one :hipchat_service has_one :flowdock_service has_one :assembla_service has_one :asana_service diff --git a/app/models/project_services/hipchat_service.rb b/app/models/project_services/hipchat_service.rb deleted file mode 100644 index a69b7b4c4b6..00000000000 --- a/app/models/project_services/hipchat_service.rb +++ /dev/null @@ -1,311 +0,0 @@ -# frozen_string_literal: true - -class HipchatService < Service - include ActionView::Helpers::SanitizeHelper - - MAX_COMMITS = 3 - HIPCHAT_ALLOWED_TAGS = %w[ - a b i strong em br img pre code - table th tr td caption colgroup col thead tbody tfoot - ul ol li dl dt dd - ].freeze - - prop_accessor :token, :room, :server, :color, :api_version - boolean_accessor :notify_only_broken_pipelines, :notify - validates :token, presence: true, if: :activated? - - def initialize_properties - if properties.nil? - self.properties = {} - self.notify_only_broken_pipelines = true - end - end - - def title - 'HipChat' - end - - def description - 'Private group chat and IM' - end - - def self.to_param - 'hipchat' - end - - def fields - [ - { type: 'text', name: 'token', placeholder: 'Room token', required: true }, - { type: 'text', name: 'room', placeholder: 'Room name or ID' }, - { type: 'checkbox', name: 'notify' }, - { type: 'select', name: 'color', choices: %w(yellow red green purple gray random) }, - { type: 'text', name: 'api_version', - placeholder: 'Leave blank for default (v2)' }, - { type: 'text', name: 'server', - placeholder: 'Leave blank for default. https://hipchat.example.com' }, - { type: 'checkbox', name: 'notify_only_broken_pipelines' } - ] - end - - def self.supported_events - %w(push issue confidential_issue merge_request note confidential_note tag_push pipeline) - end - - def execute(data) - return unless supported_events.include?(data[:object_kind]) - - message = create_message(data) - return unless message.present? - - gate[room].send('GitLab', message, message_options(data)) # rubocop:disable GitlabSecurity/PublicSend - end - - def test(data) - begin - result = execute(data) - rescue StandardError => error - return { success: false, result: error } - end - - { success: true, result: result } - end - - private - - def gate - options = { api_version: api_version.present? ? api_version : 'v2' } - options[:server_url] = server unless server.blank? - @gate ||= HipChat::Client.new(token, options) - end - - def message_options(data = nil) - { notify: notify.present? && Gitlab::Utils.to_boolean(notify), color: message_color(data) } - end - - def create_message(data) - object_kind = data[:object_kind] - - case object_kind - when "push", "tag_push" - create_push_message(data) - when "issue" - create_issue_message(data) unless update?(data) - when "merge_request" - create_merge_request_message(data) unless update?(data) - when "note" - create_note_message(data) - when "pipeline" - create_pipeline_message(data) if should_pipeline_be_notified?(data) - end - end - - def render_line(text) - markdown(text.lines.first.chomp, pipeline: :single_line) if text - end - - def create_push_message(push) - ref_type = Gitlab::Git.tag_ref?(push[:ref]) ? 'tag' : 'branch' - ref = Gitlab::Git.ref_name(push[:ref]) - - before = push[:before] - after = push[:after] - - message = [] - message << "#{push[:user_name]} " - - if Gitlab::Git.blank_ref?(before) - message << "pushed new #{ref_type} <a href=\""\ - "#{project_url}/commits/#{CGI.escape(ref)}\">#{ref}</a>"\ - " to #{project_link}\n" - elsif Gitlab::Git.blank_ref?(after) - message << "removed #{ref_type} <b>#{ref}</b> from <a href=\"#{project.web_url}\">#{project_name}</a> \n" - else - message << "pushed to #{ref_type} <a href=\""\ - "#{project.web_url}/commits/#{CGI.escape(ref)}\">#{ref}</a> " - message << "of <a href=\"#{project.web_url}\">#{project.full_name.gsub!(/\s/, '')}</a> " - message << "(<a href=\"#{project.web_url}/compare/#{before}...#{after}\">Compare changes</a>)" - - push[:commits].take(MAX_COMMITS).each do |commit| - message << "<br /> - #{render_line(commit[:message])} (<a href=\"#{commit[:url]}\">#{commit[:id][0..5]}</a>)" - end - - if push[:commits].count > MAX_COMMITS - message << "<br />... #{push[:commits].count - MAX_COMMITS} more commits" - end - end - - message.join - end - - def markdown(text, options = {}) - return "" unless text - - context = { - project: project, - pipeline: :email - } - - Banzai.render(text, context) - - context.merge!(options) - - html = Banzai.render_and_post_process(text, context) - sanitized_html = sanitize(html, tags: HIPCHAT_ALLOWED_TAGS, attributes: %w[href title alt]) - - sanitized_html.truncate(200, separator: ' ', omission: '...') - end - - def create_issue_message(data) - user_name = data[:user][:name] - - obj_attr = data[:object_attributes] - obj_attr = HashWithIndifferentAccess.new(obj_attr) - title = render_line(obj_attr[:title]) - state = obj_attr[:state] - issue_iid = obj_attr[:iid] - issue_url = obj_attr[:url] - description = obj_attr[:description] - - issue_link = "<a href=\"#{issue_url}\">issue ##{issue_iid}</a>" - - message = ["#{user_name} #{state} #{issue_link} in #{project_link}: <b>#{title}</b>"] - message << "<pre>#{markdown(description)}</pre>" - - message.join - end - - def create_merge_request_message(data) - user_name = data[:user][:name] - - obj_attr = data[:object_attributes] - obj_attr = HashWithIndifferentAccess.new(obj_attr) - merge_request_id = obj_attr[:iid] - state = obj_attr[:state] - description = obj_attr[:description] - title = render_line(obj_attr[:title]) - - merge_request_url = "#{project_url}/merge_requests/#{merge_request_id}" - merge_request_link = "<a href=\"#{merge_request_url}\">merge request !#{merge_request_id}</a>" - message = ["#{user_name} #{state} #{merge_request_link} in " \ - "#{project_link}: <b>#{title}</b>"] - - message << "<pre>#{markdown(description)}</pre>" - message.join - end - - def format_title(title) - "<b>#{render_line(title)}</b>" - end - - def create_note_message(data) - data = HashWithIndifferentAccess.new(data) - user_name = data[:user][:name] - - obj_attr = HashWithIndifferentAccess.new(data[:object_attributes]) - note = obj_attr[:note] - note_url = obj_attr[:url] - noteable_type = obj_attr[:noteable_type] - commit_id = nil - - case noteable_type - when "Commit" - commit_attr = HashWithIndifferentAccess.new(data[:commit]) - commit_id = commit_attr[:id] - subject_desc = commit_id - subject_desc = Commit.truncate_sha(subject_desc) - subject_type = "commit" - title = format_title(commit_attr[:message]) - when "Issue" - subj_attr = HashWithIndifferentAccess.new(data[:issue]) - subject_id = subj_attr[:iid] - subject_desc = "##{subject_id}" - subject_type = "issue" - title = format_title(subj_attr[:title]) - when "MergeRequest" - subj_attr = HashWithIndifferentAccess.new(data[:merge_request]) - subject_id = subj_attr[:iid] - subject_desc = "!#{subject_id}" - subject_type = "merge request" - title = format_title(subj_attr[:title]) - when "Snippet" - subj_attr = HashWithIndifferentAccess.new(data[:snippet]) - subject_id = subj_attr[:id] - subject_desc = "##{subject_id}" - subject_type = "snippet" - title = format_title(subj_attr[:title]) - end - - subject_html = "<a href=\"#{note_url}\">#{subject_type} #{subject_desc}</a>" - message = ["#{user_name} commented on #{subject_html} in #{project_link}: "] - message << title - - message << "<pre>#{markdown(note, ref: commit_id)}</pre>" - message.join - end - - def create_pipeline_message(data) - pipeline_attributes = data[:object_attributes] - pipeline_id = pipeline_attributes[:id] - ref_type = pipeline_attributes[:tag] ? 'tag' : 'branch' - ref = pipeline_attributes[:ref] - user_name = (data[:user] && data[:user][:name]) || 'API' - status = pipeline_attributes[:status] - duration = pipeline_attributes[:duration] - - branch_link = "<a href=\"#{project_url}/commits/#{CGI.escape(ref)}\">#{ref}</a>" - pipeline_url = "<a href=\"#{project_url}/pipelines/#{pipeline_id}\">##{pipeline_id}</a>" - - "#{project_link}: Pipeline #{pipeline_url} of #{branch_link} #{ref_type} by #{user_name} #{humanized_status(status)} in #{duration} second(s)" - end - - def message_color(data) - pipeline_status_color(data) || color || 'yellow' - end - - def pipeline_status_color(data) - return unless data && data[:object_kind] == 'pipeline' - - case data[:object_attributes][:status] - when 'success' - 'green' - else - 'red' - end - end - - def project_name - project.full_name.gsub(/\s/, '') - end - - def project_url - project.web_url - end - - def project_link - "<a href=\"#{project_url}\">#{project_name}</a>" - end - - def update?(data) - data[:object_attributes][:action] == 'update' - end - - def humanized_status(status) - case status - when 'success' - 'passed' - else - status - end - end - - def should_pipeline_be_notified?(data) - case data[:object_attributes][:status] - when 'success' - !notify_only_broken_pipelines? - when 'failed' - true - else - false - end - end -end diff --git a/app/models/service.rb b/app/models/service.rb index 9dcb0aab0a3..3461e0bfe70 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -255,7 +255,6 @@ class Service < ActiveRecord::Base external_wiki flowdock hangouts_chat - hipchat irker jira kubernetes diff --git a/changelogs/unreleased/52424-goodbye-hipchat.yml b/changelogs/unreleased/52424-goodbye-hipchat.yml new file mode 100644 index 00000000000..26dc904af5f --- /dev/null +++ b/changelogs/unreleased/52424-goodbye-hipchat.yml @@ -0,0 +1,5 @@ +--- +title: Remove HipChat integration from GitLab +merge_request: 22223 +author: +type: removed diff --git a/config/initializers/hipchat_client_patch.rb b/config/initializers/hipchat_client_patch.rb deleted file mode 100644 index aec265312bb..00000000000 --- a/config/initializers/hipchat_client_patch.rb +++ /dev/null @@ -1,14 +0,0 @@ -# This monkey patches the HTTParty used in https://github.com/hipchat/hipchat-rb. -module HipChat - class Client - connection_adapter ::Gitlab::ProxyHTTPConnectionAdapter - end - - class Room - connection_adapter ::Gitlab::ProxyHTTPConnectionAdapter - end - - class User - connection_adapter ::Gitlab::ProxyHTTPConnectionAdapter - end -end diff --git a/db/migrate/20190107151020_add_services_type_index.rb b/db/migrate/20190107151020_add_services_type_index.rb new file mode 100644 index 00000000000..26b5bd58750 --- /dev/null +++ b/db/migrate/20190107151020_add_services_type_index.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddServicesTypeIndex < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :services, :type unless index_exists?(:services, :type) + end + + def down + remove_concurrent_index :services, :type if index_exists?(:services, :type) + end +end diff --git a/db/migrate/20190107151029_remove_hipchat_services.rb b/db/migrate/20190107151029_remove_hipchat_services.rb new file mode 100644 index 00000000000..4741ec88907 --- /dev/null +++ b/db/migrate/20190107151029_remove_hipchat_services.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class RemoveHipchatServices < ActiveRecord::Migration[5.0] + DOWNTIME = false + + def up + execute "DELETE FROM services WHERE type = 'HipchatService'" + end + + def down + # no-op + end +end diff --git a/db/schema.rb b/db/schema.rb index 023eee5f33e..0f7e9ad4996 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1936,6 +1936,7 @@ ActiveRecord::Schema.define(version: 20190204115450) do t.boolean "confidential_note_events", default: true t.index ["project_id"], name: "index_services_on_project_id", using: :btree t.index ["template"], name: "index_services_on_template", using: :btree + t.index ["type"], name: "index_services_on_type", using: :btree end create_table "shards", force: :cascade do |t| diff --git a/doc/administration/container_registry.md b/doc/administration/container_registry.md index db0b3e1270c..60f1911fa2a 100644 --- a/doc/administration/container_registry.md +++ b/doc/administration/container_registry.md @@ -587,7 +587,9 @@ notifications: backoff: 1000 ``` -## Using self-signed certificates with Container Registry +## Troubleshooting + +### Using self-signed certificates with Container Registry If you're using a self-signed certificate with your Container Registry, you might encounter issues during the CI jobs like the following: @@ -599,12 +601,18 @@ Error response from daemon: Get registry.example.com/v1/users/: x509: certificat The Docker daemon running the command expects a cert signed by a recognized CA, thus the error above. -While GitLab doesn't support using self-signed certificates with Container -Registry out of the box, it is possible to make it work if you follow -[Docker's documentation][docker-insecure-self-signed]. You may find some additional -information in [issue 18239][ce-18239]. +While GitLab doesn't support using self-signed certificates with Container Registry out of the box, it is possible to make it work by [instructing the docker-daemon to trust the self-signed certificates][docker-insecure-self-signed], mounting the docker-daemon and setting `privileged = false` in the runner's `config.toml`. Setting `privileged = true` takes precedence over the docker-daemon. -## Troubleshooting +``` + [runners.docker] + image = "ruby:2.1" + privileged = false + volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"] +``` + +Additional information about this: [issue 18239][ce-18239]. + +### AWS S3 with the GitLab registry error when pushing large images When using AWS S3 with the GitLab registry, an error may occur when pushing large images. Look in the Registry log for the following error: diff --git a/doc/administration/integration/terminal.md b/doc/administration/integration/terminal.md index 40e03093743..25d85d1687b 100644 --- a/doc/administration/integration/terminal.md +++ b/doc/administration/integration/terminal.md @@ -64,8 +64,9 @@ narrower set of rules, you can restrict it to URLs ending with `/terminal.ws` (although this may still have a few false positives). If you installed from source, or have made any configuration changes to your -Omnibus installation before upgrading to 8.15, you may need to make some -changes to your configuration. See the [8.14 to 8.15 upgrade](../../update/8.14-to-8.15.md#nginx-configuration) +Omnibus installation before upgrading to 8.15, you may need to make some changes +to your configuration. See the [Upgrading Community Edition and Enterprise +Edition from source](../../update/upgrading_from_source.md#nginx-configuration) document for more details. If you'd like to disable web terminal support in GitLab, just stop passing diff --git a/doc/api/branches.md b/doc/api/branches.md index 62468b6e917..31c8add300d 100644 --- a/doc/api/branches.md +++ b/doc/api/branches.md @@ -22,6 +22,7 @@ Parameters: |:----------|:---------------|:---------|:------------| | `id` | integer/string | yes | ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user.| | `search` | string | no | Return list of branches containing the search string. You can use `^term` and `term$` to find branches that begin and end with `term` respectively.| + Example request: ```sh diff --git a/doc/api/group_labels.md b/doc/api/group_labels.md index c36d34b4af1..d4715dec192 100644 --- a/doc/api/group_labels.md +++ b/doc/api/group_labels.md @@ -1,6 +1,6 @@ -# Group Label API +# Group Labels API ->**Note:** This feature was [introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21368) in GitLab 11.8. +> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21368) in GitLab 11.8. This API supports managing of [group labels](../user/project/labels.md#project-labels-and-group-labels). It allows to list, create, update, and delete group labels. Furthermore, users can subscribe and unsubscribe to and from group labels. @@ -14,7 +14,7 @@ GET /groups/:id/labels | Attribute | Type | Required | Description | | --------- | ---- | -------- | ----------- | -| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | +| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user. | ```bash curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels @@ -60,7 +60,7 @@ POST /groups/:id/labels | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | | `name` | string | yes | The name of the label | | `color` | string | yes | The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the [CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords) | -| `description` | string | no | The description of the label | +| `description` | string | no | The description of the label, | ```bash curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" --data '{"name": "Feature Proposal", "color": "#FFA500", "description": "Describes new ideas" }' https://gitlab.example.com/api/v4/groups/5/labels @@ -95,7 +95,7 @@ PUT /groups/:id/labels | `name` | string | yes | The name of the label | | `new_name` | string | no | The new name of the label | | `color` | string | no | The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the [CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords) | -| `description` | string | no | The description of the label | +| `description` | string | no | The description of the label. | ```bash curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" --data '{"name": "Feature Proposal", "new_name": "Feature Idea" }' https://gitlab.example.com/api/v4/groups/5/labels @@ -127,7 +127,7 @@ DELETE /groups/:id/labels | Attribute | Type | Required | Description | | --------- | ------- | -------- | --------------------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | -| `name` | string | yes | The name of the label | +| `name` | string | yes | The name of the label. | ```bash curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels?name=bug @@ -145,7 +145,7 @@ POST /groups/:id/labels/:label_id/subscribe | Attribute | Type | Required | Description | | ---------- | ----------------- | -------- | ------------------------------------ | | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | -| `label_id` | integer or string | yes | The ID or title of a group's label | +| `label_id` | integer or string | yes | The ID or title of a group's label. | ```bash curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels/9/subscribe @@ -179,7 +179,7 @@ POST /groups/:id/labels/:label_id/unsubscribe | Attribute | Type | Required | Description | | ---------- | ----------------- | -------- | ------------------------------------ | | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) owned by the authenticated user | -| `label_id` | integer or string | yes | The ID or title of a group's label | +| `label_id` | integer or string | yes | The ID or title of a group's label. | ```bash curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/5/labels/9/unsubscribe diff --git a/doc/api/services.md b/doc/api/services.md index 868bcdd07fc..2a8ce39e570 100644 --- a/doc/api/services.md +++ b/doc/api/services.md @@ -449,45 +449,6 @@ Get Hangouts Chat service settings for a project. GET /projects/:id/services/hangouts_chat ``` -## HipChat - -Private group chat and IM - -### Create/Edit HipChat service - -Set HipChat service for a project. - -``` -PUT /projects/:id/services/hipchat -``` - -Parameters: - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `token` | string | true | Room token | -| `color` | string | false | The room color | -| `notify` | boolean | false | Enable notifications | -| `room` | string | false |Room name or ID | -| `api_version` | string | false | Leave blank for default (v2) | -| `server` | string | false | Leave blank for default. For example, `https://hipchat.example.com`. | - -### Delete HipChat service - -Delete HipChat service for a project. - -``` -DELETE /projects/:id/services/hipchat -``` - -### Get HipChat service settings - -Get HipChat service settings for a project. - -``` -GET /projects/:id/services/hipchat -``` - ## Irker (IRC gateway) Send IRC messages, on update, to a list of recipients through an Irker gateway. diff --git a/doc/development/contributing/merge_request_workflow.md b/doc/development/contributing/merge_request_workflow.md index 19b6181c9a2..4e766f37871 100644 --- a/doc/development/contributing/merge_request_workflow.md +++ b/doc/development/contributing/merge_request_workflow.md @@ -89,6 +89,11 @@ request is as follows: 1. If your merge request introduces changes that require additional steps when installing GitLab from source, add them to `doc/install/installation.md` in the same merge request. +1. If your merge request introduces changes that require additional steps when + upgrading GitLab from source, add them to + `doc/update/upgrading_from_source.md` in the same merge request. If these + instructions are specific to a version, add them to the "Version specific + upgrading instructions" section. Please keep the change in a single MR **as small as possible**. If you want to contribute a large feature think very hard what the minimum viable change is. diff --git a/doc/development/profiling.md b/doc/development/profiling.md index 0b0c6dfc8cf..b7d9f640a3f 100644 --- a/doc/development/profiling.md +++ b/doc/development/profiling.md @@ -72,6 +72,16 @@ Gitlab::Profiler.print_by_total_time(result, max_percent: 60, min_percent: 2) # 0.02 0.865 0.000 0.000 0.864 638 *Enumerable#inject ``` +To print the profile in HTML format, use the following example: + + +```ruby +result = Gitlab::Profiler.profile('/my-user') + +printer = RubyProf::CallStackPrinter.new(result) +printer.print(File.open('/tmp/profile.html', 'w')) +``` + [GitLab-Profiler](https://gitlab.com/gitlab-com/gitlab-profiler) is a project that builds on this to add some additional niceties, such as allowing configuration with a single Yaml file for multiple URLs, and uploading of the diff --git a/doc/integration/README.md b/doc/integration/README.md index 8a93d4cb84b..7941cb42667 100644 --- a/doc/integration/README.md +++ b/doc/integration/README.md @@ -30,8 +30,8 @@ Bitbucket.org account ## Project services -Integration with services such as Campfire, Flowdock, HipChat, -Pivotal Tracker, and Slack are available in the form of a [Project Service][]. +Integration with services such as Campfire, Flowdock, Pivotal Tracker, and Slack +are available in the form of a [Project Service][]. [Project Service]: ../user/project/integrations/project_services.md diff --git a/doc/project_services/hipchat.md b/doc/project_services/hipchat.md deleted file mode 100644 index 4ae9f6c6b2e..00000000000 --- a/doc/project_services/hipchat.md +++ /dev/null @@ -1 +0,0 @@ -This document was moved to [user/project/integrations/hipchat.md](../user/project/integrations/hipchat.md). diff --git a/doc/university/glossary/README.md b/doc/university/glossary/README.md index 404a686f1cf..cf148a424db 100644 --- a/doc/university/glossary/README.md +++ b/doc/university/glossary/README.md @@ -41,7 +41,7 @@ Objects (usually binary and large) created by a build process. These can include ### Atlassian -A [company](https://www.atlassian.com) that develops software products for developers and project managers including Bitbucket, Jira, Hipchat, Confluence, Bamboo. +A [company](https://www.atlassian.com) that develops software products for developers and project managers including Bitbucket, Jira, Confluence, Bamboo. ### Audit Log diff --git a/doc/update/10.0-to-10.1.md b/doc/update/10.0-to-10.1.md index d4373ca3f23..8514aa13f48 100644 --- a/doc/update/10.0-to-10.1.md +++ b/doc/update/10.0-to-10.1.md @@ -1,360 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 10.0 to 10.1 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.5.tar.gz -echo '3247e217d6745c27ef23bdc77b6abdb4b57a118f ruby-2.3.5.tar.gz' | shasum -c - && tar xzf ruby-2.3.5.tar.gz -cd ruby-2.3.5 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets and -it has a minimum requirement of node v4.3.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v4.3.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - - -Since 8.17, GitLab requires the use of yarn `>= v0.17.0` to manage -JavaScript dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.8.3 and dropped support for Go -1.5.x through 1.7.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.8.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-1-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-1-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/10-0-stable:config/gitlab.yml.example origin/10-1-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/10-0-stable:lib/support/nginx/gitlab-ssl origin/10-1-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/10-0-stable:lib/support/nginx/gitlab origin/10-1-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-1-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-1-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/10-0-stable:lib/support/init.d/gitlab.default.example origin/10-1-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (10.0) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 9.5 to 10.0](9.5-to-10.0.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-1-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-1-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/10.1-to-10.2.md b/doc/update/10.1-to-10.2.md index 0705b58ed7a..8514aa13f48 100644 --- a/doc/update/10.1-to-10.2.md +++ b/doc/update/10.1-to-10.2.md @@ -1,360 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 10.1 to 10.2 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.5.tar.gz -echo '3247e217d6745c27ef23bdc77b6abdb4b57a118f ruby-2.3.5.tar.gz' | shasum -c - && tar xzf ruby-2.3.5.tar.gz -cd ruby-2.3.5 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets and -it has a minimum requirement of node v4.3.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v4.3.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - - -Since 8.17, GitLab requires the use of yarn `>= v0.17.0` to manage -JavaScript dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.8.3 and dropped support for Go -1.5.x through 1.7.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.8.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-2-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-2-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/10-1-stable:config/gitlab.yml.example origin/10-2-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/10-1-stable:lib/support/nginx/gitlab-ssl origin/10-2-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/10-1-stable:lib/support/nginx/gitlab origin/10-2-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-2-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-2-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/10-1-stable:lib/support/init.d/gitlab.default.example origin/10-2-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (10.1) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 10.0 to 10.1](10.0-to-10.1.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-2-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-2-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/10.2-to-10.3.md b/doc/update/10.2-to-10.3.md index 33a52d3e807..8514aa13f48 100644 --- a/doc/update/10.2-to-10.3.md +++ b/doc/update/10.2-to-10.3.md @@ -1,359 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 10.2 to 10.3 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.5.tar.gz -echo '3247e217d6745c27ef23bdc77b6abdb4b57a118f ruby-2.3.5.tar.gz' | shasum -c - && tar xzf ruby-2.3.5.tar.gz -cd ruby-2.3.5 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets. -We require a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -Since 8.17, GitLab requires the use of yarn `>= v0.17.0` to manage -JavaScript dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.8.3 and dropped support for Go -1.5.x through 1.7.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.8.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-3-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-3-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/10-2-stable:config/gitlab.yml.example origin/10-3-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/10-2-stable:lib/support/nginx/gitlab-ssl origin/10-3-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/10-2-stable:lib/support/nginx/gitlab origin/10-3-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-3-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-3-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/10-2-stable:lib/support/init.d/gitlab.default.example origin/10-3-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (10.2) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 10.1 to 10.2](10.1-to-10.2.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-3-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-3-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/10.3-to-10.4.md b/doc/update/10.3-to-10.4.md index 3ba96535965..8514aa13f48 100644 --- a/doc/update/10.3-to-10.4.md +++ b/doc/update/10.3-to-10.4.md @@ -1,361 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 10.3 to 10.4 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.6.tar.gz -echo '4e6a0f828819e15d274ae58485585fc8b7caace0 ruby-2.3.6.tar.gz' | shasum -c - && tar xzf ruby-2.3.6.tar.gz -cd ruby-2.3.6 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets. -We require a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -Since 8.17, GitLab requires the use of yarn `>= v0.17.0` to manage -JavaScript dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.8.3 and dropped support for Go -1.5.x through 1.7.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.8.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-4-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-4-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/10-3-stable:config/gitlab.yml.example origin/10-4-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/10-3-stable:lib/support/nginx/gitlab-ssl origin/10-4-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/10-3-stable:lib/support/nginx/gitlab origin/10-4-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-4-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-4-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/10-3-stable:lib/support/init.d/gitlab.default.example origin/10-4-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (10.3) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 10.2 to 10.3](10.2-to-10.3.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-4-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-4-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/10.4-to-10.5.md b/doc/update/10.4-to-10.5.md index f00bbcaeaa6..8514aa13f48 100644 --- a/doc/update/10.4-to-10.5.md +++ b/doc/update/10.4-to-10.5.md @@ -1,361 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 10.4 to 10.5 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.6.tar.gz -echo '4e6a0f828819e15d274ae58485585fc8b7caace0 ruby-2.3.6.tar.gz' | shasum -c - && tar xzf ruby-2.3.6.tar.gz -cd ruby-2.3.6 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets. -We require a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -Since 8.17, GitLab requires the use of yarn `>= v0.17.0` to manage -JavaScript dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.8.3 and dropped support for Go -1.5.x through 1.7.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.8.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-5-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-5-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/10-4-stable:config/gitlab.yml.example origin/10-5-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/10-4-stable:lib/support/nginx/gitlab-ssl origin/10-5-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/10-4-stable:lib/support/nginx/gitlab origin/10-5-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-5-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-5-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/10-4-stable:lib/support/init.d/gitlab.default.example origin/10-5-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (10.4) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 10.3 to 10.4](10.3-to-10.4.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-5-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-5-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/10.5-to-10.6.md b/doc/update/10.5-to-10.6.md index 6c3f8b663cc..8514aa13f48 100644 --- a/doc/update/10.5-to-10.6.md +++ b/doc/update/10.5-to-10.6.md @@ -1,361 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 10.5 to 10.6 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.6.tar.gz -echo '4e6a0f828819e15d274ae58485585fc8b7caace0 ruby-2.3.6.tar.gz' | shasum -c - && tar xzf ruby-2.3.6.tar.gz -cd ruby-2.3.6 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. -This requires a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -GitLab also requires the use of yarn `>= v1.2.0` to manage JavaScript -dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.8.3 and dropped support for Go -1.5.x through 1.7.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.8.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all --prune -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-6-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-6-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/10-5-stable:config/gitlab.yml.example origin/10-6-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/10-5-stable:lib/support/nginx/gitlab-ssl origin/10-6-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/10-5-stable:lib/support/nginx/gitlab origin/10-6-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-6-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-6-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/10-5-stable:lib/support/init.d/gitlab.default.example origin/10-6-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (10.5) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 10.4 to 10.5](10.4-to-10.5.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-6-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-6-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/10.6-to-10.7.md b/doc/update/10.6-to-10.7.md index 9bd354a5bcd..8514aa13f48 100644 --- a/doc/update/10.6-to-10.7.md +++ b/doc/update/10.6-to-10.7.md @@ -1,361 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 10.6 to 10.7 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.6.tar.gz -echo '4e6a0f828819e15d274ae58485585fc8b7caace0 ruby-2.3.6.tar.gz' | shasum -c - && tar xzf ruby-2.3.6.tar.gz -cd ruby-2.3.6 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. -This requires a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -GitLab also requires the use of yarn `>= v1.2.0` to manage JavaScript -dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.9 and dropped support for Go -1.5.x through 1.8.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz -echo 'd70eadefce8e160638a9a6db97f7192d8463069ab33138893ad3bf31b0650a79 go1.9.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.9.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.9.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all --prune -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-7-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-7-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/10-6-stable:config/gitlab.yml.example origin/10-7-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/10-6-stable:lib/support/nginx/gitlab-ssl origin/10-7-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/10-6-stable:lib/support/nginx/gitlab origin/10-7-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-7-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-7-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/10-6-stable:lib/support/init.d/gitlab.default.example origin/10-7-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (10.6) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 10.5 to 10.6](10.5-to-10.6.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-7-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-7-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/10.7-to-10.8.md b/doc/update/10.7-to-10.8.md index 9aafd3f269f..8514aa13f48 100644 --- a/doc/update/10.7-to-10.8.md +++ b/doc/update/10.7-to-10.8.md @@ -1,362 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 10.7 to 10.8 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download Ruby and compile it: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.7.tar.gz -echo '540996fec64984ab6099e34d2f5820b14904f15a ruby-2.3.7.tar.gz' | shasum -c - && tar xzf ruby-2.3.7.tar.gz -cd ruby-2.3.7 - -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. -This requires a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -GitLab also requires the use of yarn `>= v1.2.0` to manage JavaScript -dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.8.3 and dropped support for Go -1.5.x through 1.7.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.8.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all --prune -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-8-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-8-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/10-7-stable:config/gitlab.yml.example origin/10-8-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/10-7-stable:lib/support/nginx/gitlab-ssl origin/10-8-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/10-7-stable:lib/support/nginx/gitlab origin/10-8-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-8-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-8-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/10-7-stable:lib/support/init.d/gitlab.default.example origin/10-8-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (10.7) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 10.6 to 10.7](10.6-to-10.7.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-8-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-8-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/10.8-to-11.0.md b/doc/update/10.8-to-11.0.md index f6fdc342e3d..8514aa13f48 100644 --- a/doc/update/10.8-to-11.0.md +++ b/doc/update/10.8-to-11.0.md @@ -1,361 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 10.8 to 11.0 - -Make sure you view this update guide from the branch (version) of GitLab you would -like to install (e.g., `11-0-stable`. You can select the branch in the version -dropdown at the top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 11.0 and higher only support Ruby 2.4.x and dropped support for Ruby 2.3.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download Ruby and compile it: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.4.tar.gz -echo 'ec82b0d53bd0adad9b19e6b45e44d54e9ec3f10c ruby-2.4.4.tar.gz' | shasum -c - && tar xzf ruby-2.4.4.tar.gz -cd ruby-2.4.4 - -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. -This requires a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -GitLab also requires the use of yarn `>= v1.2.0` to manage JavaScript -dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 11.0 and higher only supports Go 1.9.x and newer, and dropped support for Go -1.5.x through 1.8.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz -echo 'fa1b0e45d3b647c252f51f5e1204aba049cde4af177ef9f2181f43004f901035 go1.10.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.10.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all --prune -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-0-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-0-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/10-8-stable:config/gitlab.yml.example origin/11-0-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/10-8-stable:lib/support/nginx/gitlab-ssl origin/11-0-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/10-8-stable:lib/support/nginx/gitlab origin/11-0-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-0-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-0-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/10-8-stable:lib/support/init.d/gitlab.default.example origin/11-0-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (10.8) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 10.7 to 10.8](10.7-to-10.8.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-0-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-0-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/11.0-to-11.1.md b/doc/update/11.0-to-11.1.md index 25a7c1cf929..8514aa13f48 100644 --- a/doc/update/11.0-to-11.1.md +++ b/doc/update/11.0-to-11.1.md @@ -1,378 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 11.0 to 11.1 - -Make sure you view this update guide from the branch (version) of GitLab you would -like to install (e.g., `11-1-stable`. You can select the branch in the version -dropdown at the top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 11.0 and higher only support Ruby 2.4.x and dropped support for Ruby 2.3.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download Ruby and compile it: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.4.tar.gz -echo 'ec82b0d53bd0adad9b19e6b45e44d54e9ec3f10c ruby-2.4.4.tar.gz' | shasum -c - && tar xzf ruby-2.4.4.tar.gz -cd ruby-2.4.4 - -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. -This requires a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -GitLab also requires the use of yarn `>= v1.2.0` to manage JavaScript -dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 11.0 and higher only supports Go 1.9.x and newer, and dropped support for Go -1.5.x through 1.8.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz -echo 'fa1b0e45d3b647c252f51f5e1204aba049cde4af177ef9f2181f43004f901035 go1.10.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.10.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all --prune -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-1-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-1-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update gitlab-pages - -#### Only needed if you use GitLab Pages. - -Install and compile gitlab-pages. GitLab-Pages uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-pages - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_PAGES_VERSION) -sudo -u git -H make -``` - -### 11. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 12. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/11-0-stable:config/gitlab.yml.example origin/11-1-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/11-0-stable:lib/support/nginx/gitlab-ssl origin/11-1-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/11-0-stable:lib/support/nginx/gitlab origin/11-1-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-1-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-1-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/11-0-stable:lib/support/init.d/gitlab.default.example origin/11-1-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 13. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 14. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 15. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (11.0) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 10.8 to 11.0](10.8-to-11.0.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-1-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-1-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/11.1-to-11.2.md b/doc/update/11.1-to-11.2.md index ced59c245b8..8514aa13f48 100644 --- a/doc/update/11.1-to-11.2.md +++ b/doc/update/11.1-to-11.2.md @@ -1,378 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 11.1 to 11.2 - -Make sure you view this update guide from the branch (version) of GitLab you would -like to install (e.g., `11-2-stable`. You can select the branch in the version -dropdown at the top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 11.0 and higher only support Ruby 2.4.x and dropped support for Ruby 2.3.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download Ruby and compile it: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.4.tar.gz -echo 'ec82b0d53bd0adad9b19e6b45e44d54e9ec3f10c ruby-2.4.4.tar.gz' | shasum -c - && tar xzf ruby-2.4.4.tar.gz -cd ruby-2.4.4 - -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. -This requires a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -GitLab also requires the use of yarn `>= v1.2.0` to manage JavaScript -dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 11.0 and higher only supports Go 1.9.x and newer, and dropped support for Go -1.5.x through 1.8.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz -echo 'fa1b0e45d3b647c252f51f5e1204aba049cde4af177ef9f2181f43004f901035 go1.10.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.10.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all --prune -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-2-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-2-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update gitlab-pages - -#### Only needed if you use GitLab Pages. - -Install and compile gitlab-pages. GitLab-Pages uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-pages - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_PAGES_VERSION) -sudo -u git -H make -``` - -### 11. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 12. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/11-1-stable:config/gitlab.yml.example origin/11-2-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/11-1-stable:lib/support/nginx/gitlab-ssl origin/11-2-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/11-1-stable:lib/support/nginx/gitlab origin/11-2-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-2-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-2-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/11-1-stable:lib/support/init.d/gitlab.default.example origin/11-2-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 13. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 14. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 15. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (11.1) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 11.0 to 11.1](11.0-to-11.1.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-2-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-2-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/11.2-to-11.3.md b/doc/update/11.2-to-11.3.md index fa0c6872182..8514aa13f48 100644 --- a/doc/update/11.2-to-11.3.md +++ b/doc/update/11.2-to-11.3.md @@ -1,378 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 11.2 to 11.3 - -Make sure you view this update guide from the branch (version) of GitLab you would -like to install (e.g., `11-3-stable`. You can select the branch in the version -dropdown at the top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 11.0 and higher only support Ruby 2.4.x and dropped support for Ruby 2.3.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download Ruby and compile it: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.4.tar.gz -echo 'ec82b0d53bd0adad9b19e6b45e44d54e9ec3f10c ruby-2.4.4.tar.gz' | shasum -c - && tar xzf ruby-2.4.4.tar.gz -cd ruby-2.4.4 - -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. -This requires a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -GitLab also requires the use of yarn `>= v1.2.0` to manage JavaScript -dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 11.0 and higher only supports Go 1.9.x and newer, and dropped support for Go -1.5.x through 1.8.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz -echo 'fa1b0e45d3b647c252f51f5e1204aba049cde4af177ef9f2181f43004f901035 go1.10.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.10.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all --prune -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-3-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-3-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update gitlab-pages - -#### Only needed if you use GitLab Pages. - -Install and compile gitlab-pages. GitLab-Pages uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-pages - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_PAGES_VERSION) -sudo -u git -H make -``` - -### 11. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 12. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/11-2-stable:config/gitlab.yml.example origin/11-3-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/11-2-stable:lib/support/nginx/gitlab-ssl origin/11-3-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/11-2-stable:lib/support/nginx/gitlab origin/11-3-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-3-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-3-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/11-2-stable:lib/support/init.d/gitlab.default.example origin/11-3-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 13. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 14. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 15. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (11.2) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 11.1 to 11.2](11.1-to-11.2.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-3-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-3-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/11.3-to-11.4.md b/doc/update/11.3-to-11.4.md index 18bbfe4747e..8514aa13f48 100644 --- a/doc/update/11.3-to-11.4.md +++ b/doc/update/11.3-to-11.4.md @@ -1,378 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 11.3 to 11.4 - -Make sure you view this update guide from the branch (version) of GitLab you would -like to install (e.g., `11-4-stable`. You can select the branch in the version -dropdown at the top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 11.0 and higher only support Ruby 2.4.x and dropped support for Ruby 2.3.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download Ruby and compile it: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.5.tar.gz -echo '4d650f302f1ec00256450b112bb023644b6ab6dd ruby-2.4.5.tar.gz' | shasum -c - && tar xzf ruby-2.4.5.tar.gz -cd ruby-2.4.5 - -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. -This requires a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -GitLab also requires the use of yarn `>= v1.2.0` to manage JavaScript -dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 11.4 and higher only supports Go 1.10.x and newer, and dropped support for Go -1.9.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz -echo 'fa1b0e45d3b647c252f51f5e1204aba049cde4af177ef9f2181f43004f901035 go1.10.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.10.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all --prune -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-4-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-4-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update gitlab-pages - -#### Only needed if you use GitLab Pages. - -Install and compile gitlab-pages. GitLab-Pages uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-pages - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_PAGES_VERSION) -sudo -u git -H make -``` - -### 11. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 12. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/11-3-stable:config/gitlab.yml.example origin/11-4-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/11-3-stable:lib/support/nginx/gitlab-ssl origin/11-4-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/11-3-stable:lib/support/nginx/gitlab origin/11-4-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-4-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-4-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/11-3-stable:lib/support/init.d/gitlab.default.example origin/11-4-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 13. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 14. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 15. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (11.3) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 11.2 to 11.3](11.2-to-11.3.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-4-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-4-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/11.4-to-11.5.md b/doc/update/11.4-to-11.5.md index 8f588f8b2ae..8514aa13f48 100644 --- a/doc/update/11.4-to-11.5.md +++ b/doc/update/11.4-to-11.5.md @@ -1,390 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 11.4 to 11.5 - -Make sure you view this update guide from the branch (version) of GitLab you would -like to install (e.g., `11-5-stable`. You can select the branch in the version -dropdown at the top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 11.0 and higher only support Ruby 2.4.x and dropped support for Ruby 2.3.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download Ruby and compile it: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.5.tar.gz -echo '4d650f302f1ec00256450b112bb023644b6ab6dd ruby-2.4.5.tar.gz' | shasum -c - && tar xzf ruby-2.4.5.tar.gz -cd ruby-2.4.5 - -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. -This requires a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -GitLab also requires the use of yarn `>= v1.2.0` to manage JavaScript -dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 11.4 and higher only supports Go 1.10.x and newer, and dropped support for Go -1.9.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://dl.google.com/go/go1.10.5.linux-amd64.tar.gz -echo 'a035d9beda8341b645d3f45a1b620cf2d8fb0c5eb409be36b389c0fd384ecc3a go1.10.5.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.10.5.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.10.5.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all --prune -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-5-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-5-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update gitlab-pages - -#### Only needed if you use GitLab Pages. - -Install and compile gitlab-pages. GitLab-Pages uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-pages - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_PAGES_VERSION) -sudo -u git -H make -``` - -### 11. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 12. Update configuration files - -#### New `unicorn.rb` configuration - -Note: we have made [changes](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22372) to `unicorn.rb` to allow GitLab run with both Unicorn and Puma in future. - -- Make `/home/git/gitlab/config/unicorn.rb` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/11-5-stable/config/unicorn.rb.example> but with your settings. - - In particular, make sure that `require_relative "/home/git/gitlab/lib/gitlab/cluster/lifecycle_events"` line exists and the `before_exec`, `before_fork`, and `after_fork` handlers are configured as shown below: - -```ruby -require_relative "/home/git/gitlab/lib/gitlab/cluster/lifecycle_events" - -before_exec do |server| - # Signal application hooks that we're about to restart - Gitlab::Cluster::LifecycleEvents.do_master_restart -end - -before_fork do |server, worker| - # Signal application hooks that we're about to fork - Gitlab::Cluster::LifecycleEvents.do_before_fork -end - -after_fork do |server, worker| - # Signal application hooks of worker start - Gitlab::Cluster::LifecycleEvents.do_worker_start -end -``` - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/11-4-stable:config/gitlab.yml.example origin/11-5-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/11-4-stable:lib/support/nginx/gitlab-ssl origin/11-5-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/11-4-stable:lib/support/nginx/gitlab origin/11-5-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-5-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-5-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/11-4-stable:lib/support/init.d/gitlab.default.example origin/11-5-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 13. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 14. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 15. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (11.4) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 11.3 to 11.4](11.3-to-11.4.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-5-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-5-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/11.5-to-11.6.md b/doc/update/11.5-to-11.6.md index f95ce54650e..8514aa13f48 100644 --- a/doc/update/11.5-to-11.6.md +++ b/doc/update/11.5-to-11.6.md @@ -1,390 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 11.5 to 11.6 - -Make sure you view this update guide from the branch (version) of GitLab you would -like to install (e.g., `11-6-stable`. You can select the branch in the version -dropdown at the top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 11.0 and higher only support Ruby 2.4.x and dropped support for Ruby 2.3.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download Ruby and compile it: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.3.tar.gz -echo 'f919a9fbcdb7abecd887157b49833663c5c15fda ruby-2.5.3.tar.gz' | shasum -c - && tar xzf ruby-2.5.3.tar.gz -cd ruby-2.5.3 - -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. -This requires a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -GitLab also requires the use of yarn `>= v1.2.0` to manage JavaScript -dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 11.4 and higher only supports Go 1.10.x and newer, and dropped support for Go -1.9.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://dl.google.com/go/go1.10.5.linux-amd64.tar.gz -echo 'a035d9beda8341b645d3f45a1b620cf2d8fb0c5eb409be36b389c0fd384ecc3a go1.10.5.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.10.5.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.10.5.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all --prune -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-6-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-6-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update gitlab-pages - -#### Only needed if you use GitLab Pages - -Install and compile gitlab-pages. GitLab-Pages uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-pages - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_PAGES_VERSION) -sudo -u git -H make -``` - -### 11. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 12. Update configuration files - -#### New `unicorn.rb` configuration - -We have made [changes](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22372) to `unicorn.rb` to allow GitLab run with both Unicorn and Puma in future. - -Make `/home/git/gitlab/config/unicorn.rb` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/11-6-stable/config/unicorn.rb.example> but with your settings. -In particular, make sure that `require_relative "/home/git/gitlab/lib/gitlab/cluster/lifecycle_events"` line exists and the `before_exec`, `before_fork`, and `after_fork` handlers are configured as shown below: - -```ruby -require_relative "/home/git/gitlab/lib/gitlab/cluster/lifecycle_events" - -before_exec do |server| - # Signal application hooks that we're about to restart - Gitlab::Cluster::LifecycleEvents.do_master_restart -end - -before_fork do |server, worker| - # Signal application hooks that we're about to fork - Gitlab::Cluster::LifecycleEvents.do_before_fork -end - -after_fork do |server, worker| - # Signal application hooks of worker start - Gitlab::Cluster::LifecycleEvents.do_worker_start -end -``` - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/11-5-stable:config/gitlab.yml.example origin/11-6-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/11-5-stable:lib/support/nginx/gitlab-ssl origin/11-6-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/11-5-stable:lib/support/nginx/gitlab origin/11-6-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-6-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-6-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/11-5-stable:lib/support/init.d/gitlab.default.example origin/11-6-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 13. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --deployment --without development test mysql aws kerberos - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --deployment --without development test postgres aws kerberos - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 14. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 15. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (11.5) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 11.4 to 11.5](11.4-to-11.5.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-6-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-6-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/11.6-to-11.7.md b/doc/update/11.6-to-11.7.md index b4d830e8ce0..8514aa13f48 100644 --- a/doc/update/11.6-to-11.7.md +++ b/doc/update/11.6-to-11.7.md @@ -1,390 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 11.6 to 11.7 - -Make sure you view this update guide from the branch (version) of GitLab you would -like to install (e.g., `11-7-stable`. You can select the branch in the version -dropdown at the top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: Beginning in GitLab 11.0, we only support Ruby 2.4 or higher, and dropped -support for Ruby 2.3. Be sure to upgrade if necessary. - -You can check which version you are running with `ruby -v`. - -Download Ruby and compile it: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.3.tar.gz -echo 'f919a9fbcdb7abecd887157b49833663c5c15fda ruby-2.5.3.tar.gz' | shasum -c - && tar xzf ruby-2.5.3.tar.gz -cd ruby-2.5.3 - -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. -This requires a minimum version of node v6.0.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v6.0.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -GitLab also requires the use of yarn `>= v1.10.0` to manage JavaScript -dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 11.4 and higher only supports Go 1.10.x and newer, and dropped support for Go -1.9.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://dl.google.com/go/go1.10.5.linux-amd64.tar.gz -echo 'a035d9beda8341b645d3f45a1b620cf2d8fb0c5eb409be36b389c0fd384ecc3a go1.10.5.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.10.5.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.10.5.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all --prune -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-7-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-7-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update gitlab-pages - -#### Only needed if you use GitLab Pages - -Install and compile gitlab-pages. GitLab-Pages uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-pages - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_PAGES_VERSION) -sudo -u git -H make -``` - -### 11. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 12. Update configuration files - -#### New `unicorn.rb` configuration - -We have made [changes](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22372) to `unicorn.rb` to allow GitLab run with both Unicorn and Puma in future. - -Make `/home/git/gitlab/config/unicorn.rb` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/11-7-stable/config/unicorn.rb.example> but with your settings. -In particular, make sure that `require_relative "/home/git/gitlab/lib/gitlab/cluster/lifecycle_events"` line exists and the `before_exec`, `before_fork`, and `after_fork` handlers are configured as shown below: - -```ruby -require_relative "/home/git/gitlab/lib/gitlab/cluster/lifecycle_events" - -before_exec do |server| - # Signal application hooks that we're about to restart - Gitlab::Cluster::LifecycleEvents.do_master_restart -end - -before_fork do |server, worker| - # Signal application hooks that we're about to fork - Gitlab::Cluster::LifecycleEvents.do_before_fork -end - -after_fork do |server, worker| - # Signal application hooks of worker start - Gitlab::Cluster::LifecycleEvents.do_worker_start -end -``` - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/11-6-stable:config/gitlab.yml.example origin/11-7-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/11-6-stable:lib/support/nginx/gitlab-ssl origin/11-7-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/11-6-stable:lib/support/nginx/gitlab origin/11-7-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-7-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-7-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/11-6-stable:lib/support/init.d/gitlab.default.example origin/11-7-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 13. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --deployment --without development test mysql aws kerberos - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --deployment --without development test postgres aws kerberos - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 14. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 15. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (11.6) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 11.5 to 11.6](11.5-to-11.6.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-7-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-7-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/11.7-to-11.8.md b/doc/update/11.7-to-11.8.md index d5cd557d7b5..8514aa13f48 100644 --- a/doc/update/11.7-to-11.8.md +++ b/doc/update/11.7-to-11.8.md @@ -1,394 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 11.7 to 11.8 - -Make sure you view this update guide from the branch (version) of GitLab you would -like to install (e.g., `11-8-stable`. You can select the branch in the version -dropdown at the top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -NOTE: If you installed GitLab from source, make sure `rsync` is installed. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: Beginning in GitLab 11.0, we only support Ruby 2.4 or higher, and dropped -support for Ruby 2.3. Be sure to upgrade if necessary. - -You can check which version you are running with `ruby -v`. - -Download Ruby and compile it: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.3.tar.gz -echo 'f919a9fbcdb7abecd887157b49833663c5c15fda ruby-2.5.3.tar.gz' | shasum -c - && tar xzf ruby-2.5.3.tar.gz -cd ruby-2.5.3 - -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -NOTE: Beginning in GitLab 11.8, we only support node 8 or higher, and dropped -support for node 6. Be sure to upgrade if necessary. - -GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. -This requires a minimum version of node v8.10.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v8.10.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -GitLab also requires the use of yarn `>= v1.10.0` to manage JavaScript -dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 11.4 and higher only supports Go 1.10.x and newer, and dropped support for Go -1.9.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://dl.google.com/go/go1.10.5.linux-amd64.tar.gz -echo 'a035d9beda8341b645d3f45a1b620cf2d8fb0c5eb409be36b389c0fd384ecc3a go1.10.5.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.10.5.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.10.5.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all --prune -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-8-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 11-8-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.1 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update gitlab-pages - -#### Only needed if you use GitLab Pages - -Install and compile gitlab-pages. GitLab-Pages uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-pages - -sudo -u git -H git fetch --all --tags --prune -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_PAGES_VERSION) -sudo -u git -H make -``` - -### 11. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 12. Update configuration files - -#### New `unicorn.rb` configuration - -We have made [changes](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22372) to `unicorn.rb` to allow GitLab run with both Unicorn and Puma in future. - -Make `/home/git/gitlab/config/unicorn.rb` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/11-8-stable/config/unicorn.rb.example> but with your settings. -In particular, make sure that `require_relative "/home/git/gitlab/lib/gitlab/cluster/lifecycle_events"` line exists and the `before_exec`, `before_fork`, and `after_fork` handlers are configured as shown below: - -```ruby -require_relative "/home/git/gitlab/lib/gitlab/cluster/lifecycle_events" - -before_exec do |server| - # Signal application hooks that we're about to restart - Gitlab::Cluster::LifecycleEvents.do_master_restart -end - -before_fork do |server, worker| - # Signal application hooks that we're about to fork - Gitlab::Cluster::LifecycleEvents.do_before_fork -end - -after_fork do |server, worker| - # Signal application hooks of worker start - Gitlab::Cluster::LifecycleEvents.do_worker_start -end -``` - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/11-7-stable:config/gitlab.yml.example origin/11-8-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/11-7-stable:lib/support/nginx/gitlab-ssl origin/11-8-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/11-7-stable:lib/support/nginx/gitlab origin/11-8-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-8-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-8-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/11-7-stable:lib/support/init.d/gitlab.default.example origin/11-8-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 13. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --deployment --without development test mysql aws kerberos - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --deployment --without development test postgres aws kerberos - - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 14. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 15. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (11.7) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 11.6 to 11.7](11.6-to-11.7.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-8-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/11-8-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/2.6-to-3.0.md b/doc/update/2.6-to-3.0.md index 8f18bd93cea..8514aa13f48 100644 --- a/doc/update/2.6-to-3.0.md +++ b/doc/update/2.6-to-3.0.md @@ -1,70 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 2.6 to 3.0 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/2.6-to-3.0.md) for the most up to date instructions.* - -## 1. Stop server & resque - - sudo service gitlab stop - -## 2. Update code & db - - -```bash -# Get latest code -git fetch origin -git checkout v3.0.3 - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u gitlab -H vim Gemfile - -# Install libs -sudo -u gitlab bundle install --without development test postgres - -# update db -sudo -u gitlab bundle exec rake db:migrate RAILS_ENV=production - -# !!! Config should be replaced with a new one. Check it after replace -cp config/gitlab.yml.example config/gitlab.yml - -# update Gitolite hooks - -# Gitolite v2: -sudo cp ./lib/hooks/post-receive /home/git/share/gitolite/hooks/common/post-receive -sudo chown git:git /home/git/share/gitolite/hooks/common/post-receive - -# Gitolite v3: -sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive -sudo chown git:git /home/git/.gitolite/hooks/common/post-receive - -# set valid path to hooks in gitlab.yml in git_host section -# like this -git_host: - # Gitolite 2 - hooks_path: /home/git/share/gitolite/hooks - # Gitolite 3 - hooks_path: /home/git/.gitolite/hooks/ - - -# Make some changes to Gitolite config -# For more information visit https://github.com/gitlabhq/gitlabhq/pull/1719 - -# Gitolite v2 -sudo -u git -H sed -i 's/\(GL_GITCONFIG_KEYS\s*=>*\s*\).\{2\}/\\1"\.\*"/g' /home/git/.gitolite.rc - -# gitlite v3 -sudo -u git -H sed -i "s/\(GIT_CONFIG_KEYS\s*=>*\s*\).\{2\}/\\1'\.\*'/g" /home/git/.gitolite.rc - - -# Check app status -sudo -u gitlab bundle exec rake gitlab:app:status RAILS_ENV=production - -``` - -## 3. Start all - - sudo service gitlab start +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/2.9-to-3.0.md b/doc/update/2.9-to-3.0.md index 6a3c2387683..8514aa13f48 100644 --- a/doc/update/2.9-to-3.0.md +++ b/doc/update/2.9-to-3.0.md @@ -1,46 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 2.9 to 3.0 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/2.9-to-3.0.md) for the most up to date instructions.* - -## 1. Stop server & resque - - sudo service gitlab stop - -## 2. Follow instructions - -```bash - -# Get latest code -sudo -u gitlab -H git fetch origin -sudo -u gitlab -H git checkout v3.0.3 - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u gitlab -H vim Gemfile - -# Install gems -sudo -u gitlab -H bundle install --without development test postgres - -# Migrate db -sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production - -# Make some changes to gitolite v3 config -# For more information visit https://github.com/gitlabhq/gitlabhq/pull/1719 - -# Gitolite version 3 -sudo -u git -H sed -i "s/\(GIT_CONFIG_KEYS\s*=>*\s*\).\{2\}/\\1'\.\*'/g" /home/git/.gitolite.rc - -# If you still use gitolite v2 -sudo -u git -H sed -i 's/\(GL_GITCONFIG_KEYS\s*=>*\s*\).\{2\}/\\1"\.\*"/g' /home/git/.gitolite.rc - -# Check APP Status -sudo -u gitlab -H bundle exec rake gitlab:app:status RAILS_ENV=production -``` - -## 3. Start all - - sudo service gitlab start +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/3.0-to-3.1.md b/doc/update/3.0-to-3.1.md index 1f25b8265c9..8514aa13f48 100644 --- a/doc/update/3.0-to-3.1.md +++ b/doc/update/3.0-to-3.1.md @@ -1,106 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 3.0 to 3.1 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/3.0-to-3.1.md) for the most up to date instructions.* - -**IMPORTANT!** - -In this release **we moved Resque jobs under own gitlab namespace** - -Despite a lot of advantages it requires from our users to **replace gitolite post-receive hook with new one**. - -Most of projects has post-receive file as symlink to gitolite `/home/git/.gitolite/hooks/post-receive`. But some of them may have a real file. In this case you should rewrite it with symlink to gitolite hook. - -I wrote a bash script which will do it automatically for you. Just make sure all path inside is valid for you - -## 1. Stop server & resque - - sudo service gitlab stop - -## 2. Update GitLab - -```bash -# Get latest code -sudo -u gitlab -H git fetch -sudo -u gitlab -H git checkout v3.1.0 - -# Install new charlock_holmes -sudo gem install charlock_holmes --version '0.6.9' - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u gitlab -H vim Gemfile - -# Install gems for MySQL -sudo -u gitlab -H bundle install --without development test postgres sqlite - - -# Migrate db -sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production - -``` - -## 3. Update post-receive hooks - -### Gitolite 3 - -Step 1: Rewrite post-receive hook - -```bash -# Rewrite hook for gitolite 3 -sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive -sudo chown git:git /home/git/.gitolite/hooks/common/post-receive -``` - -Step 2: Rewrite hooks in all projects to symlink gitolite hook - -```bash -# 1. Check for valid path -sudo -u gitlab -H vim lib/support/rewrite-hooks.sh - -# 2. Run script -sudo -u git -H lib/support/rewrite-hooks.sh -``` - -### Gitolite v2 - -Step 1: rewrite post-receive hook for gitolite 2 - -``` -sudo cp ./lib/hooks/post-receive /home/git/share/gitolite/hooks/common/post-receive -sudo chown git:git /home/git/share/gitolite/hooks/common/post-receive -``` - -Step 2: Replace symlinks in project to valid place - - #!/bin/bash - src="/home/git/repositories" - for dir in `ls "$src/"` - do - if [ -d "$src/$dir" ]; then - - if [ "$dir" = "gitolite-admin.git" ] - then - continue - fi - - project_hook="$src/$dir/hooks/post-receive" - gitolite_hook="/home/git/share/gitolite/hooks/common/post-receive" - - ln -s -f $gitolite_hook $project_hook - fi - done - -## 4. Check app status - -```bash -# Check APP Status -sudo -u gitlab -H bundle exec rake gitlab:app:status RAILS_ENV=production -``` - -## 5. Start all - - sudo service gitlab start +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/3.1-to-4.0.md b/doc/update/3.1-to-4.0.md index 1a53ddeb4bd..8514aa13f48 100644 --- a/doc/update/3.1-to-4.0.md +++ b/doc/update/3.1-to-4.0.md @@ -1,99 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 3.1 to 4.0 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/3.1-to-4.0.md) for the most up to date instructions.* - -## Important changes - -- Support for SQLite was dropped -- Support for Gitolite 2 was dropped -- Projects are organized in namespaces -- The GitLab post-receive hook needs to be updated -- The configuration file needs to be updated -- Availability of `python2` executable - -Most of projects has post-receive file as symlink to Gitolite `/home/git/.gitolite/hooks/post-receive`. But some of them may have a real file. In this case you should rewrite it with symlink to Gitolite hook. - -I wrote a bash script which will do it automatically for you. Just make sure all path inside is valid for you - -## 1. Stop GitLab & Resque - - sudo service gitlab stop - -## 2. Update GitLab - -```bash - -# Get latest code -sudo -u gitlab -H git fetch -sudo -u gitlab -H git checkout 4-0-stable - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u gitlab -H vim Gemfile - -# Install gems for MySQL -sudo -u gitlab -H bundle install --without development test postgres - -# Update repos permissions -sudo chmod -R ug+rwXs /home/git/repositories/ -sudo chown -R git:git /home/git/repositories/ - -# Migrate db -sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production - -# Enable namespaces (**Warning!** All projects in groups will be moved to subdirectories) -sudo -u gitlab -H bundle exec rake gitlab:enable_namespaces RAILS_ENV=production - -``` - -## 3. Update post-receive hooks (Requires Gitolite v3 ) - -Step 1: Rewrite post-receive hook - -```bash -sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive -sudo chown git:git /home/git/.gitolite/hooks/common/post-receive -``` - -Step 2: Update project hooks to be symlinks to the Gitolite hook - -```bash -# 1. Check paths in script -sudo -u gitlab -H vim lib/support/rewrite-hooks.sh - -# 2. Run script -sudo -u git -H lib/support/rewrite-hooks.sh -``` - -## 4. Replace config with new one - - # backup old one - sudo -u gitlab -H cp config/gitlab.yml config/gitlab.yml.old - - # copy new one - sudo -u gitlab -H cp config/gitlab.yml.example config/gitlab.yml - - # edit it - sudo -u gitlab -H vim config/gitlab.yml - -## 5. Disable ssh known_host check for own domain - - echo "Host localhost - StrictHostKeyChecking no - UserKnownHostsFile=/dev/null" | sudo tee -a /etc/ssh/ssh_config - - echo "Host YOUR_DOMAIN_NAME - StrictHostKeyChecking no - UserKnownHostsFile=/dev/null" | sudo tee -a /etc/ssh/ssh_config - -## 6. Check GitLab's status - - sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production - -## 7. Start GitLab & Resque - - sudo service gitlab start +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/4.0-to-4.1.md b/doc/update/4.0-to-4.1.md index 40a133e796e..8514aa13f48 100644 --- a/doc/update/4.0-to-4.1.md +++ b/doc/update/4.0-to-4.1.md @@ -1,65 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 4.0 to 4.1 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/4.0-to-4.1.md) for the most up to date instructions.* - -## Important changes - -- Resque replaced with Sidekiq -- New options for configuration file added -- Init.d script should be updated -- **requires ruby1.9.3-p327** - -## 1. Stop GitLab & Resque - - sudo service gitlab stop - -## 2. Update GitLab - -```bash -# Set the working directory -cd /home/gitlab/gitlab/ - -# Get latest code -sudo -u gitlab -H git fetch -sudo -u gitlab -H git checkout 4-1-stable - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u gitlab -H vim Gemfile - -# Install gems for MySQL -sudo -u gitlab -H bundle install --without development test postgres - -# Migrate db -sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production - -``` - -## 3. Replace init.d script with a new one - -``` -# backup old one -sudo mv /etc/init.d/gitlab /etc/init.d/gitlab.old - -# get new one using sidekiq -sudo curl --location --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/4-1-stable/init.d/gitlab -sudo chmod +x /etc/init.d/gitlab - -``` - -## 4. Check GitLab's status - - sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production - - -## 5. Start GitLab & Sidekiq - - sudo service gitlab start - -## 6. Remove old init.d script - - sudo rm /etc/init.d/gitlab.old +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/4.1-to-4.2.md b/doc/update/4.1-to-4.2.md index 1fd6c58bda7..8514aa13f48 100644 --- a/doc/update/4.1-to-4.2.md +++ b/doc/update/4.1-to-4.2.md @@ -1,48 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 4.1 to 4.2 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/4.1-to-4.2.md) for the most up to date instructions.* - -## 1. Stop server & Resque - - sudo service gitlab stop - -## 2. Update code & DB - -```bash - -#Set the working directory -cd /home/gitlab/gitlab/ - -# Get latest code -sudo -u gitlab -H git fetch - -sudo -u gitlab -H git checkout 4-2-stable - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u gitlab -H vim Gemfile - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u gitlab -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u gitlab -H bundle install --without development test postgres --deployment - -# update db -sudo -u gitlab -H bundle exec rake db:migrate RAILS_ENV=production - -``` - -## 3. Check GitLab's status - -```bash -sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -## 4. Start all - - sudo service gitlab start +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/4.2-to-5.0.md b/doc/update/4.2-to-5.0.md index d292327efbd..8514aa13f48 100644 --- a/doc/update/4.2-to-5.0.md +++ b/doc/update/4.2-to-5.0.md @@ -1,224 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 4.2 to 5.0 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/4.2-to-5.0.md) for the most up to date instructions.* - -## Warning - -GitLab 5.0 is affected by critical security vulnerability CVE-2013-4490. - -## Important changes - -- We don't use `gitlab` user any more. Everything will be moved to `git` user -- Self signed SSL certificates are not supported until GitLab 5.1 -- **requires ruby1.9.3** - -## 0. Stop GitLab - - sudo service gitlab stop - -## 1. add bash to git user - -``` -sudo chsh -s /bin/bash git -``` - -## 2. git clone gitlab-shell - -``` -cd /home/git/ -sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git /home/git/gitlab-shell -``` - -## 3. set up gitlab-shell - -```bash -# chmod all repos and files under git -sudo chown git:git -R /home/git/repositories/ - -# login as git -sudo su git -cd /home/git/gitlab-shell -git checkout v1.1.0 - -# copy config -cp config.yml.example config.yml - -# change URL to GitLab instance -# ! make sure the URL ends with '/' like 'https://gitlab.example/' -vim config.yml - -# rewrite hooks -./support/rewrite-hooks.sh - -# check ruby version for git user ( 1.9 required!! ) -# GitLab shell requires system ruby 1.9 -ruby -v - -# exit from git user -exit -``` - -## 4. Copy GitLab instance to git user - -```bash -sudo cp -R /home/gitlab/gitlab /home/git/gitlab -sudo chown git:git -R /home/git/gitlab -sudo rm -rf /home/gitlab/gitlab-satellites - -# if exists -sudo rm /tmp/gitlab.socket -``` - -## 5. Update GitLab to recent version - -```bash -cd /home/git/gitlab - -# backup current config -sudo -u git -H cp config/gitlab.yml config/gitlab.yml.old - -sudo -u git -H git fetch -sudo -u git -H git checkout 5-0-stable - -# replace config with recent one -sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml - -# edit it -sudo -u git -H vim config/gitlab.yml - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production -sudo -u git -H bundle exec rake gitlab:shell:setup RAILS_ENV=production -sudo -u git -H bundle exec rake gitlab:shell:build_missing_projects RAILS_ENV=production - -sudo -u git -H mkdir -p /home/git/gitlab-satellites -sudo -u git -H bundle exec rake gitlab:satellites:create RAILS_ENV=production - -# migrate wiki to git -sudo -u git -H bundle exec rake gitlab:wiki:migrate RAILS_ENV=production - - -# check permissions for /home/git/.ssh/ -sudo -u git -H chmod 700 /home/git/.ssh -sudo -u git -H chmod 600 /home/git/.ssh/authorized_keys - -# check permissions for /home/git/gitlab/ -sudo chown -R git /home/git/gitlab/log/ -sudo chown -R git /home/git/gitlab/tmp/ -sudo chmod -R u+rwX /home/git/gitlab/log/ -sudo chmod -R u+rwX /home/git/gitlab/tmp/ -sudo -u git -H mkdir -p /home/git/gitlab/tmp/pids/ -sudo chmod -R u+rwX /home/git/gitlab/tmp/pids - -``` - -## 6. Update init.d script and Nginx config - -```bash -# init.d -sudo rm /etc/init.d/gitlab -sudo curl --location --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/5-0-stable/init.d/gitlab -sudo chmod +x /etc/init.d/gitlab - -# unicorn -sudo -u git -H cp /home/git/gitlab/config/unicorn.rb /home/git/gitlab/config/unicorn.rb.old -sudo -u git -H cp /home/git/gitlab/config/unicorn.rb.example /home/git/gitlab/config/unicorn.rb - -# Nginx -# Replace path from '/home/gitlab/' to '/home/git/' -sudo vim /etc/nginx/sites-enabled/gitlab -sudo service nginx restart - -``` - -## 7. Start GitLab instance - -``` -sudo service gitlab start - -# check if unicorn and sidekiq started -# If not try to logout, also check replaced path from '/home/gitlab/' to '/home/git/' -# in Nginx, unicorn, init.d etc -ps aux | grep unicorn -ps aux | grep sidekiq - -``` - -## 8. Check installation - - -```bash -# In 5-10 seconds lets check gitlab-shell -sudo -u git -H /home/git/gitlab-shell/bin/check - -# Example of success output -# Check GitLab API access: OK -# Check directories and files: -# /home/git/repositories: OK -# /home/git/.ssh/authorized_keys: OK - - -# Now check GitLab instance -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -``` - -## 9. Cleanup - -**If everything works as expected you can cleanup some old things** -Recommend you wait a bit and do a backup before completing the following. - -```bash -# remove GitLab user from system -sudo userdel -r gitlab - -cd /home/git - -# cleanup .profile -## remove text from .profile added during gitolite installation: -## PATH=\$PATH:/home/git/bin -## export PATH -## to see what a clean .profile for new users on your system would look like see /etc/skel/.profile -sudo -u git -H vim .profile - -# remove gitolite -sudo rm -R bin -sudo rm -Rf gitolite -sudo rm -R .gitolite -sudo rm .gitolite.rc -sudo rm -f gitlab.pub -sudo rm projects.list - -# reset tmp folders -sudo service gitlab stop -cd /home/git/gitlab -sudo rm -R tmp -sudo -u git -H mkdir tmp -sudo chmod -R u+rwX tmp/ - -# create directory for pids, make sure GitLab can write to it -sudo -u git -H mkdir tmp/pids/ -sudo chmod -R u+rwX tmp/pids/ - -# if you are already running a newer version of GitLab check that installation guide for other tmp folders you need to create - -# reboot system -sudo reboot - -# login, check that GitLab is running fine -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/5.0-to-5.1.md b/doc/update/5.0-to-5.1.md index 7067ea4c40c..8514aa13f48 100644 --- a/doc/update/5.0-to-5.1.md +++ b/doc/update/5.0-to-5.1.md @@ -1,105 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 5.0 to 5.1 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/5.0-to-5.1.md) for the most up to date instructions.* - -## Warning - -GitLab 5.1 is affected by critical security vulnerability CVE-2013-4490. - -## Release notes - -- `unicorn` replaced with `puma` -- merge request cached diff will be truncated - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch -sudo -u git -H git checkout 5-1-stable -``` - -## 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.3.0 -# replace your old config with the new one -sudo -u git -H mv config.yml config.yml.old -sudo -u git -H cp config.yml.example config.yml -# edit options to match old config -sudo -u git -H vi config.yml -``` - -## 4. Install libs, migrations etc - -```bash -cd /home/git/gitlab -sudo rm tmp/sockets/gitlab.socket -sudo -u git -H cp config/puma.rb.example config/puma.rb - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production -sudo -u git -H bundle exec rake migrate_merge_requests RAILS_ENV=production -sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production -``` - -## 5. Update init.d script with a new one - -```bash -# init.d -sudo rm /etc/init.d/gitlab -sudo curl --location --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/5-1-stable/init.d/gitlab -sudo chmod +x /etc/init.d/gitlab -``` - -## 6. MySQL grant privileges - -Only if you are using MySQL: - -```bash -mysql -u root -p -mysql> GRANT LOCK TABLES ON `gitlabhq_production`.* TO 'gitlab'@'localhost'; -mysql> \q -``` - -## 7. Start application - - sudo service gitlab start - -## 8. Check installation - - -```bash -# In 5-10 seconds lets check gitlab-shell -sudo -u git -H /home/git/gitlab-shell/bin/check - -# Example of success output -# Check GitLab API access: OK -# Check directories and files: -# /home/git/repositories: OK -# /home/git/.ssh/authorized_keys: OK - - -# Now check gitlab instance -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -``` +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/5.1-to-5.2.md b/doc/update/5.1-to-5.2.md index bcc9058ff99..8514aa13f48 100644 --- a/doc/update/5.1-to-5.2.md +++ b/doc/update/5.1-to-5.2.md @@ -1,124 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 5.1 to 5.2 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/5.1-to-5.2.md) for the most up to date instructions.* - -## Warning - -GitLab 5.2 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. - -## 0. Backup - -It's useful to make a backup just in case things go south: -(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version) - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch -sudo -u git -H git checkout 5-2-stable -``` - -## 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.4.0 -``` - -## 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production -``` - -## 5. Update config files - -- Make `/home/git/gitlab/config/gitlab.yml` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/5-2-stable/config/gitlab.yml.example> but with your settings. -- Make `/home/git/gitlab/config/puma.rb` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/5-2-stable/config/puma.rb.example> but with your settings. - -## 6. Update Init script - -```bash -cd /home/git/gitlab -sudo rm /etc/init.d/gitlab -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -sudo chmod +x /etc/init.d/gitlab -``` - -## 7. Create uploads directory - -```bash -cd /home/git/gitlab -sudo -u git -H mkdir public/uploads -sudo chmod -R u+rwX public/uploads -``` - -## 8. Start application - - sudo service gitlab start - sudo service nginx restart - -## 9. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade complete! - -## Things went south? Revert to previous version (5.1) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 5.0 to 5.1](5.0-to-5.1.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/5.1-to-5.4.md b/doc/update/5.1-to-5.4.md index 5767c9cc121..8514aa13f48 100644 --- a/doc/update/5.1-to-5.4.md +++ b/doc/update/5.1-to-5.4.md @@ -1,120 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 5.1 to 5.4 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/5.1-to-5.4.md) for the most up to date instructions.* - -Also works starting from 5.2. - -## 0. Backup - -It's useful to make a backup just in case things go south (with MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version): - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch -sudo -u git -H git checkout 5-4-stable # Latest version of 5-4-stable addresses CVE-2013-4489 -``` - -## 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulnerabilities -``` - -## 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production -``` - -## 5. Update config files - -- Make `/home/git/gitlab/config/gitlab.yml` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/5-4-stable/config/gitlab.yml.example> but with your settings. -- Make `/home/git/gitlab/config/puma.rb` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/5-4-stable/config/puma.rb.example> but with your settings. - -## 6. Update Init script - -```bash -sudo rm /etc/init.d/gitlab -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -sudo chmod +x /etc/init.d/gitlab -``` - -## 7. Create uploads directory - -```bash -cd /home/git/gitlab -sudo -u git -H mkdir public/uploads -sudo chmod -R u+rwX public/uploads -``` - -## 8. Start application - - sudo service gitlab start - sudo service nginx restart - -## 9. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade complete! - -## Things went south? Revert to previous version (5.3) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 5.2 to 5.3](5.2-to-5.3.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/5.1-to-6.0.md b/doc/update/5.1-to-6.0.md index 4993d034b6e..8514aa13f48 100644 --- a/doc/update/5.1-to-6.0.md +++ b/doc/update/5.1-to-6.0.md @@ -1,236 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 5.1 to 6.0 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/5.1-to-6.0.md) for the most up to date instructions.* - -## Warning - -GitLab 6.0 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. - -## Deprecations - -### Global projects - -The root (global) namespace for projects is deprecated. - -So you need to move all your global projects under groups or users manually before update or they will be automatically moved to the project owner namespace during the update. When a project is moved all its members will receive an email with instructions how to update their git remote URL. Please make sure you disable sending email when you do a test of the upgrade. - -### Teams - -We introduce group membership in 6.0 as a replacement for teams. - -The old combination of groups and teams was confusing for a lot of people. - -And when the members of a team where changed this wasn't reflected in the project permissions. - -In GitLab 6.0 you will be able to add members to a group with a permission level for each member. - -These group members will have access to the projects in that group. - -Any changes to group members will immediately be reflected in the project permissions. - -You can even have multiple owners for a group, greatly simplifying administration. - -## 0. Backup & prepare for update - -It's useful to make a backup just in case things go south: -(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version) - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -The migrations in this update are very sensitive to incomplete or inconsistent data. If you have a long-running GitLab installation and some of the previous upgrades did not work out 100% correct this may bite you now. The following can help you have a more smooth upgrade. - -### Find projects with invalid project names - -#### MySQL -Login to MySQL: - - mysql -u root -p - -Find projects with invalid names: - -```bash -mysql> use gitlabhq_production; - -# find projects with invalid first char, projects must start with letter -mysql> select name from projects where name REGEXP '^[^A-Za-z]'; - -# find projects with other invalid chars -## names must only contain alphanumeric chars, underscores, spaces, periods, and dashes -mysql> select name from projects where name REGEXP '[^a-zA-Z0-9_ .-]+'; -``` - -If any projects have invalid names try correcting them from the web interface before starting the upgrade. -If correcting them from the web interface fails you can correct them using MySQL: - -```bash -# e.g. replace invalid / with allowed _ -mysql> update projects set name = REPLACE(name,'/','_'); -# repeat for all invalid chars found in project names -``` - -#### PostgreSQL -Make sure all project names start with a letter and only contain alphanumeric chars, underscores, spaces, periods, and dashes (a-zA-Z0-9_ .-). - -### Find other common errors - -``` -cd /home/git/gitlab -# Start rails console -sudo -u git -H bin/rails console production - -# Make sure none of the following rails commands return results - -# All project owners should have an owner: -Project.all.select { |project| project.owner.blank? } - -# Every user should have a namespace: -User.all.select { |u| u.namespace.blank? } - -# Projects in the global namespace should not conflict with projects in the owner namespace: -Project.where(namespace_id: nil).select { |p| Project.where(path: p.path, namespace_id: p.owner.try(:namespace).try(:id)).present? } -``` - -If any of the above rails commands returned results other than `=> []` try correcting the issue from the web interface. - -If you find projects without an owner (first rails command above), correct it. For MySQL setups: - -```bash -# get your user id -mysql> select id, name from users order by name; - -# set yourself as owner of project -# replace your_user_id with your user id and bad_project_id with the project id from the rails command -mysql> update projects set creator_id=your_user_id where id=bad_project_id; -``` - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch -sudo -u git -H git checkout 6-0-stable -``` - -## 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.7.9 -``` - -## 4. Install additional packages - -```bash -# For reStructuredText markup language support install required package: -sudo apt-get install python-docutils -``` - -## 5. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production -sudo -u git -H bundle exec rake migrate_groups RAILS_ENV=production -sudo -u git -H bundle exec rake migrate_global_projects RAILS_ENV=production -sudo -u git -H bundle exec rake migrate_keys RAILS_ENV=production -sudo -u git -H bundle exec rake migrate_inline_notes RAILS_ENV=production -sudo -u git -H bundle exec rake gitlab:satellites:create RAILS_ENV=production - -# Clear redis cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production - -# Clear and precompile assets -sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production -sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production - -#Add dealing with newlines for editor -sudo -u git -H git config --global core.autocrlf input -``` - -## 6. Update config files - -Note: We switched from Puma in GitLab 5.x to unicorn in GitLab 6.0. - -- Make `/home/git/gitlab/config/gitlab.yml` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/6-0-stable/config/gitlab.yml.example> but with your settings. -- Make `/home/git/gitlab/config/unicorn.rb` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/6-0-stable/config/unicorn.rb.example> but with your settings. - -## 7. Update Init script - -```bash -cd /home/git/gitlab -sudo rm /etc/init.d/gitlab -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -sudo chmod +x /etc/init.d/gitlab -``` - -## 8. Create uploads directory - -```bash -cd /home/git/gitlab -sudo -u git -H mkdir -p public/uploads -sudo chmod -R u+rwX public/uploads -``` - -## 9. Start application - - sudo service gitlab start - sudo service nginx restart - -## 10. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade complete! - -## Things went south? Revert to previous version (5.1) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 5.0 to 5.1](5.0-to-5.1.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/5.2-to-5.3.md b/doc/update/5.2-to-5.3.md index c378d2798f4..8514aa13f48 100644 --- a/doc/update/5.2-to-5.3.md +++ b/doc/update/5.2-to-5.3.md @@ -1,106 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 5.2 to 5.3 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/5.2-to-5.3.md) for the most up to date instructions.* - -## Warning - -GitLab 5.3 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. - -## 0. Backup - -It's useful to make a backup just in case things go south (with MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version): - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch -sudo -u git -H git checkout 5-3-stable -``` - -## 3. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production -``` - -## 4. Update config files - -- Make `/home/git/gitlab/config/gitlab.yml` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/5-3-stable/config/gitlab.yml.example> but with your settings. -- Make `/home/git/gitlab/config/puma.rb` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/5-3-stable/config/puma.rb.example> but with your settings. - -## 5. Update Init script - -```bash -sudo rm /etc/init.d/gitlab -sudo curl --location --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/5-3-stable/lib/support/init.d/gitlab -sudo chmod +x /etc/init.d/gitlab -``` - -## 6. Start application - - sudo service gitlab start - sudo service nginx restart - -## 7. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade complete! - -## Things went south? Revert to previous version (5.2) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 5.1 to 5.2](5.1-to-5.2.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/5.3-to-5.4.md b/doc/update/5.3-to-5.4.md index 77b1e9e5329..8514aa13f48 100644 --- a/doc/update/5.3-to-5.4.md +++ b/doc/update/5.3-to-5.4.md @@ -1,110 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 5.3 to 5.4 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/5.3-to-5.4.md) for the most up to date instructions.* - -## 0. Backup - -It's useful to make a backup just in case things go south (with MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version): - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch -sudo -u git -H git checkout 5-4-stable # Latest version of 5-4-stable addresses CVE-2013-4489 -``` - -## 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulnerabilities -``` - -## 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production -``` - -## 5. Update config files - -- Make `/home/git/gitlab/config/gitlab.yml` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/5-4-stable/config/gitlab.yml.example> but with your settings. -- Make `/home/git/gitlab/config/puma.rb` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/5-4-stable/config/puma.rb.example> but with your settings. - -## 6. Update Init script - -```bash -sudo rm /etc/init.d/gitlab -sudo curl --location --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/5-4-stable/lib/support/init.d/gitlab -sudo chmod +x /etc/init.d/gitlab -``` - -## 7. Start application - - sudo service gitlab start - sudo service nginx restart - -## 8. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade complete! - -## Things went south? Revert to previous version (5.3) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 5.2 to 5.3](5.2-to-5.3.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/5.4-to-6.0.md b/doc/update/5.4-to-6.0.md index 2d2da769b89..8514aa13f48 100644 --- a/doc/update/5.4-to-6.0.md +++ b/doc/update/5.4-to-6.0.md @@ -1,169 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 5.4 to 6.0 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/5.4-to-6.0.md) for the most up to date instructions.* - -## Warning - -GitLab 6.0 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. - -**You need to follow this guide first, before updating past 6.0, as it contains critical migration steps that are only present -in the `6-0-stable` branch** - -## Deprecations - -### Global projects - -The root (global) namespace for projects is deprecated. - -So you need to move all your global projects under groups or users manually before update or they will be automatically moved to the project owner namespace during the update. When a project is moved all its members will receive an email with instructions how to update their git remote URL. Please make sure you disable sending email when you do a test of the upgrade. - -### Teams - -We introduce group membership in 6.0 as a replacement for teams. - -The old combination of groups and teams was confusing for a lot of people. - -And when the members of a team where changed this wasn't reflected in the project permissions. - -In GitLab 6.0 you will be able to add members to a group with a permission level for each member. - -These group members will have access to the projects in that group. - -Any changes to group members will immediately be reflected in the project permissions. - -You can even have multiple owners for a group, greatly simplifying administration. - -## 0. Backup - -It's useful to make a backup just in case things go south (with MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version): - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch -sudo -u git -H git checkout 6-0-stable -``` - -## 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.7.9 -``` - -## 4. Install additional packages - -```bash -# For reStructuredText markup language support install required package: -sudo apt-get install python-docutils -``` - -## 5. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production -sudo -u git -H bundle exec rake migrate_groups RAILS_ENV=production -sudo -u git -H bundle exec rake migrate_global_projects RAILS_ENV=production -sudo -u git -H bundle exec rake migrate_keys RAILS_ENV=production -sudo -u git -H bundle exec rake migrate_inline_notes RAILS_ENV=production -sudo -u git -H bundle exec rake gitlab:satellites:create RAILS_ENV=production - -# Clear redis cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production - -# Clear and precompile assets -sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production -sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production -``` - -## 6. Update config files - -Note: We switched from Puma in GitLab 5.4 to unicorn in GitLab 6.0. - -- Make `/home/git/gitlab/config/gitlab.yml` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example> but with your settings. -- Make `/home/git/gitlab/config/unicorn.rb` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/unicorn.rb.example> but with your settings. - -## 7. Update Init script - -```bash -sudo rm /etc/init.d/gitlab -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -sudo chmod +x /etc/init.d/gitlab -``` - -## 8. Start application - - sudo service gitlab start - sudo service nginx restart - -## 9. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade complete! - -## Troubleshooting - -The migrations in this update are very sensitive to incomplete or inconsistent data. If you have a long-running GitLab installation and some of the previous upgrades did not work out 100% correct this may bite you now. The following commands can be run in the rails console to look for 'bad' data. - -All project owners should have an owner: - -``` -Project.all.select { |project| project.owner.blank? } -``` - -Every user should have a namespace: - -``` -User.all.select { |u| u.namespace.blank? } -``` - -Projects in the global namespace should not conflict with projects in the owner namespace: - -``` -Project.where(namespace_id: nil).select { |p| Project.where(path: p.path, namespace_id: p.owner.try(:namespace).try(:id)).present? } -``` +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/6.0-to-6.1.md b/doc/update/6.0-to-6.1.md index dd409175c27..8514aa13f48 100644 --- a/doc/update/6.0-to-6.1.md +++ b/doc/update/6.0-to-6.1.md @@ -1,127 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 6.0 to 6.1 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/6.0-to-6.1.md) for the most up to date instructions.* - -## Warning - -GitLab 6.1 is affected by critical security vulnerabilities CVE-2013-4490 and CVE-2013-4489. - -**In 6.1 we remove a lot of deprecated code.** - -**You should update to 6.0 before installing 6.1 so all the necessary conversions are run.** - -## Deprecations - -### Global issue numbers - -In 6.1 issue numbers are project specific. This means all issues are renumbered and get a new number in their URL. If you use an old issue number URL and the issue number does not exist yet you are redirected to the new one. This conversion does not trigger if the old number already exists for this project, this is unlikely but will happen with old issues and large projects. - -## 0. Backup - -It's useful to make a backup just in case things go south (with MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version): - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -sudo -u git -H git checkout 6-1-stable -# For GitLab Enterprise Edition: sudo -u git -H git checkout 6-1-stable-ee -``` - -## 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.7.9 -``` - -## 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production -sudo -u git -H bundle exec rake migrate_iids RAILS_ENV=production -sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production -sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -## 5. Update config files - -- Make `/home/git/gitlab/config/gitlab.yml` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/6-1-stable/config/gitlab.yml.example> but with your settings. -- Make `/home/git/gitlab/config/unicorn.rb` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/6-1-stable/config/unicorn.rb.example> but with your settings. - -## 6. Update Init script - -```bash -sudo rm /etc/init.d/gitlab -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -## 7. Start application - - sudo service gitlab start - sudo service nginx restart - -## 8. Check application status - -Check if GitLab and its environment are configured correctly: - - cd /home/git/gitlab - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade complete! - -## Things went south? Revert to previous version (6.0) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 5.4 to 6.0](5.4-to-6.0.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/6.1-to-6.2.md b/doc/update/6.1-to-6.2.md index cace80c99b7..8514aa13f48 100644 --- a/doc/update/6.1-to-6.2.md +++ b/doc/update/6.1-to-6.2.md @@ -1,141 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 6.1 to 6.2 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/6.1-to-6.2.md) for the most up to date instructions.* - -**You should update to 6.1 before installing 6.2 so all the necessary conversions are run.** - -## 0. Backup - -It's useful to make a backup just in case things go south: (With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version). - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -sudo -u git -H git checkout 6-2-stable # Latest version of 6-2-stable addresses CVE-2013-4489 -# For GitLab Enterprise Edition: sudo -u git -H git checkout 6-2-stable-ee -``` - -## 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulnerabilities -``` - -## 4. Install additional packages - -```bash -# Add support for logrotate for better log file handling -sudo apt-get install logrotate -``` - -## 5. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production -sudo -u git -H bundle exec rake assets:clean RAILS_ENV=production -sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -## 6. Update config files - -TIP: to see what changed in `gitlab.yml.example` in this release use next command: - -``` -git diff 6-1-stable:config/gitlab.yml.example 6-2-stable:config/gitlab.yml.example -``` - -- Make `/home/git/gitlab/config/gitlab.yml` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/6-2-stable/config/gitlab.yml.example> but with your settings. - -- Make `/home/git/gitlab/config/unicorn.rb` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/6-2-stable/config/unicorn.rb.example> but with your settings. - -- Copy rack attack middleware config: - - ```bash - sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb - ``` - -- Uncomment `config.middleware.use Rack::Attack` in `/home/git/gitlab/config/application.rb` - -- Set up logrotate. - -```bash -sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab -``` - -## 7. Update Init script - -```bash -sudo rm /etc/init.d/gitlab -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -## 8. Start application - - sudo service gitlab start - sudo service nginx restart - -## 9. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade complete! - -## Things went south? Revert to previous version (6.1) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 6.0 to 6.1](6.0-to-6.1.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/6.2-to-6.3.md b/doc/update/6.2-to-6.3.md index 7205575942a..8514aa13f48 100644 --- a/doc/update/6.2-to-6.3.md +++ b/doc/update/6.2-to-6.3.md @@ -1,127 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 6.2 to 6.3 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/6.2-to-6.3.md) for the most up to date instructions.* - -**Requires version: 6.1 or 6.2.** - -## 0. Backup - -It's useful to make a backup just in case things go south: (With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version) - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -sudo -u git -H git checkout 6-3-stable -# For GitLab Enterprise Edition: sudo -u git -H git checkout 6-3-stable-ee -``` - -## 3. Update gitlab-shell (and its config) - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.7.9 # Addresses multiple critical security vulnerabilities -``` - -The gitlab-shell config changed recently, so check for config file changes and make `/home/git/gitlab-shell/config.yml` the same as <https://github.com/gitlabhq/gitlab-shell/blob/master/config.yml.example> - -## 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production -``` - -## 5. Update config files - -TIP: to see what changed in gitlab.yml.example in this release use next command: - -``` -git diff 6-2-stable:config/gitlab.yml.example 6-3-stable:config/gitlab.yml.example -``` - -- Make `/home/git/gitlab/config/gitlab.yml` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/6-3-stable/config/gitlab.yml.example> but with your settings. -- Make `/home/git/gitlab/config/unicorn.rb` same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/6-3-stable/config/unicorn.rb.example> but with your settings. - -```bash -# Copy rack attack middleware config -cd /home/git/gitlab -sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb -``` - -## 6. Update Init script - -```bash -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -## 7. Start application - - sudo service gitlab start - sudo service nginx restart - -## 8. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade complete! - -## Things went south? Revert to previous version (6.2) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 6.1 to 6.2](6.1-to-6.2.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/6.3-to-6.4.md b/doc/update/6.3-to-6.4.md index 285ed06bdad..8514aa13f48 100644 --- a/doc/update/6.3-to-6.4.md +++ b/doc/update/6.3-to-6.4.md @@ -1,109 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 6.3 to 6.4 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/6.3-to-6.4.md) for the most up to date instructions.* - -## 0. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - -```bash -sudo service gitlab stop -```` - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -sudo -u git -H git checkout 6-4-stable -# For GitLab Enterprise Edition: sudo -u git -H git checkout 6-4-stable-ee -``` - -## 3. Update gitlab-shell (and its config) - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.8.0 -``` - -## 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -## 5. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -## 6. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check with: - -```bash -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations upgrade complete! - -## Things went south? Revert to previous version (6.3) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 6.2 to 6.3](6.2-to-6.3.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/6.4-to-6.5.md b/doc/update/6.4-to-6.5.md index e07c98a5ad4..8514aa13f48 100644 --- a/doc/update/6.4-to-6.5.md +++ b/doc/update/6.4-to-6.5.md @@ -1,115 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 6.4 to 6.5 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/6.4-to-6.5.md) for the most up to date instructions.* - -## 0. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 6-5-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 6-5-stable-ee -``` - -## 3. Update gitlab-shell (and its config) - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.8.0 -``` - -## 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -## 5. Start application - - sudo service gitlab start - sudo service nginx restart - -## 6. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -## Things went south? Revert to previous version (6.4) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 6.3 to 6.4](6.3-to-6.4.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/6.5-to-6.6.md b/doc/update/6.5-to-6.6.md index 3f79b19644e..8514aa13f48 100644 --- a/doc/update/6.5-to-6.6.md +++ b/doc/update/6.5-to-6.6.md @@ -1,117 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 6.5 to 6.6 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/6.5-to-6.6.md) for the most up to date instructions.* - -## 0. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 6-6-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 6-6-stable-ee -``` - -## 3. Update gitlab-shell (and its config) - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.8.0 -``` - -## 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# The Modernizr gem was yanked from RubyGems. It is required for GitLab >= 2.8.0 -# Edit `Gemfile` and change `gem "modernizr", "2.5.3"` to -# `gem "modernizr-rails", "2.7.1"`` -sudo -u git -H vim Gemfile - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -## 5. Start application - - sudo service gitlab start - sudo service nginx restart - -## 6. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -## Things went south? Revert to previous version (6.5) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 6.4 to 6.5](6.4-to-6.5.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/6.6-to-6.7.md b/doc/update/6.6-to-6.7.md index a0542d20d49..8514aa13f48 100644 --- a/doc/update/6.6-to-6.7.md +++ b/doc/update/6.6-to-6.7.md @@ -1,123 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 6.6 to 6.7 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/6.6-to-6.7.md) for the most up to date instructions.* - -## 0. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - - sudo service gitlab stop - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 6-7-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 6-7-stable-ee -``` - -## 3. Update gitlab-shell (and its config) - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.9.1 -``` - -## 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test postgres --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL - -# Run a bundle install without deployment to generate the new Gemfile -sudo -u git -H bundle install --without development test mysql --no-deployment - -# Install libs (with deployment this time) -sudo -u git -H bundle install --without development test mysql --deployment - -# Both MySQL and PostgreSQL -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - -# Update the logrotate configuration (keep logs for 90 days instead of 52 weeks) -sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab - -# Compress existing .log.1 files because we turned off delaycompress in logrotate -sudo -u git -H gzip /home/git/gitlab/log/*.log.1 -sudo -u git -H gzip /home/git/gitlab-shell/gitlab-shell.log.1 - -# Close access to gitlab-satellites for others -sudo chmod u+rwx,g=rx,o-rwx /home/git/gitlab-satellites - -# Add directory for uploads -sudo -u git -H mkdir -p /home/git/gitlab/public/uploads -``` - -## 5. Start application - - sudo service gitlab start - sudo service nginx restart - -## 6. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -## Things went south? Revert to previous version (6.6) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 6.5 to 6.6](6.5-to-6.6.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/6.7-to-6.8.md b/doc/update/6.7-to-6.8.md index acf004577f1..8514aa13f48 100644 --- a/doc/update/6.7-to-6.8.md +++ b/doc/update/6.7-to-6.8.md @@ -1,126 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 6.7 to 6.8 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/6.7-to-6.8.md) for the most up to date instructions.* - -## 0. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 1. Stop server - -```bash -sudo service gitlab stop -``` - -## 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 6-8-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 6-8-stable-ee -``` - -## 3. Update gitlab-shell (and its config) - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.9.3 -``` - -## 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - -# Close access to gitlab-satellites for others -sudo chmod u+rwx,g=rx,o-rwx /home/git/gitlab-satellites -``` - -## 5. Update config files - -### New configuration options for gitlab.yml - -There are new configuration options available for gitlab.yml. View them with the command below and apply them to your current gitlab.yml if desired. - -``` -git diff 6-7-stable:config/gitlab.yml.example 6-8-stable:config/gitlab.yml.example -``` - -### MySQL? Remove reaping frequency - -If you are using MySQL as a database, remove `reaping_frequency` from you database.yml to prevent crashes. [Relevant commit](https://gitlab.com/gitlab-org/gitlab-ce/commit/5163a8fcb9cfd63435560fda00173b76df2ccc93). - -### HTTPS? Disable gzip - -If you are using HTTPS, disable gzip as in [this commit](https://gitlab.com/gitlab-org/gitlab-ce/commit/563fec734912d81cd7caea6fa8ec2b397fb72a9b) to prevent BREACH attacks. - -### Turn on asset compression - -To improve performance, enable gzip asset compression as seen [in this commit](https://gitlab.com/gitlab-org/gitlab-ce/commit/8af94ed75505f0253823b9b2d44320fecea5b5fb). - -## 6. Start application - - sudo service gitlab start - sudo service nginx restart - -## 7. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -## Things went south? Revert to previous version (6.7) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 6.6 to 6.7](6.6-to-6.7.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/6.8-to-6.9.md b/doc/update/6.8-to-6.9.md index 3d7b1e5346b..8514aa13f48 100644 --- a/doc/update/6.8-to-6.9.md +++ b/doc/update/6.8-to-6.9.md @@ -1,107 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 6.8 to 6.9 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/6.8-to-6.9.md) for the most up to date instructions.* - -### 0. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 6-9-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 6-9-stable-ee -``` - -### 3. Update gitlab-shell (and its config) - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.9.4 -``` - -### 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production -``` - -### 5. Update config files - -#### New configuration options for gitlab.yml - -There are new configuration options available for gitlab.yml. View them with the command below and apply them to your current gitlab.yml if desired. - -``` -git diff 6-8-stable:config/gitlab.yml.example 6-9-stable:config/gitlab.yml.example -``` - -### 6. Start application - - sudo service gitlab start - sudo service nginx restart - -### 7. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -## Things went south? Revert to previous version (6.8) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 6.7 to 6.8](6.7-to-6.8.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/6.9-to-7.0.md b/doc/update/6.9-to-7.0.md index e1ca34305b4..8514aa13f48 100644 --- a/doc/update/6.9-to-7.0.md +++ b/doc/update/6.9-to-7.0.md @@ -1,145 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 6.9 to 7.0 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/6.9-to-7.0.md) for the most up to date instructions.* - -### 0. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Update Ruby - -If you are still using Ruby 1.9.3 or below, you will need to update Ruby. -You can check which version you are running with `ruby -v`. - -If you are you running Ruby 2.0.x, you do not need to upgrade ruby, but can consider doing so for performance reasons. - -If you are running Ruby 2.1.1 consider upgrading to 2.1.2, because of the high memory usage of Ruby 2.1.1. - -Install, update dependencies: - -```bash -sudo apt-get install build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl -``` - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --location --progress ftp://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz | tar xz -cd ruby-2.1.2 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 3. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-0-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-0-stable-ee -``` - -### 4. Update gitlab-shell (and its config) - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.9.6 -``` - -### 5. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 6. Update config files - -#### New configuration options for gitlab.yml - -There are new configuration options available for gitlab.yml. View them with the command below and apply them to your current gitlab.yml if desired. - -``` -git diff origin/6-9-stable:config/gitlab.yml.example origin/7-0-stable:config/gitlab.yml.example -``` - -- HTTP setups: Make `/etc/nginx/sites-available/nginx` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/lib/support/nginx/gitlab> but with your settings. -- HTTPS setups: Make `/etc/nginx/sites-available/nginx-ssl` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/lib/support/nginx/gitlab-ssl> but with your setting. - -### 7. Start application - - sudo service gitlab start - sudo service nginx restart - -### 8. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -## Things went south? Revert to previous version (6.9) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 6.8 to 6.9](6.8-to-6.9.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/6.x-or-7.x-to-7.14.md b/doc/update/6.x-or-7.x-to-7.14.md index 674163091be..8514aa13f48 100644 --- a/doc/update/6.x-or-7.x-to-7.14.md +++ b/doc/update/6.x-or-7.x-to-7.14.md @@ -1,317 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 6.x or 7.x to 7.14 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/6.x-or-7.x-to-7.14.md) for the most up to date instructions.* - -This allows you to upgrade any version of GitLab from 6.0 and up (including 7.0 and up) to 7.14. - -## Global issue numbers - -As of 6.1 issue numbers are project specific. This means all issues are renumbered and get a new number in their URL. If you use an old issue number URL and the issue number does not exist yet you are redirected to the new one. This conversion does not trigger if the old number already exists for this project, this is unlikely but will happen with old issues and large projects. - -## Editable labels - -In GitLab 7.2 we replace Issue and Merge Request tags with labels, making it -possible to edit the label text and color. The characters `?`, `&` and `,` are -no longer allowed however so those will be removed from your tags during the -database migrations for GitLab 7.2. - -## Stash changes - -If you deleted the vendors folder during your original installation, [you will get an error](https://gitlab.com/gitlab-org/gitlab-ce/issues/1494) when you attempt to rebuild the assets in step 7. To avoid this, stash the changes in your GitLab working copy before starting: - - git stash - -## 0. Stop server - - sudo service gitlab stop - -## 1. Backup - -It's useful to make a backup just in case things go south: -(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version) - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -## 2. Update Ruby - -If you are still using Ruby 1.9.3 or below, you will need to update Ruby. -You can check which version you are running with `ruby -v`. - -If you are you running Ruby 2.0.x, you do not need to upgrade ruby, but can consider doing so for performance reasons. - -If you are running Ruby 2.1.1 consider upgrading to 2.1.6, because of the high memory usage of Ruby 2.1.1. - -Install, update dependencies: - -```bash -sudo apt-get install build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl -``` - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --progress https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.6.tar.gz | tar xz -cd ruby-2.1.6 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -## 3. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-14-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-14-stable-ee -``` - -## 4. Install additional packages - -```bash -# Add support for logrotate for better log file handling -sudo apt-get install logrotate - -# Install pkg-config and cmake, which is needed for the latest versions of rugged -sudo apt-get install pkg-config cmake - -# If you want to use Kerberos with GitLab EE for user authentication, install Kerberos header files -# If you don't know what Kerberos is, you can assume you don't need it. -sudo apt-get install libkrb5-dev - -# Install nodejs, javascript runtime required for assets -sudo apt-get install nodejs -``` - -## 5. Configure Redis to use sockets - - # Configure redis to use sockets - sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.orig - # Disable Redis listening on TCP by setting 'port' to 0 - sed 's/^port .*/port 0/' /etc/redis/redis.conf.orig | sudo tee /etc/redis/redis.conf - # Enable Redis socket for default Debian / Ubuntu path - echo 'unixsocket /var/run/redis/redis.sock' | sudo tee -a /etc/redis/redis.conf - # Be sure redis group can write to the socket, enable only if supported (>= redis 2.4.0). - sudo sed -i '/# unixsocketperm/ s/^# unixsocketperm.*/unixsocketperm 0775/' /etc/redis/redis.conf - # Activate the changes to redis.conf - sudo service redis-server restart - # Add git to the redis group - sudo usermod -aG redis git - - # Configure Redis connection settings - sudo -u git -H cp config/resque.yml.example config/resque.yml - # Change the Redis socket path if you are not using the default Debian / Ubuntu configuration - sudo -u git -H editor config/resque.yml - - # Configure gitlab-shell to use Redis sockets - sudo -u git -H sed -i 's|^ # socket.*| socket: /var/run/redis/redis.sock|' /home/git/gitlab-shell/config.yml - -## 6. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.6.5 -``` - -## 7. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations from 6.0 to 6.1 -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production VERSION=20130909132950 - -# Enable internal issue IDs (introduced in GitLab 6.1) -sudo -u git -H bundle exec rake migrate_iids RAILS_ENV=production - -# Run left database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Close access to gitlab-satellites for others -sudo chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -## 8. Update config files - -TIP: to see what changed in `gitlab.yml.example` in this release use next command: - -``` -git diff 6-0-stable:config/gitlab.yml.example 7-14-stable:config/gitlab.yml.example -``` - -- Make `/home/git/gitlab/config/gitlab.yml` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/7-14-stable/config/gitlab.yml.example> but with your settings. -- Make `/home/git/gitlab/config/unicorn.rb` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/7-14-stable/config/unicorn.rb.example> but with your settings. -- Make `/home/git/gitlab-shell/config.yml` the same as <https://gitlab.com/gitlab-org/gitlab-shell/blob/v2.6.5/config.yml.example> but with your settings. -- Copy rack attack middleware config. - -```bash -sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb -``` - -- Set up logrotate - -```bash -sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab -``` - -### Change Nginx settings - -- HTTP setups: Make `/etc/nginx/sites-available/gitlab` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/7-14-stable/lib/support/nginx/gitlab> but with your settings. -- HTTPS setups: Make `/etc/nginx/sites-available/gitlab-ssl` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/7-14-stable/lib/support/nginx/gitlab-ssl> but with your settings. -- A new `location /uploads/` section has been added that needs to have the same content as the existing `location @gitlab` section. - -### Check the version of /usr/local/bin/git - -If you installed Git from source into /usr/local/bin/git then please [check -your version](7.13-to-7.14.md). - -## 9. Start application - - sudo service gitlab start - sudo service nginx restart - -## 10. Check application status - -Check if GitLab and its environment are configured correctly: - - cd /home/git/gitlab - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade complete! - -## 11. Update OmniAuth configuration - -When using Google omniauth login, changes of the Google account required. -Ensure that `Contacts API` and the `Google+ API` are enabled in the [Google Developers Console](https://console.developers.google.com/). -More details can be found at the [integration documentation](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/integration/google.md). - -## 12. Optional optimizations for GitLab setups with MySQL databases - -Only applies if running MySQL database created with GitLab 6.7 or earlier. If you are not experiencing any issues you may not need the following instructions however following them will bring your database in line with the latest recommended installation configuration and help avoid future issues. Be sure to follow these directions exactly. These directions should be safe for any MySQL instance but to be sure make a current MySQL database backup beforehand. - -``` -# Stop GitLab -sudo service gitlab stop - -# Secure your MySQL installation (added in GitLab 6.2) -sudo mysql_secure_installation - -# Login to MySQL -mysql -u root -p - -# do not type the 'mysql>', this is part of the prompt - -# Convert all tables to use the InnoDB storage engine (added in GitLab 6.8) -SELECT CONCAT('ALTER TABLE gitlabhq_production.', table_name, ' ENGINE=InnoDB;') AS 'Copy & run these SQL statements:' FROM information_schema.tables WHERE table_schema = 'gitlabhq_production' AND `ENGINE` <> 'InnoDB' AND `TABLE_TYPE` = 'BASE TABLE'; - -# If previous query returned results, copy & run all shown SQL statements - -# Convert all tables to correct character set -SET foreign_key_checks = 0; -SELECT CONCAT('ALTER TABLE gitlabhq_production.', table_name, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;') AS 'Copy & run these SQL statements:' FROM information_schema.tables WHERE table_schema = 'gitlabhq_production' AND `TABLE_COLLATION` <> 'utf8_unicode_ci' AND `TABLE_TYPE` = 'BASE TABLE'; - -# If previous query returned results, copy & run all shown SQL statements - -# turn foreign key checks back on -SET foreign_key_checks = 1; - -# Find MySQL users -mysql> SELECT user FROM mysql.user WHERE user LIKE '%git%'; - -# If git user exists and gitlab user does not exist -# you are done with the database cleanup tasks -mysql> \q - -# If both users exist skip to Delete gitlab user - -# Create new user for GitLab (changed in GitLab 6.4) -# change $password in the command below to a real password you pick -mysql> CREATE USER 'git'@'localhost' IDENTIFIED BY '$password'; - -# Grant the git user necessary permissions on the database -mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES ON `gitlabhq_production`.* TO 'git'@'localhost'; - -# Delete the old gitlab user -mysql> DELETE FROM mysql.user WHERE user='gitlab'; - -# Quit the database session -mysql> \q - -# Try connecting to the new database with the new user -sudo -u git -H mysql -u git -p -D gitlabhq_production - -# Type the password you replaced $password with earlier - -# You should now see a 'mysql>' prompt - -# Quit the database session -mysql> \q - -# Update database configuration details -# See config/database.yml.mysql for latest recommended configuration details -# Remove the reaping_frequency setting line if it exists (removed in GitLab 6.8) -# Set production -> pool: 10 (updated in GitLab 5.3) -# Set production -> username: git -# Set production -> password: the password your replaced $password with earlier -sudo -u git -H editor /home/git/gitlab/config/database.yml -``` - -## Things went south? Revert to previous version (7.0) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 6.9 to 7.0](6.9-to-7.0.md), except for the database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -## Login issues after upgrade? - -If running in HTTPS mode, be sure to read [Can't Verify CSRF token authenticity](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide#cant-verify-csrf-token-authenticitycant-get-past-login-pageredirected-to-login-page) +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.0-to-7.1.md b/doc/update/7.0-to-7.1.md index 8b69431dee1..8514aa13f48 100644 --- a/doc/update/7.0-to-7.1.md +++ b/doc/update/7.0-to-7.1.md @@ -1,144 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.0 to 7.1 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/7.0-to-7.1.md) for the most up to date instructions.* - -### 0. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Update Ruby - -If you are still using Ruby 1.9.3 or below, you will need to update Ruby. -You can check which version you are running with `ruby -v`. - -If you are you running Ruby 2.0.x, you do not need to upgrade ruby, but can consider doing so for performance reasons. - -If you are running Ruby 2.1.1 consider upgrading to 2.1.2, because of the high memory usage of Ruby 2.1.1. - -Install, update dependencies: - -```bash -sudo apt-get install build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl -``` - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --location --progress ftp://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz | tar xz -cd ruby-2.1.2 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 3. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-1-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-1-stable-ee -``` - -### 4. Update gitlab-shell (and its config) - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.9.6 -``` - -### 5. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 6. Update config files - -#### New configuration options for gitlab.yml - -There are new configuration options available for gitlab.yml. View them with the command below and apply them to your current gitlab.yml if desired. - -``` -git diff 7-0-stable:config/gitlab.yml.example 7-1-stable:config/gitlab.yml.example -``` - -### 7. Start application - - sudo service gitlab start - sudo service nginx restart - -### 8. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -## Things went south? Revert to previous version (7.0) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 6.9 to 7.0](6.9-to-7.0.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-1-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.1-to-7.2.md b/doc/update/7.1-to-7.2.md index 44e5fc676b3..8514aa13f48 100644 --- a/doc/update/7.1-to-7.2.md +++ b/doc/update/7.1-to-7.2.md @@ -1,143 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.1 to 7.2 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/7.1-to-7.2.md) for the most up to date instructions.* - -## Editable labels - -In GitLab 7.2 we replace Issue and Merge Request tags with labels, making it -possible to edit the label text and color. The characters `?`, `&` and `,` are -no longer allowed however so those will be removed from your tags during the -database migrations for GitLab 7.2. - -### 0. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-2-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-2-stable-ee -``` - -### 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v1.9.8 -``` - -### 4. Install new system dependencies - -The latest version of the 'rugged' gem requires `pkg-config` and `cmake` to -build its native extensions. - -```bash -sudo apt-get install pkg-config cmake -``` - -### 5. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 6. Update config files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for `gitlab.yml`. View them with the command below and apply them to your current `gitlab.yml`. - -``` -git diff 7-1-stable:config/gitlab.yml.example 7-2-stable:config/gitlab.yml.example -``` - -- HTTP setups: Make `/etc/nginx/sites-available/nginx` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/lib/support/nginx/gitlab> but with your settings. -- HTTPS setups: Make `/etc/nginx/sites-available/nginx-ssl` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/lib/support/nginx/gitlab-ssl> but with your setting. - -Update rack attack middleware config - -``` -sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb -``` - -### 7. Start application - - sudo service gitlab start - sudo service nginx restart - -### 8. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -### 9. Update OmniAuth configuration - -When using Google omniauth login, changes of the Google account required. -Ensure that `Contacts API` and the `Google+ API` are enabled in the [Google Developers Console](https://console.developers.google.com/). -More details can be found at the [integration documentation](../integration/google.md). - -## Things went south? Revert to previous version (7.1) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.0 to 7.1](7.0-to-7.1.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-2-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.10-to-7.11.md b/doc/update/7.10-to-7.11.md index 39eeefc0e32..8514aa13f48 100644 --- a/doc/update/7.10-to-7.11.md +++ b/doc/update/7.10-to-7.11.md @@ -1,109 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.10 to 7.11 - -### 0. Stop server - - sudo service gitlab stop - -### 1. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 2. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-11-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-11-stable-ee -``` - -### 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.6.3 -``` - -### 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 5. Update config files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them to your current `gitlab.yml`. - -``` -git diff origin/7-10-stable:config/gitlab.yml.example origin/7-11-stable:config/gitlab.yml.example -`````` - -### 6. Start application - - sudo service gitlab start - sudo service nginx restart - -### 7. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (7.10) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.9 to 7.10](7.9-to-7.10.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-11-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.11-to-7.12.md b/doc/update/7.11-to-7.12.md index 530066e5fdb..8514aa13f48 100644 --- a/doc/update/7.11-to-7.12.md +++ b/doc/update/7.11-to-7.12.md @@ -1,135 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.11 to 7.12 - -### 0. Double-check your Git version - -**This notice applies only to /usr/local/bin/git** - -If you compiled Git from source on your GitLab server then please double-check -that you are using a version that protects against CVE-2014-9390. For six -months after this vulnerability became known the GitLab installation guide -still contained instructions that would install the outdated, 'vulnerable' Git -version 2.1.2. - -Run the following command to get your current Git version. - -``` -/usr/local/bin/git --version -``` - -If you see 'No such file or directory' then you did not install Git according -to the outdated instructions from the GitLab installation guide and you can go -to the next step 'Stop server' below. - -If you see a version string then it should be v1.8.5.6, v1.9.5, v2.0.5, v2.1.4, -v2.2.1 or newer. You can use the [instructions in the GitLab source -installation -guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies) -to install a newer version of Git. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-12-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-12-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.6.3 -``` - -### 5. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 6. Update config files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them to your current `gitlab.yml`. - -``` -git diff origin/7-11-stable:config/gitlab.yml.example origin/7-12-stable:config/gitlab.yml.example -`````` - -### 7. Start application - - sudo service gitlab start - sudo service nginx restart - -### 8. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (7.11) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.10 to 7.11](7.10-to-7.11.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-12-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.12-to-7.13.md b/doc/update/7.12-to-7.13.md index 8f413a2079a..8514aa13f48 100644 --- a/doc/update/7.12-to-7.13.md +++ b/doc/update/7.12-to-7.13.md @@ -1,135 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.12 to 7.13 - -### 0. Double-check your Git version - -**This notice applies only to /usr/local/bin/git** - -If you compiled Git from source on your GitLab server then please double-check -that you are using a version that protects against CVE-2014-9390. For six -months after this vulnerability became known the GitLab installation guide -still contained instructions that would install the outdated, 'vulnerable' Git -version 2.1.2. - -Run the following command to get your current Git version. - -``` -/usr/local/bin/git --version -``` - -If you see 'No such file or directory' then you did not install Git according -to the outdated instructions from the GitLab installation guide and you can go -to the next step 'Stop server' below. - -If you see a version string then it should be v1.8.5.6, v1.9.5, v2.0.5, v2.1.4, -v2.2.1 or newer. You can use the [instructions in the GitLab source -installation -guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies) -to install a newer version of Git. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-13-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-13-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.6.3 -``` - -### 5. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 6. Update config files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them to your current `gitlab.yml`. - -``` -git diff origin/7-12-stable:config/gitlab.yml.example origin/7-13-stable:config/gitlab.yml.example -`````` - -### 7. Start application - - sudo service gitlab start - sudo service nginx restart - -### 8. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (7.12) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.11 to 7.12](7.11-to-7.12.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-13-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.13-to-7.14.md b/doc/update/7.13-to-7.14.md index a8980662855..8514aa13f48 100644 --- a/doc/update/7.13-to-7.14.md +++ b/doc/update/7.13-to-7.14.md @@ -1,135 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.13 to 7.14 - -### 0. Double-check your Git version - -**This notice applies only to /usr/local/bin/git** - -If you compiled Git from source on your GitLab server then please double-check -that you are using a version that protects against CVE-2014-9390. For six -months after this vulnerability became known the GitLab installation guide -still contained instructions that would install the outdated, 'vulnerable' Git -version 2.1.2. - -Run the following command to get your current Git version. - -``` -/usr/local/bin/git --version -``` - -If you see 'No such file or directory' then you did not install Git according -to the outdated instructions from the GitLab installation guide and you can go -to the next step 'Stop server' below. - -If you see a version string then it should be v1.8.5.6, v1.9.5, v2.0.5, v2.1.4, -v2.2.1 or newer. You can use the [instructions in the GitLab source -installation -guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies) -to install a newer version of Git. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-14-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-14-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.6.5 -``` - -### 5. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 6. Update config files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them to your current `gitlab.yml`. - -``` -git diff origin/7-13-stable:config/gitlab.yml.example origin/7-14-stable:config/gitlab.yml.example -`````` - -### 7. Start application - - sudo service gitlab start - sudo service nginx restart - -### 8. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (7.13) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.12 to 7.13](7.12-to-7.13.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-14-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.14-to-8.0.md b/doc/update/7.14-to-8.0.md index 513afccff50..8514aa13f48 100644 --- a/doc/update/7.14-to-8.0.md +++ b/doc/update/7.14-to-8.0.md @@ -1,235 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.14 to 8.0 - -### 0. Double-check your Git version - -**This notice applies only to /usr/local/bin/git** - -If you compiled Git from source on your GitLab server then please double-check -that you are using a version that protects against CVE-2014-9390. For six -months after this vulnerability became known the GitLab installation guide -still contained instructions that would install the outdated, 'vulnerable' Git -version 2.1.2. - -Run the following command to get your current Git version: - -```sh -/usr/local/bin/git --version -``` - -If you see 'No such file or directory' then you did not install Git according -to the outdated instructions from the GitLab installation guide and you can go -to the next step 'Stop server' below. - -If you see a version string then it should be v1.8.5.6, v1.9.5, v2.0.5, v2.1.4, -v2.2.1 or newer. You can use the [instructions in the GitLab source -installation -guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies) -to install a newer version of Git. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-0-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-0-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.6.5 -``` - -### 5. Install gitlab-git-http-server - -First we download Go 1.5 and install it into `/usr/local/go`: - -```bash -curl --remote-name --progress https://storage.googleapis.com/golang/go1.5.linux-amd64.tar.gz -echo '5817fa4b2252afdb02e11e8b9dc1d9173ef3bd5a go1.5.linux-amd64.tar.gz' | shasum -c - && \ - sudo tar -C /usr/local -xzf go1.5.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.5.linux-amd64.tar.gz -``` - -Now we download `gitlab-git-http-server` and install it in `/home/git/gitlab-git-http-server`: - -```bash -cd /home/git -sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-git-http-server.git -cd gitlab-git-http-server -sudo -u git -H git checkout 0.2.14 -sudo -u git -H make -``` - -Make sure your unicorn.rb file contains a 'listen' line for -'127.0.0.1:8080' and that this line is not commented out. - -``` -cd /home/git/gitlab -grep ^listen config/unicorn.rb - -# If there is no 'listen' line for 127.0.0.1:8080, add it: -sudo -u git tee -a config/unicorn.rb <<EOF -listen "127.0.0.1:8080", :tcp_nopush => true -EOF -``` - -If your Git repositories are in a directory other than `/home/git/repositories`, -you need to tell `gitlab-git-http-server` about it via `/etc/default/gitlab`. -See `lib/support/init.d/gitlab.default.example` for the options. - -### 6. Copy secrets - -The `secrets.yml` file is used to store keys to encrypt sessions and encrypt secure variables. -When you run migrations make sure to store it someplace safe. -Don't store it in the same place as your database backups, -otherwise your secrets are exposed if one of your backups is compromised. - -``` -cd /home/git/gitlab -sudo -u git -H cp config/secrets.yml.example config/secrets.yml -sudo -u git -H chmod 0600 config/secrets.yml -``` - -### 7. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 8. Update config files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/7-14-stable:config/gitlab.yml.example origin/8-0-stable:config/gitlab.yml.example -``` - -The new options include configuration of GitLab CI that are now being part of GitLab CE and EE. - -#### New Nginx configuration - -Because of the new `gitlab-git-http-server` you need to update your Nginx -configuration. If you skip this step 'git clone' and 'git push' over HTTP(S) -will stop working. - -View changes between the previous recommended Nginx configuration and the -current one: - -```sh -# For HTTPS configurations -git diff origin/7-14-stable:lib/support/nginx/gitlab-ssl origin/8-0-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/7-14-stable:lib/support/nginx/gitlab origin/8-0-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates](https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache). -Also note that because Apache does not support upstreams behind Unix sockets you will need to let gitlab-git-http-server listen on a TCP port. You can do this via [/etc/default/gitlab](https://gitlab.com/gitlab-org/gitlab-ce/blob/8-0-stable/lib/support/init.d/gitlab.default.example#L34). - -### 9. Migrate GitLab CI to GitLab CE/EE - -Now, GitLab CE and EE has CI integrated. However, migrations don't happen automatically and you need to do it manually. -Please follow the following guide [to migrate](../migrate_ci_to_ce/README.md) your GitLab CI instance to GitLab CE/EE. - -### 10. Use Redis v2.4.0+ - -Previous versions of GitLab allowed Redis versions >= 2.0 to be used, but -Sidekiq jobs could fail due to lack of support for the SREM command. GitLab -8.0 now checks that Redis >= 2.4.0 is used. You can check your Redis version -with the following command: - - redis-cli info | grep redis_version - -### 11. Start application - - sudo service gitlab start - sudo service nginx restart - -### 12. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (7.14) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 7.13 to 7.14](7.13-to-7.14.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -## Troubleshooting - -### "You appear to have cloned an empty repository." - -If you see this message when attempting to clone a repository hosted by GitLab, -this is likely due to an outdated Nginx or Apache configuration, or a missing or -misconfigured `gitlab-git-http-server` instance. Double-check that you correctly -completed [Step 5](#5-install-gitlab-git-http-server) to install the daemon and -[Step 8](#new-nginx-configuration) to reconfigure Nginx. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-0-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.2-to-7.3.md b/doc/update/7.2-to-7.3.md index 2625df2def8..8514aa13f48 100644 --- a/doc/update/7.2-to-7.3.md +++ b/doc/update/7.2-to-7.3.md @@ -1,151 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.2 to 7.3 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/7.2-to-7.3.md) for the most up to date instructions.* - -### 0. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Get latest code - -```bash -cd /home/git/gitlab -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-3-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-3-stable-ee -``` - -### 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.0.1 -``` - -### 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - - -### 5. Configure Redis to use sockets - - # Configure redis to use sockets - sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.orig - # Disable Redis listening on TCP by setting 'port' to 0 - sed 's/^port .*/port 0/' /etc/redis/redis.conf.orig | sudo tee /etc/redis/redis.conf - # Enable Redis socket for default Debian / Ubuntu path - echo 'unixsocket /var/run/redis/redis.sock' | sudo tee -a /etc/redis/redis.conf - # Be sure redis group can write to the socket, enable only if supported (>= redis 2.4.0). - sudo sed -i '/# unixsocketperm/ s/^# unixsocketperm.*/unixsocketperm 0775/' /etc/redis/redis.conf - # Activate the changes to redis.conf - sudo service redis-server restart - # Add git to the redis group - sudo usermod -aG redis git - - # Configure Redis connection settings - sudo -u git -H cp config/resque.yml.example config/resque.yml - # Change the Redis socket path if you are not using the default Debian / Ubuntu configuration - sudo -u git -H editor config/resque.yml - - # Configure gitlab-shell to use Redis sockets - sudo -u git -H sed -i 's|^ # socket.*| socket: /var/run/redis/redis.sock|' /home/git/gitlab-shell/config.yml - -### 6. Update config files - -#### New configuration options for gitlab.yml - -There are new configuration options available for gitlab.yml. View them with the command below and apply them to your current gitlab.yml. - -``` -git diff origin/7-2-stable:config/gitlab.yml.example origin/7-3-stable:config/gitlab.yml.example -``` - -``` -# Use the default Unicorn socket backlog value of 1024 -sudo -u git -H sed -i 's/:backlog => 64/:backlog => 1024/' config/unicorn.rb -``` - -- HTTP setups: Make `/etc/nginx/sites-available/nginx` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/7-3-stable/lib/support/nginx/gitlab> but with your settings. -- HTTPS setups: Make `/etc/nginx/sites-available/nginx-ssl` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/7-3-stable/lib/support/nginx/gitlab-ssl> but with your setting. - -### 7. Start application - - sudo service gitlab start - sudo service nginx restart - -### 8. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -### 9. Update OmniAuth configuration - -When using Google omniauth login, changes of the Google account required. -Ensure that `Contacts API` and the `Google+ API` are enabled in the [Google Developers Console](https://console.developers.google.com/). -More details can be found at the [integration documentation](../integration/google.md). - -## Things went south? Revert to previous version (7.2) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.1 to 7.2](7.1-to-7.2.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-3-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.3-to-7.4.md b/doc/update/7.3-to-7.4.md index ad7930e8728..8514aa13f48 100644 --- a/doc/update/7.3-to-7.4.md +++ b/doc/update/7.3-to-7.4.md @@ -1,200 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.3 to 7.4 -*Make sure you view this [upgrade guide from the `master` branch](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update/7.3-to-7.4.md) for the most up to date instructions.* - -### 0. Stop server - - sudo service gitlab stop - -### 1. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 2. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-4-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-4-stable-ee -``` - -### 3. Install libs, migrations, etc. - -```bash -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 4. Update config files - -#### New configuration options for gitlab.yml - -There are new configuration options available for gitlab.yml. View them with the command below and apply them to your current gitlab.yml. - -``` -git diff origin/7-3-stable:config/gitlab.yml.example origin/7-4-stable:config/gitlab.yml.example -``` - -#### Change timeout for unicorn - -``` -# set timeout to 60 -sudo -u git -H editor config/unicorn.rb -``` - -#### Change Nginx HTTPS settings - -- HTTPS setups: Make `/etc/nginx/sites-available/gitlab-ssl` the same as <https://gitlab.com/gitlab-org/gitlab-ce/blob/7-4-stable/lib/support/nginx/gitlab-ssl> but with your setting. - -#### MySQL Databases: Update database.yml config file - -- Add `collation: utf8_general_ci` to `config/database.yml` as seen in [config/database.yml.mysql][mysql]: - -``` -sudo -u git -H editor config/database.yml -``` - -### 5. Start application - - sudo service gitlab start - sudo service nginx restart - -### 6. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - - -### 7. Optional optimizations for GitLab setups with MySQL databases - -Only applies if running MySQL database created with GitLab 6.7 or earlier. If you are not experiencing any issues you may not need the following instructions however following them will bring your database in line with the latest recommended installation configuration and help avoid future issues. Be sure to follow these directions exactly. These directions should be safe for any MySQL instance but to be sure make a current MySQL database backup beforehand. - -``` -# Stop GitLab -sudo service gitlab stop - -# Secure your MySQL installation (added in GitLab 6.2) -sudo mysql_secure_installation - -# Login to MySQL -mysql -u root -p - -# do not type the 'mysql>', this is part of the prompt - -# Convert all tables to use the InnoDB storage engine (added in GitLab 6.8) -SELECT CONCAT('ALTER TABLE gitlabhq_production.', table_name, ' ENGINE=InnoDB;') AS 'Copy & run these SQL statements:' FROM information_schema.tables WHERE table_schema = 'gitlabhq_production' AND `ENGINE` <> 'InnoDB' AND `TABLE_TYPE` = 'BASE TABLE'; - -# If previous query returned results, copy & run all shown SQL statements - -# Convert all tables to correct character set -SET foreign_key_checks = 0; -SELECT CONCAT('ALTER TABLE gitlabhq_production.', table_name, ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;') AS 'Copy & run these SQL statements:' FROM information_schema.tables WHERE table_schema = 'gitlabhq_production' AND `TABLE_COLLATION` <> 'utf8_unicode_ci' AND `TABLE_TYPE` = 'BASE TABLE'; - -# If previous query returned results, copy & run all shown SQL statements - -# turn foreign key checks back on -SET foreign_key_checks = 1; - -# Find MySQL users -mysql> SELECT user FROM mysql.user WHERE user LIKE '%git%'; - -# If git user exists and gitlab user does not exist -# you are done with the database cleanup tasks -mysql> \q - -# If both users exist skip to Delete gitlab user - -# Create new user for GitLab (changed in GitLab 6.4) -# change $password in the command below to a real password you pick -mysql> CREATE USER 'git'@'localhost' IDENTIFIED BY '$password'; - -# Grant the git user necessary permissions on the database -mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES ON `gitlabhq_production`.* TO 'git'@'localhost'; - -# Delete the old gitlab user -mysql> DELETE FROM mysql.user WHERE user='gitlab'; - -# Quit the database session -mysql> \q - -# Try connecting to the new database with the new user -sudo -u git -H mysql -u git -p -D gitlabhq_production - -# Type the password you replaced $password with earlier - -# You should now see a 'mysql>' prompt - -# Quit the database session -mysql> \q - -# Update database configuration details -# See config/database.yml.mysql for latest recommended configuration details -# Remove the reaping_frequency setting line if it exists (removed in GitLab 6.8) -# Set production -> pool: 10 (updated in GitLab 5.3) -# Set production -> username: git -# Set production -> password: the password your replaced $password with earlier -sudo -u git -H editor /home/git/gitlab/config/database.yml - -# Start GitLab -sudo service gitlab start -sudo service nginx restart - -# Run thorough check -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - - -## Things went south? Revert to previous version (7.3) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.2 to 7.3](7.2-to-7.3.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-4-stable/config/gitlab.yml.example -[mysql]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-4-stable/config/database.yml.mysql +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.4-to-7.5.md b/doc/update/7.4-to-7.5.md index d93d32d1b60..8514aa13f48 100644 --- a/doc/update/7.4-to-7.5.md +++ b/doc/update/7.4-to-7.5.md @@ -1,116 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.4 to 7.5 - -### 0. Stop server - - sudo service gitlab stop - -### 1. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 2. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-5-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-5-stable-ee -``` - -### 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.2.0 -``` - -### 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 5. Update config files - -#### New configuration options for gitlab.yml - -There are new configuration options available for gitlab.yml. View them with the command below and apply them to your current gitlab.yml. - -``` -git diff origin/7-4-stable:config/gitlab.yml.example origin/7-5-stable:config/gitlab.yml.example -``` - -#### Change Nginx settings - -- HTTP setups: Make `/etc/nginx/sites-available/gitlab` the same as [`lib/support/nginx/gitlab`][nginx] but with your settings. -- HTTPS setups: Make `/etc/nginx/sites-available/gitlab-ssl` the same as [`lib/support/nginx/gitlab-ssl`][nginx-ssl] but with your setting. - -### 6. Start application - - sudo service gitlab start - sudo service nginx restart - -### 7. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -## Things went south? Revert to previous version (7.4) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.3 to 7.4](7.3-to-7.4.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-5-stable/config/gitlab.yml.example -[nginx]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-5-stable/lib/support/nginx/gitlab -[nginx-ssl]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-5-stable/lib/support/nginx/gitlab-ssl +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.5-to-7.6.md b/doc/update/7.5-to-7.6.md index 0e87918c8c0..8514aa13f48 100644 --- a/doc/update/7.5-to-7.6.md +++ b/doc/update/7.5-to-7.6.md @@ -1,123 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.5 to 7.6 - -### 0. Stop server - - sudo service gitlab stop - -### 1. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 2. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-6-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-6-stable-ee -``` - -### 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.4.0 -``` - -### 4. Install libs, migrations, etc. - -```bash -sudo apt-get install libkrb5-dev - -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 5. Update config files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them to your current `gitlab.yml`. - -``` -git diff origin/7-5-stable:config/gitlab.yml.example origin/7-6-stable:config/gitlab.yml.example -``` - -#### Change Nginx settings - -- HTTP setups: Make `/etc/nginx/sites-available/gitlab` the same as [`lib/support/nginx/gitlab`][nginx] but with your settings. -- HTTPS setups: Make `/etc/nginx/sites-available/gitlab-ssl` the same as [`lib/support/nginx/gitlab-ssl`][nginx-ssl] but with your setting. - -#### Set up time zone (optional) - -Consider setting the time zone in `gitlab.yml` otherwise GitLab will default to UTC. If you set a time zone previously in [`application.rb`][app] (unlikely), unset it. - -### 6. Start application - - sudo service gitlab start - sudo service nginx restart - -### 7. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -## Things went south? Revert to previous version (7.5) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.4 to 7.5](7.4-to-7.5.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-6-stable/config/gitlab.yml.example -[app]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-6-stable/config/application.rb -[nginx]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-6-stable/lib/support/nginx/gitlab -[nginx-ssl]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-6-stable/lib/support/nginx/gitlab-ssl +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.6-to-7.7.md b/doc/update/7.6-to-7.7.md index c24b5647f21..8514aa13f48 100644 --- a/doc/update/7.6-to-7.7.md +++ b/doc/update/7.6-to-7.7.md @@ -1,128 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.6 to 7.7 - -### 0. Stop server - - sudo service gitlab stop - -### 1. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 2. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-7-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-7-stable-ee -``` - -### 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.4.2 -``` - -### 4. Install libs, migrations, etc. - -```bash -sudo apt-get install libkrb5-dev - -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 5. Update config files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them to your current `gitlab.yml`. - -``` -git diff origin/7-6-stable:config/gitlab.yml.example origin/7-7-stable:config/gitlab.yml.example -``` - -#### Change Nginx settings - -- HTTP setups: Make `/etc/nginx/sites-available/gitlab` the same as [`lib/support/nginx/gitlab`][nginx] but with your settings. -- HTTPS setups: Make `/etc/nginx/sites-available/gitlab-ssl` the same as [`lib/support/nginx/gitlab-ssl`][nginx-ssl] but with your setting. - -#### Set up time zone (optional) - -Consider setting the time zone in `gitlab.yml` otherwise GitLab will default to UTC. If you set a time zone previously in [`application.rb`][app] (unlikely), unset it. - -### 6. Start application - - sudo service gitlab start - sudo service nginx restart - -### 7. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -### 8. GitHub settings (if applicable) - -If you are using GitHub as an OAuth provider for authentication, you should change the callback URL so that it -only contains a root URL (ex. `https://gitlab.example.com/`) - -## Things went south? Revert to previous version (7.6) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.5 to 7.6](7.5-to-7.6.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-7-stable/config/gitlab.yml.example -[app]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-7-stable/config/application.rb -[nginx]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-7-stable/lib/support/nginx/gitlab -[nginx-ssl]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-7-stable/lib/support/nginx/gitlab-ssl +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.7-to-7.8.md b/doc/update/7.7-to-7.8.md index 61bd5fb1298..8514aa13f48 100644 --- a/doc/update/7.7-to-7.8.md +++ b/doc/update/7.7-to-7.8.md @@ -1,129 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.7 to 7.8 - -### 0. Stop server - - sudo service gitlab stop - -### 1. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 2. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-8-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-8-stable-ee -``` - -### 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.5.4 -``` - -### 4. Install libs, migrations, etc. - -```bash -sudo apt-get install libkrb5-dev - -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 5. Update config files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them to your current `gitlab.yml`. - -``` -git diff origin/7-7-stable:config/gitlab.yml.example origin/7-8-stable:config/gitlab.yml.example -``` - -#### Change Nginx settings - -- HTTP setups: Make `/etc/nginx/sites-available/gitlab` the same as [`lib/support/nginx/gitlab`][nginx] but with your settings. -- HTTPS setups: Make `/etc/nginx/sites-available/gitlab-ssl` the same as [`lib/support/nginx/gitlab-ssl`][nginx-ssl] but with your settings. -- A new `location /uploads/` section has been added that needs to have the same content as the existing `location @gitlab` section. - -#### Set up time zone (optional) - -Consider setting the time zone in `gitlab.yml` otherwise GitLab will default to UTC. If you set a time zone previously in [`application.rb`][app] (unlikely), unset it. - -### 6. Start application - - sudo service gitlab start - sudo service nginx restart - -### 7. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -### 8. GitHub settings (if applicable) - -If you are using GitHub as an OAuth provider for authentication, you should change the callback URL so that it -only contains a root URL (ex. `https://gitlab.example.com/`) - -## Things went south? Revert to previous version (7.7) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.6 to 7.7](7.6-to-7.7.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-8-stable/config/gitlab.yml.example -[app]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-8-stable/config/application.rb -[nginx]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-8-stable/lib/support/nginx/gitlab -[nginx-ssl]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-8-stable/lib/support/nginx/gitlab-ssl +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.8-to-7.9.md b/doc/update/7.8-to-7.9.md index c13dd5b60e6..8514aa13f48 100644 --- a/doc/update/7.8-to-7.9.md +++ b/doc/update/7.8-to-7.9.md @@ -1,131 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.8 to 7.9 - -### 0. Stop server - - sudo service gitlab stop - -### 1. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 2. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-9-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-9-stable-ee -``` - -### 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.6.0 -``` - -### 4. Install libs, migrations, etc. - -Please refer to the [Node.js setup documentation](https://github.com/joyent/node/wiki/installing-node.js-via-package-manager#debian-and-ubuntu-based-linux-distributions) if you aren't running default GitLab server setup. - -```bash -sudo apt-get install nodejs - -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 5. Update config files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them to your current `gitlab.yml`. - -``` -git diff origin/7-8-stable:config/gitlab.yml.example origin/7-9-stable:config/gitlab.yml.example -``` - -#### Change Nginx settings - -- HTTP setups: Make `/etc/nginx/sites-available/gitlab` the same as [`lib/support/nginx/gitlab`][nginx] but with your settings. -- HTTPS setups: Make `/etc/nginx/sites-available/gitlab-ssl` the same as [`lib/support/nginx/gitlab-ssl`][nginx-ssl] but with your settings. -- A new `location /uploads/` section has been added that needs to have the same content as the existing `location @gitlab` section. - -#### Set up time zone (optional) - -Consider setting the time zone in `gitlab.yml` otherwise GitLab will default to UTC. If you set a time zone previously in [`application.rb`][app] (unlikely), unset it. - -### 6. Start application - - sudo service gitlab start - sudo service nginx restart - -### 7. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -### 8. GitHub settings (if applicable) - -If you are using GitHub as an OAuth provider for authentication, you should change the callback URL so that it -only contains a root URL (ex. `https://gitlab.example.com/`) - -## Things went south? Revert to previous version (7.8) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.7 to 7.8](7.7-to-7.8.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-9-stable/config/gitlab.yml.example -[app]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-9-stable/config/application.rb -[nginx]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-9-stable/lib/support/nginx/gitlab -[nginx-ssl]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-9-stable/lib/support/nginx/gitlab-ssl +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/7.9-to-7.10.md b/doc/update/7.9-to-7.10.md index 4dece93652e..8514aa13f48 100644 --- a/doc/update/7.9-to-7.10.md +++ b/doc/update/7.9-to-7.10.md @@ -1,127 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 7.9 to 7.10 - -### 0. Stop server - - sudo service gitlab stop - -### 1. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 2. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 7-10-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 7-10-stable-ee -``` - -### 3. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.6.2 -``` - -### 4. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without ... postgres') -sudo -u git -H bundle install --without development test postgres --deployment - -# PostgreSQL installations (note: the line below states '--without ... mysql') -sudo -u git -H bundle install --without development test mysql --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -### 5. Update config files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them to your current `gitlab.yml`. - -``` -git diff origin/7-9-stable:config/gitlab.yml.example origin/7-10-stable:config/gitlab.yml.example -``` - -#### Change Nginx settings - -- HTTP setups: Make `/etc/nginx/sites-available/gitlab` the same as [`lib/support/nginx/gitlab`][nginx] but with your settings. -- HTTPS setups: Make `/etc/nginx/sites-available/gitlab-ssl` the same as [`lib/support/nginx/gitlab-ssl`][nginx-ssl] but with your settings. -- A new `location /uploads/` section has been added that needs to have the same content as the existing `location @gitlab` section. - -#### Set up time zone (optional) - -Consider setting the time zone in `gitlab.yml` otherwise GitLab will default to UTC. If you set a time zone previously in [`application.rb`][app] (unlikely), unset it. - -### 6. Start application - - sudo service gitlab start - sudo service nginx restart - -### 7. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check with: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations upgrade is complete! - -### 8. GitHub settings (if applicable) - -If you are using GitHub as an OAuth provider for authentication, you should change the callback URL so that it -only contains a root URL (ex. `https://gitlab.example.com/`) - -## Things went south? Revert to previous version (7.9) - -### 1. Revert the code to the previous version -Follow the [upgrade guide from 7.8 to 7.9](7.8-to-7.9.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup: - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` -If you have more than one backup *.tar file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-10-stable/config/gitlab.yml.example -[app]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-10-stable/config/application.rb -[nginx]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-10-stable/lib/support/nginx/gitlab -[nginx-ssl]: https://gitlab.com/gitlab-org/gitlab-ce/blob/7-10-stable/lib/support/nginx/gitlab-ssl +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.0-to-8.1.md b/doc/update/8.0-to-8.1.md index f612606af68..8514aa13f48 100644 --- a/doc/update/8.0-to-8.1.md +++ b/doc/update/8.0-to-8.1.md @@ -1,181 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.0 to 8.1 - -**NOTE:** GitLab 8.0 introduced several significant changes related to -installation and configuration which *are not duplicated here*. Be sure you're -already running a working version of 8.0 before proceeding with this guide. - -### 0. Double-check your Git version - -**This notice applies only to /usr/local/bin/git** - -If you compiled Git from source on your GitLab server then please double-check -that you are using a version that protects against CVE-2014-9390. For six -months after this vulnerability became known the GitLab installation guide -still contained instructions that would install the outdated, 'vulnerable' Git -version 2.1.2. - -Run the following command to get your current Git version: - -```sh -/usr/local/bin/git --version -``` - -If you see 'No such file or directory' then you did not install Git according -to the outdated instructions from the GitLab installation guide and you can go -to the next step 'Stop server' below. - -If you see a version string then it should be v1.8.5.6, v1.9.5, v2.0.5, v2.1.4, -v2.2.1 or newer. You can use the [instructions in the GitLab source -installation -guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies) -to install a newer version of Git. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-1-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-1-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.6.5 -``` - -### 5. Update gitlab-git-http-server - -```bash -cd /home/git/gitlab-git-http-server -sudo -u git -H git fetch origin -sudo -u git -H git checkout 0.3.0 -sudo -u git -H make -``` - -### 6. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 7. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-0-stable:config/gitlab.yml.example origin/8-1-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -View changes between the previous recommended Nginx configuration and the -current one: - -```sh -# For HTTPS configurations -git diff origin/8-0-stable:lib/support/nginx/gitlab-ssl origin/8-1-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-0-stable:lib/support/nginx/gitlab origin/8-1-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-git-http-server listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-1-stable/lib/support/init.d/gitlab.default.example#L34 - -### 8. Start application - - sudo service gitlab start - sudo service nginx restart - -### 9. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.0) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 7.14 to 8.0](7.14-to-8.0.md), except for the database migration -(The backup is already migrated to the previous version) - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -## Troubleshooting - -### "You appear to have cloned an empty repository." - -See the [7.14 to 8.0 update guide](7.14-to-8.0.md#troubleshooting). - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-1-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.1-to-8.2.md b/doc/update/8.1-to-8.2.md index 2d0b19abd74..8514aa13f48 100644 --- a/doc/update/8.1-to-8.2.md +++ b/doc/update/8.1-to-8.2.md @@ -1,198 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.1 to 8.2 - -**NOTE:** GitLab 8.0 introduced several significant changes related to -installation and configuration which *are not duplicated here*. Be sure you're -already running a working version of at least 8.0 before proceeding with this -guide. - -### 0. Double-check your Git version - -**This notice applies only to /usr/local/bin/git** - -If you compiled Git from source on your GitLab server then please double-check -that you are using a version that protects against CVE-2014-9390. For six -months after this vulnerability became known the GitLab installation guide -still contained instructions that would install the outdated, 'vulnerable' Git -version 2.1.2. - -Run the following command to get your current Git version: - -```sh -/usr/local/bin/git --version -``` - -If you see 'No such file or directory' then you did not install Git according -to the outdated instructions from the GitLab installation guide and you can go -to the next step 'Stop server' below. - -If you see a version string then it should be v1.8.5.6, v1.9.5, v2.0.5, v2.1.4, -v2.2.1 or newer. You can use the [instructions in the GitLab source -installation -guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies) -to install a newer version of Git. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-2-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-2-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch -sudo -u git -H git checkout v2.6.8 -``` - -### 5. Replace gitlab-git-http-server with gitlab-workhorse - -Install and compile gitlab-workhorse. This requires [Go -1.5](https://golang.org/dl) which should already be on your system -from GitLab 8.1. - -```bash -cd /home/git -sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-workhorse.git -cd gitlab-workhorse -sudo -u git -H git checkout 0.4.2 -sudo -u git -H make -``` - -Update the GitLab 'default' file. - -``` -cd /home/git/gitlab -test -e /etc/default/gitlab && \ - sudo sed -i.pre-8.2 's/^\([^=]*\)gitlab_git_http_server/\1gitlab_workhorse/' /etc/default/gitlab -``` - -Make sure that you also update your **NGINX configuration** to use -the new gitlab-workhorse.socket file. - -### 6. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -# Update init.d script -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 7. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-1-stable:config/gitlab.yml.example origin/8-2-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -View changes between the previous recommended Nginx configuration and the -current one: - -```sh -# For HTTPS configurations -git diff origin/8-1-stable:lib/support/nginx/gitlab-ssl origin/8-2-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-1-stable:lib/support/nginx/gitlab origin/8-2-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-2-stable/lib/support/init.d/gitlab.default.example#L34 - -### 8. Start application - - sudo service gitlab start - sudo service nginx restart - -### 9. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.1) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.0 to 8.1](8.0-to-8.1.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -## Troubleshooting - -### "You appear to have cloned an empty repository." - -See the [7.14 to 8.0 update guide](7.14-to-8.0.md#troubleshooting). - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-2-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.10-to-8.11.md b/doc/update/8.10-to-8.11.md index f8415b5159b..8514aa13f48 100644 --- a/doc/update/8.10-to-8.11.md +++ b/doc/update/8.10-to-8.11.md @@ -1,205 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.10 to 8.11 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -We will continue supporting Ruby < 2.3 for the time being but we recommend you -upgrade to Ruby 2.3 if you're running a source installation, as this is the same -version that ships with our Omnibus package. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.gz -echo 'c39b4001f7acb4e334cb60a0f4df72d434bef711 ruby-2.3.1.tar.gz' | shasum --check - && tar xzf ruby-2.3.1.tar.gz -cd ruby-2.3.1 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-11-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-11-stable-ee -``` - -### 5. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v3.4.0 -``` - -### 6. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch --all -sudo -u git -H git checkout v0.7.11 -sudo -u git -H make -``` - -### 7. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -``` - -### 8. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-10-stable:config/gitlab.yml.example origin/8-11-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -# For HTTPS configurations -git diff origin/8-10-stable:lib/support/nginx/gitlab-ssl origin/8-11-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-10-stable:lib/support/nginx/gitlab origin/8-11-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-11-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-11-stable/config/initializers/smtp_settings.rb.sample#L13? - -#### Init script - -Ensure you're still up-to-date with the latest init script changes: - - sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 9. Start application - - sudo service gitlab start - sudo service nginx restart - -### 10. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.10) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.9 to 8.10](8.9-to-8.10.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-11-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.11-to-8.12.md b/doc/update/8.11-to-8.12.md index 07ac8129b4f..8514aa13f48 100644 --- a/doc/update/8.11-to-8.12.md +++ b/doc/update/8.11-to-8.12.md @@ -1,213 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.11 to 8.12 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -We will continue supporting Ruby < 2.3 for the time being but we recommend you -upgrade to Ruby 2.3 if you're running a source installation, as this is the same -version that ships with our Omnibus package. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.gz -echo 'c39b4001f7acb4e334cb60a0f4df72d434bef711 ruby-2.3.1.tar.gz' | shasum --check - && tar xzf ruby-2.3.1.tar.gz -cd ruby-2.3.1 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-12-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-12-stable-ee -``` - -### 5. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v3.6.1 -``` - -### 6. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch --all -sudo -u git -H git checkout v0.8.2 -sudo -u git -H make -``` - -### 7. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production -``` - -### 8. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-11-stable:config/gitlab.yml.example origin/8-12-stable:config/gitlab.yml.example -``` - -#### Git configuration - -Configure Git to generate packfile bitmaps (introduced in Git 2.0) on -the GitLab server during `git gc`. - -```sh -sudo -u git -H git config --global repack.writeBitmaps true -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -# For HTTPS configurations -git diff origin/8-11-stable:lib/support/nginx/gitlab-ssl origin/8-12-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-11-stable:lib/support/nginx/gitlab origin/8-12-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-12-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-12-stable/config/initializers/smtp_settings.rb.sample#L13? - -#### Init script - -Ensure you're still up-to-date with the latest init script changes: - - sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 9. Start application - - sudo service gitlab start - sudo service nginx restart - -### 10. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.11) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.10 to 8.11](8.10-to-8.11.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-12-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.12-to-8.13.md b/doc/update/8.12-to-8.13.md index bf622deaba8..8514aa13f48 100644 --- a/doc/update/8.12-to-8.13.md +++ b/doc/update/8.12-to-8.13.md @@ -1,213 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.12 to 8.13 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -We will continue supporting Ruby < 2.3 for the time being but we recommend you -upgrade to Ruby 2.3 if you're running a source installation, as this is the same -version that ships with our Omnibus package. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.gz -echo 'c39b4001f7acb4e334cb60a0f4df72d434bef711 ruby-2.3.1.tar.gz' | shasum --check - && tar xzf ruby-2.3.1.tar.gz -cd ruby-2.3.1 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-13-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-13-stable-ee -``` - -### 5. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v3.6.7 -``` - -### 6. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch --all -sudo -u git -H git checkout v0.8.5 -sudo -u git -H make -``` - -### 7. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production -``` - -### 8. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-12-stable:config/gitlab.yml.example origin/8-13-stable:config/gitlab.yml.example -``` - -#### Git configuration - -Configure Git to generate packfile bitmaps (introduced in Git 2.0) on -the GitLab server during `git gc`. - -```sh -sudo -u git -H git config --global repack.writeBitmaps true -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -# For HTTPS configurations -git diff origin/8-12-stable:lib/support/nginx/gitlab-ssl origin/8-13-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-12-stable:lib/support/nginx/gitlab origin/8-13-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-13-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-13-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -Ensure you're still up-to-date with the latest init script changes: - - sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 9. Start application - - sudo service gitlab start - sudo service nginx restart - -### 10. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.12) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.11 to 8.12](8.11-to-8.12.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-13-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.13-to-8.14.md b/doc/update/8.13-to-8.14.md index 43b636ea958..8514aa13f48 100644 --- a/doc/update/8.13-to-8.14.md +++ b/doc/update/8.13-to-8.14.md @@ -1,213 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.13 to 8.14 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -We will continue supporting Ruby < 2.3 for the time being but we recommend you -upgrade to Ruby 2.3 if you're running a source installation, as this is the same -version that ships with our Omnibus package. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.gz -echo 'c39b4001f7acb4e334cb60a0f4df72d434bef711 ruby-2.3.1.tar.gz' | shasum --check - && tar xzf ruby-2.3.1.tar.gz -cd ruby-2.3.1 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-14-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-14-stable-ee -``` - -### 5. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v4.1.1 -``` - -### 6. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch --all -sudo -u git -H git checkout v1.0.1 -sudo -u git -H make -``` - -### 7. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production -``` - -### 8. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-13-stable:config/gitlab.yml.example origin/8-14-stable:config/gitlab.yml.example -``` - -#### Git configuration - -Configure Git to generate packfile bitmaps (introduced in Git 2.0) on -the GitLab server during `git gc`. - -```sh -sudo -u git -H git config --global repack.writeBitmaps true -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -# For HTTPS configurations -git diff origin/8-13-stable:lib/support/nginx/gitlab-ssl origin/8-14-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-13-stable:lib/support/nginx/gitlab origin/8-14-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-14-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-14-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -Ensure you're still up-to-date with the latest init script changes: - - sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 9. Start application - - sudo service gitlab start - sudo service nginx restart - -### 10. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.13) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.12 to 8.13](8.12-to-8.13.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-14-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.14-to-8.15.md b/doc/update/8.14-to-8.15.md index eadf1743597..8514aa13f48 100644 --- a/doc/update/8.14-to-8.15.md +++ b/doc/update/8.14-to-8.15.md @@ -1,243 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.14 to 8.15 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -We will continue supporting Ruby < 2.3 for the time being but we recommend you -upgrade to Ruby 2.3 if you're running a source installation, as this is the same -version that ships with our Omnibus package. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.gz -echo 'c39b4001f7acb4e334cb60a0f4df72d434bef711 ruby-2.3.1.tar.gz' | shasum --check - && tar xzf ruby-2.3.1.tar.gz -cd ruby-2.3.1 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 8-15-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 8-15-stable-ee -``` - -### 5. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production -``` - -### 6. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]" RAILS_ENV=production -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v4.1.1 -``` - -### 8. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/8-14-stable:config/gitlab.yml.example origin/8-15-stable:config/gitlab.yml.example -``` - -#### Git configuration - -Configure Git to generate packfile bitmaps (introduced in Git 2.0) on -the GitLab server during `git gc`. - -```sh -cd /home/git/gitlab - -sudo -u git -H git config --global repack.writeBitmaps true -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/8-14-stable:lib/support/nginx/gitlab-ssl origin/8-15-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-14-stable:lib/support/nginx/gitlab origin/8-15-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-15-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-15-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 9. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 10. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.14) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.13 to 8.14](8.13-to-8.14.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-15-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.15-to-8.16.md b/doc/update/8.15-to-8.16.md index 4e8d54d5010..8514aa13f48 100644 --- a/doc/update/8.15-to-8.16.md +++ b/doc/update/8.15-to-8.16.md @@ -1,245 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.15 to 8.16 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -We will continue supporting Ruby < 2.3 for the time being but we recommend you -upgrade to Ruby 2.3 if you're running a source installation, as this is the same -version that ships with our Omnibus package. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz -echo '1014ee699071aa2ddd501907d18cbe15399c997d ruby-2.3.3.tar.gz' | shasum -c - && tar xzf ruby-2.3.3.tar.gz -cd ruby-2.3.3 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 8-16-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 8-16-stable-ee -``` - -### 5. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 6. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]" RAILS_ENV=production -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v4.1.1 -``` - -### 8. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/8-15-stable:config/gitlab.yml.example origin/8-16-stable:config/gitlab.yml.example -``` - -#### Git configuration - -Configure Git to generate packfile bitmaps (introduced in Git 2.0) on -the GitLab server during `git gc`. - -```sh -cd /home/git/gitlab - -sudo -u git -H git config --global repack.writeBitmaps true -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/8-15-stable:lib/support/nginx/gitlab-ssl origin/8-16-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-15-stable:lib/support/nginx/gitlab origin/8-16-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 9. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 10. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.15) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.14 to 8.15](8.14-to-8.15.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-16-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.16-to-8.17.md b/doc/update/8.16-to-8.17.md index cab28a4d1c6..8514aa13f48 100644 --- a/doc/update/8.16-to-8.17.md +++ b/doc/update/8.16-to-8.17.md @@ -1,272 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.16 to 8.17 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -We will continue supporting Ruby < 2.3 for the time being but we recommend you -upgrade to Ruby 2.3 if you're running a source installation, as this is the same -version that ships with our Omnibus package. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz -echo '1014ee699071aa2ddd501907d18cbe15399c997d ruby-2.3.3.tar.gz' | shasum -c - && tar xzf ruby-2.3.3.tar.gz -cd ruby-2.3.3 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets and -it has a minimum requirement of node v4.3.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v4.3.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - -### 5. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 8-17-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 8-17-stable-ee -``` - -### 6. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Install/update frontend asset dependencies -sudo -u git -H npm install --production - -# Clean up assets and cache -sudo -u git -H bundle exec rake gitlab:assets:clean gitlab:assets:compile cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 7. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake "gitlab:workhorse:install[/home/git/gitlab-workhorse]" RAILS_ENV=production -``` - -### 8. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v4.1.1 -``` - -### 9. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/8-16-stable:config/gitlab.yml.example origin/8-17-stable:config/gitlab.yml.example -``` - -#### Git configuration - -Configure Git to generate packfile bitmaps (introduced in Git 2.0) on -the GitLab server during `git gc`. - -```sh -cd /home/git/gitlab - -sudo -u git -H git config --global repack.writeBitmaps true -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/8-16-stable:lib/support/nginx/gitlab-ssl origin/8-17-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-16-stable:lib/support/nginx/gitlab origin/8-17-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-17-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-17-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. -You need to update this file if you want to [enable GitLab Pages][pages-admin]. -View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/8-16-stable:lib/support/init.d/gitlab.default.example origin/8-17-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 10. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 11. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.16) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.15 to 8.16](8.15-to-8.16.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-17-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-17-stable/lib/support/init.d/gitlab.default.example -[pages-admin]: ../administration/pages/source.md +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.17-to-9.0.md b/doc/update/8.17-to-9.0.md index 55cf0842df4..8514aa13f48 100644 --- a/doc/update/8.17-to-9.0.md +++ b/doc/update/8.17-to-9.0.md @@ -1,358 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.17 to 9.0 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 only supports Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz -echo '1014ee699071aa2ddd501907d18cbe15399c997d ruby-2.3.3.tar.gz' | shasum -c - && tar xzf ruby-2.3.3.tar.gz -cd ruby-2.3.3 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets and -it has a minimum requirement of node v4.3.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v4.3.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - - -Since 8.17, GitLab requires the use of yarn `>= v0.17.0` to manage -JavaScript dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 9-0-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 9-0-stable-ee -``` - -### 6. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -``` - -### 7. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. GitLab-Workhorse uses [GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 8. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/8-17-stable:config/gitlab.yml.example origin/9-0-stable:config/gitlab.yml.example -``` - -#### Configuration changes for repository storages - -This version introduces a new configuration structure for repository storages. -Update your current configuration as follows, replacing with your storages names and paths: - -**For installations from source** - -1. Update your `gitlab.yml`, from - - ```yaml - repositories: - storages: # You must have at least a 'default' storage path. - default: /home/git/repositories - nfs: /mnt/nfs/repositories - cephfs: /mnt/cephfs/repositories - ``` - - to - - ```yaml - repositories: - storages: # You must have at least a 'default' storage path. - default: - path: /home/git/repositories - nfs: - path: /mnt/nfs/repositories - cephfs: - path: /mnt/cephfs/repositories - ``` - -**For Omnibus installations** - -1. Update your `/etc/gitlab/gitlab.rb`, from - - ```ruby - git_data_dirs({ - "default" => "/var/opt/gitlab/git-data", - "nfs" => "/mnt/nfs/git-data", - "cephfs" => "/mnt/cephfs/git-data" - }) - ``` - - to - - ```ruby - git_data_dirs({ - "default" => { "path" => "/var/opt/gitlab/git-data" }, - "nfs" => { "path" => "/mnt/nfs/git-data" }, - "cephfs" => { "path" => "/mnt/cephfs/git-data" } - }) - ``` - -#### Git configuration - -Configure Git to generate packfile bitmaps (introduced in Git 2.0) on -the GitLab server during `git gc`. - -```sh -cd /home/git/gitlab - -sudo -u git -H git config --global repack.writeBitmaps true -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/8-17-stable:lib/support/nginx/gitlab-ssl origin/9-0-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-17-stable:lib/support/nginx/gitlab origin/9-0-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-0-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-0-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/8-17-stable:lib/support/init.d/gitlab.default.example origin/9-0-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 9. Install libs, migrations, etc. - -GitLab 9.0.11 [introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/24570) -a dependency on the `re2` regular expression library. To install this dependency: - -```bash -sudo apt-get install libre2-dev -``` - -Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but -you can [install re2 manually](https://github.com/google/re2/wiki/Install). - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 10. Optional: install Gitaly - -Gitaly is still an optional component of GitLab. If you want to save time -during your 9.0 upgrade **you can skip this step**. - -If you do want to set up Gitaly in GitLab 9.0 then follow [Gitaly section of the installation -guide](../install/installation.md#install-gitaly). - -### 11. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 12. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.17) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.16 to 8.17](8.16-to-8.17.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-0-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-0-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.2-to-8.3.md b/doc/update/8.2-to-8.3.md index 3a0d647cbfe..8514aa13f48 100644 --- a/doc/update/8.2-to-8.3.md +++ b/doc/update/8.2-to-8.3.md @@ -1,227 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.2 to 8.3 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -**NOTE:** GitLab 8.0 introduced several significant changes related to -installation and configuration which *are not duplicated here*. Be sure you're -already running a working version of at least 8.0 before proceeding with this -guide. - -### 0. Double-check your Git version - -**This notice applies only to /usr/local/bin/git** - -If you compiled Git from source on your GitLab server then please double-check -that you are using a version that protects against CVE-2014-9390. For six -months after this vulnerability became known the GitLab installation guide -still contained instructions that would install the outdated, 'vulnerable' Git -version 2.1.2. - -Run the following command to get your current Git version: - -```sh -/usr/local/bin/git --version -``` - -If you see 'No such file or directory' then you did not install Git according -to the outdated instructions from the GitLab installation guide and you can go -to the next step 'Stop server' below. - -If you see a version string then it should be v1.8.5.6, v1.9.5, v2.0.5, v2.1.4, -v2.2.1 or newer. You can use the [instructions in the GitLab source installation -guide](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md#1-packages-dependencies) -to install a newer version of Git. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-3-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-3-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch --all -sudo -u git -H git checkout v2.6.9 -``` - -### 5. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires [Go 1.5](https://golang.org/dl) -which should already be on your system from GitLab 8.1. - -```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch --all -sudo -u git -H git checkout 0.5.4 -sudo -u git -H make -``` - -### 6. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -``` - -### 7. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-2-stable:config/gitlab.yml.example origin/8-3-stable:config/gitlab.yml.example -``` - -#### GitLab default file - -The value of the `gitlab_workhorse_options` variable should be updated within the default gitlab file (`/etc/default/gitlab`) according to the following diff: - -```sh -git diff origin/8-2-stable:lib/support/init.d/gitlab.default.example origin/8-3-stable:lib/support/init.d/gitlab.default.example -``` - -#### Nginx configuration - -GitLab 8.3 introduces major changes in the NGINX configuration. -Because all HTTP requests pass through gitlab-workhorse now a lot of -directives need to be removed from NGINX. During future upgrades there -should be much less changes in the NGINX configuration because of -this. - -View changes between the previous recommended Nginx configuration and the -current one: - -```sh -# For HTTPS configurations -git diff origin/8-2-stable:lib/support/nginx/gitlab-ssl origin/8-3-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-2-stable:lib/support/nginx/gitlab origin/8-3-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-3-stable/lib/support/init.d/gitlab.default.example#L34 - -#### Init script - -We updated the init script for GitLab in order to pass new -configuration options to gitlab-workhorse. We let gitlab-workhorse -connect to the Rails application via a Unix domain socket and we tell -it where the 'public' directory of GitLab is. - -``` -cd /home/git/gitlab -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 8. Use Redis v2.8.0+ - -Previous versions of GitLab allowed Redis versions >= 2.0 to be used, but -GitLab 8.3 uses Sidekiq 4.0, which requires Redis 2.8. You can check your Redis version -with the following command: - - redis-cli info | grep redis_version - -If you need to upgrade, see the [installation guide for Redis](https://gitlab.com/gitlab-org/gitlab-ce/blob/8-3-stable/doc/install/installation.md#6-redis). - -### 9. Start application - - sudo service gitlab start - sudo service nginx restart - -### 10. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.2) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.1 to 8.2](8.1-to-8.2.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -## Troubleshooting - -### "You appear to have cloned an empty repository." - -See the [7.14 to 8.0 update guide](7.14-to-8.0.md#troubleshooting). - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-3-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.3-to-8.4.md b/doc/update/8.3-to-8.4.md index f5162dd5ff5..8514aa13f48 100644 --- a/doc/update/8.3-to-8.4.md +++ b/doc/update/8.3-to-8.4.md @@ -1,143 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.3 to 8.4 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-4-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-4-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch --all -sudo -u git -H git checkout v2.6.10 -``` - -### 5. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires [Go 1.5](https://golang.org/dl) -which should already be on your system from GitLab 8.1. - -```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch --all -sudo -u git -H git checkout 0.6.2 -sudo -u git -H make -``` - -### 6. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -``` - -### 7. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-3-stable:config/gitlab.yml.example origin/8-4-stable:config/gitlab.yml.example -``` - -#### Init script - -We updated the init script for GitLab in order to set a specific PATH for gitlab-workhorse. - -``` -cd /home/git/gitlab -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 8. Start application - - sudo service gitlab start - sudo service nginx restart - -### 9. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.3) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.2 to 8.3](8.2-to-8.3.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-4-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.4-to-8.5.md b/doc/update/8.4-to-8.5.md index 9e2f98add8d..8514aa13f48 100644 --- a/doc/update/8.4-to-8.5.md +++ b/doc/update/8.4-to-8.5.md @@ -1,164 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.4 to 8.5 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-5-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-5-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch --all -sudo -u git -H git checkout v2.6.10 -``` - -### 5. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch --all -sudo -u git -H git checkout 0.6.4 -sudo -u git -H make -``` - -### 6. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -``` - -### 7. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-4-stable:config/gitlab.yml.example origin/8-5-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -# For HTTPS configurations -git diff origin/8-4-stable:lib/support/nginx/gitlab-ssl origin/8-5-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-4-stable:lib/support/nginx/gitlab origin/8-5-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-5-stable/lib/support/init.d/gitlab.default.example#L37 - -#### Init script - -Ensure you're still up-to-date with the latest init script changes: - - sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 8. Start application - - sudo service gitlab start - sudo service nginx restart - -### 9. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.4) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.3 to 8.4](8.3-to-8.4.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-5-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.5-to-8.6.md b/doc/update/8.5-to-8.6.md index 55d8178c407..8514aa13f48 100644 --- a/doc/update/8.5-to-8.6.md +++ b/doc/update/8.5-to-8.6.md @@ -1,183 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.5 to 8.6 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-6-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-6-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch --all -sudo -u git -H git checkout v2.6.12 -``` - -### 5. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch --all -sudo -u git -H git checkout v0.7.1 -sudo -u git -H make -``` - -### 6. Updates for PostgreSQL Users - -Starting with 8.6 users using GitLab in combination with PostgreSQL are required -to have the `pg_trgm` extension enabled for all GitLab databases. If you're -using GitLab's Omnibus packages there's nothing you'll need to do manually as -this extension is enabled automatically. Users who install GitLab without using -Omnibus (e.g. by building from source) have to enable this extension manually. -To enable this extension run the following SQL command as a PostgreSQL super -user for _every_ GitLab database: - -```sql -CREATE EXTENSION IF NOT EXISTS pg_trgm; -``` - -Certain operating systems might require the installation of extra packages for -this extension to be available. For example, users using Ubuntu will have to -install the `postgresql-contrib` package in order for this extension to be -available. - -### 7. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -``` - -### 8. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-5-stable:config/gitlab.yml.example origin/8-6-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -# For HTTPS configurations -git diff origin/8-5-stable:lib/support/nginx/gitlab-ssl origin/8-6-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-5-stable:lib/support/nginx/gitlab origin/8-6-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-6-stable/lib/support/init.d/gitlab.default.example#L37 - -#### Init script - -Ensure you're still up-to-date with the latest init script changes: - - sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 9. Start application - - sudo service gitlab start - sudo service nginx restart - -### 10. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.5) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.4 to 8.5](8.4-to-8.5.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-6-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.6-to-8.7.md b/doc/update/8.6-to-8.7.md index 49db6f2967c..8514aa13f48 100644 --- a/doc/update/8.6-to-8.7.md +++ b/doc/update/8.6-to-8.7.md @@ -1,172 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.6 to 8.7 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-7-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-7-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch --tags -sudo -u git -H git checkout v2.7.2 -``` - -### 5. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch --all -sudo -u git -H git checkout v0.7.1 -sudo -u git -H make -``` - -### 6. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -``` - -### 7. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-6-stable:config/gitlab.yml.example origin/8-7-stable:config/gitlab.yml.example -``` - -#### Git configuration - -Disable `git gc --auto` because GitLab runs `git gc` for us already. - -```sh -sudo -u git -H git config --global gc.auto 0 -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -# For HTTPS configurations -git diff origin/8-6-stable:lib/support/nginx/gitlab-ssl origin/8-7-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-6-stable:lib/support/nginx/gitlab origin/8-7-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-7-stable/lib/support/init.d/gitlab.default.example#L37 - -#### Init script - -Ensure you're still up-to-date with the latest init script changes: - - sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 8. Start application - - sudo service gitlab start - sudo service nginx restart - -### 9. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.6) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.5 to 8.6](8.5-to-8.6.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-7-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.7-to-8.8.md b/doc/update/8.7-to-8.8.md index ee7ec6f7614..8514aa13f48 100644 --- a/doc/update/8.7-to-8.8.md +++ b/doc/update/8.7-to-8.8.md @@ -1,172 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.7 to 8.8 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-8-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-8-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v2.7.2 -``` - -### 5. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch --all -sudo -u git -H git checkout v0.7.1 -sudo -u git -H make -``` - -### 6. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -``` - -### 7. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-7-stable:config/gitlab.yml.example origin/8-8-stable:config/gitlab.yml.example -``` - -#### Git configuration - -Disable `git gc --auto` because GitLab runs `git gc` for us already. - -```sh -sudo -u git -H git config --global gc.auto 0 -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -# For HTTPS configurations -git diff origin/8-7-stable:lib/support/nginx/gitlab-ssl origin/8-8-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-7-stable:lib/support/nginx/gitlab origin/8-8-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-8-stable/lib/support/init.d/gitlab.default.example#L37 - -#### Init script - -Ensure you're still up-to-date with the latest init script changes: - - sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 8. Start application - - sudo service gitlab start - sudo service nginx restart - -### 9. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.7) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.6 to 8.7](8.6-to-8.7.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-8-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.8-to-8.9.md b/doc/update/8.8-to-8.9.md index 7508443c30a..8514aa13f48 100644 --- a/doc/update/8.8-to-8.9.md +++ b/doc/update/8.8-to-8.9.md @@ -1,201 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.8 to 8.9 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-9-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-9-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v3.0.0 -``` - -### 5. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch --all -sudo -u git -H git checkout v0.7.5 -sudo -u git -H make -``` - -### 6. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -# Login to MySQL -mysql -u root -p - -# Grant the GitLab user the REFERENCES permission on the database -GRANT REFERENCES ON `gitlabhq_production`.* TO 'git'@'localhost'; - -# Quit the database session -mysql> \q -``` - -### 7. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -``` - -### 8. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-8-stable:config/gitlab.yml.example origin/8-9-stable:config/gitlab.yml.example -``` - -#### Git configuration - -Disable `git gc --auto` because GitLab runs `git gc` for us already. - -```sh -sudo -u git -H git config --global gc.auto 0 -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -# For HTTPS configurations -git diff origin/8-8-stable:lib/support/nginx/gitlab-ssl origin/8-9-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-8-stable:lib/support/nginx/gitlab origin/8-9-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-9-stable/lib/support/init.d/gitlab.default.example#L37 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/v8.9.0/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -Ensure you're still up-to-date with the latest init script changes: - - sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 9. Start application - - sudo service gitlab start - sudo service nginx restart - -### 10. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.8) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.7 to 8.8](8.7-to-8.8.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-9-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/8.9-to-8.10.md b/doc/update/8.9-to-8.10.md index 915e7db819a..8514aa13f48 100644 --- a/doc/update/8.9-to-8.10.md +++ b/doc/update/8.9-to-8.10.md @@ -1,201 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 8.9 to 8.10 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - - sudo service gitlab stop - -### 2. Backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Get latest code - -```bash -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -sudo -u git -H git checkout 8-10-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -sudo -u git -H git checkout 8-10-stable-ee -``` - -### 4. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v3.2.1 -``` - -### 5. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. - -```bash -cd /home/git/gitlab-workhorse -sudo -u git -H git fetch --all -sudo -u git -H git checkout v0.7.8 -sudo -u git -H make -``` - -### 6. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -# Login to MySQL -mysql -u root -p - -# Grant the GitLab user the REFERENCES permission on the database -GRANT REFERENCES ON `gitlabhq_production`.* TO 'git'@'localhost'; - -# Quit the database session -mysql> \q -``` - -### 7. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Clean up assets and cache -sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production - -``` - -### 8. Update configuration files - -#### New configuration options for `gitlab.yml` - -There are new configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -git diff origin/8-9-stable:config/gitlab.yml.example origin/8-10-stable:config/gitlab.yml.example -``` - -#### Git configuration - -Disable `git gc --auto` because GitLab runs `git gc` for us already. - -```sh -sudo -u git -H git config --global gc.auto 0 -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -# For HTTPS configurations -git diff origin/8-9-stable:lib/support/nginx/gitlab-ssl origin/8-10-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/8-9-stable:lib/support/nginx/gitlab origin/8-10-stable:lib/support/nginx/gitlab -``` - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-10-stable/lib/support/init.d/gitlab.default.example#L37 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/v8.9.0/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -Ensure you're still up-to-date with the latest init script changes: - - sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab - -For Ubuntu 16.04.1 LTS: - - sudo systemctl daemon-reload - -### 9. Start application - - sudo service gitlab start - sudo service nginx restart - -### 10. Check application status - -Check if GitLab and its environment are configured correctly: - - sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production - -To make sure you didn't miss anything run a more thorough check: - - sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (8.9) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.8 to 8.9](8.8-to-8.9.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/8-10-stable/config/gitlab.yml.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/9.0-to-9.1.md b/doc/update/9.0-to-9.1.md index 10214fd8aca..8514aa13f48 100644 --- a/doc/update/9.0-to-9.1.md +++ b/doc/update/9.0-to-9.1.md @@ -1,407 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 9.0 to 9.1 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz -echo '1014ee699071aa2ddd501907d18cbe15399c997d ruby-2.3.3.tar.gz' | shasum -c - && tar xzf ruby-2.3.3.tar.gz -cd ruby-2.3.3 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets and -it has a minimum requirement of node v4.3.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v4.3.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - - -Since 8.17, GitLab requires the use of yarn `>= v0.17.0` to manage -JavaScript dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 9-1-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 9-1-stable-ee -``` - -### 6. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -``` - -### 7. Update gitlab-workhorse - -Install and compile gitlab-workhorse. This requires -[Go 1.5](https://golang.org/dl) which should already be on your system from -GitLab 8.1. GitLab-Workhorse uses [GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 8. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/9-0-stable:config/gitlab.yml.example origin/9-1-stable:config/gitlab.yml.example -``` - -#### Configuration changes for repository storages - -This version introduces a new configuration structure for repository storages. -Update your current configuration as follows, replacing with your storages names and paths: - -**For installations from source** - -1. Update your `gitlab.yml`, from - - ```yaml - repositories: - storages: # You must have at least a 'default' storage path. - default: /home/git/repositories - nfs: /mnt/nfs/repositories - cephfs: /mnt/cephfs/repositories - ``` - - to - - ```yaml - repositories: - storages: # You must have at least a 'default' storage path. - default: - path: /home/git/repositories - nfs: - path: /mnt/nfs/repositories - cephfs: - path: /mnt/cephfs/repositories - ``` - -**For Omnibus installations** - -1. Update your `/etc/gitlab/gitlab.rb`, from - - ```ruby - git_data_dirs({ - "default" => "/var/opt/gitlab/git-data", - "nfs" => "/mnt/nfs/git-data", - "cephfs" => "/mnt/cephfs/git-data" - }) - ``` - - to - - ```ruby - git_data_dirs({ - "default" => { "path" => "/var/opt/gitlab/git-data" }, - "nfs" => { "path" => "/mnt/nfs/git-data" }, - "cephfs" => { "path" => "/mnt/cephfs/git-data" } - }) - ``` - -#### Git configuration - -Configure Git to generate packfile bitmaps (introduced in Git 2.0) on -the GitLab server during `git gc`. - -```sh -cd /home/git/gitlab - -sudo -u git -H git config --global repack.writeBitmaps true -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/9-0-stable:lib/support/nginx/gitlab-ssl origin/9-1-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/9-0-stable:lib/support/nginx/gitlab origin/9-1-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-1-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-1-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/9-0-stable:lib/support/init.d/gitlab.default.example origin/9-1-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 9. Install libs, migrations, etc. - -GitLab 9.1.8 [introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/24570) -a dependency on the `re2` regular expression library. To install this dependency: - -```bash -sudo apt-get install libre2-dev -``` - -Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but -you can [install re2 manually](https://github.com/google/re2/wiki/Install). - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 10. Optional: install Gitaly - -Gitaly is still an optional component of GitLab. If you want to save time -during your 9.1 upgrade **you can skip this step**. - -If you have not yet set up Gitaly then follow [Gitaly section of the installation -guide](../install/installation.md#install-gitaly). - -If you installed Gitaly in GitLab 9.0 you need to make some changes in -gitlab.yml, and create a new config.toml file. - -#### Gitaly gitlab.yml changes - -Look for `socket_path:` the `gitaly:` section. Its value is usually -`/home/git/gitlab/tmp/sockets/private/gitaly.socket`. Note what socket -path your gitlab.yml is using. Now go to the `repositories:` section, -and for each entry under `storages:`, add a `gitaly_address:` based on -the socket path, but with `unix:` in front. - -```yaml - repositories: - storages: - default: - path: /home/git/repositories - gitaly_address: unix:/home/git/gitlab/tmp/sockets/private/gitaly.socket - other_storage: - path: /home/git/other-repositories - gitaly_address: unix:/home/git/gitlab/tmp/sockets/private/gitaly.socket -``` - -Each entry under `storages:` should use the same `gitaly_address`. - -#### Compile Gitaly - -This step will also create `config.toml.example` which you need below. - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -#### Gitaly config.toml - -In GitLab 9.1 we are replacing environment variables in Gitaly with a -TOML configuration file. - -```shell -cd /home/git/gitaly - -sudo mv env env.old -sudo -u git cp config.toml.example config.toml -# If you are using custom repository storage paths they need to be in config.toml -sudo -u git -H editor config.toml -``` - -### 11. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 12. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (9.0) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 8.17 to 9.0](8.17-to-9.0.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-1-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-1-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/9.1-to-9.2.md b/doc/update/9.1-to-9.2.md index 79d92f05257..8514aa13f48 100644 --- a/doc/update/9.1-to-9.2.md +++ b/doc/update/9.1-to-9.2.md @@ -1,330 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 9.1 to 9.2 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz -echo '1014ee699071aa2ddd501907d18cbe15399c997d ruby-2.3.3.tar.gz' | shasum -c - && tar xzf ruby-2.3.3.tar.gz -cd ruby-2.3.3 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets and -it has a minimum requirement of node v4.3.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v4.3.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - - -Since 8.17, GitLab requires the use of yarn `>= v0.17.0` to manage -JavaScript dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.8.3 and dropped support for Go -1.5.x through 1.7.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.8.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 9-2-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 9-2-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/9-1-stable:config/gitlab.yml.example origin/9-2-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/9-1-stable:lib/support/nginx/gitlab-ssl origin/9-2-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/9-1-stable:lib/support/nginx/gitlab origin/9-2-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-2-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-2-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/9-1-stable:lib/support/init.d/gitlab.default.example origin/9-2-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 10. Install libs, migrations, etc. - -GitLab 9.2.8 [introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/24570) -a dependency on the `re2` regular expression library. To install this dependency: - -```bash -sudo apt-get install libre2-dev -``` - -Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but -you can [install re2 manually](https://github.com/google/re2/wiki/Install). - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:pack RAILS_ENV=production -sudo -u git -H bundle exec rake gettext:po_to_json RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 11. Optional: install Gitaly - -Gitaly is still an optional component of GitLab. If you want to save time -during your 9.2 upgrade **you can skip this step**. - -If you have not yet set up Gitaly then follow [Gitaly section of the installation -guide](../install/installation.md#install-gitaly). - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 12. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 13. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (9.1) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 9.0 to 9.1](9.0-to-9.1.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-2-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-2-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/9.2-to-9.3.md b/doc/update/9.2-to-9.3.md index 98443b8bfa6..8514aa13f48 100644 --- a/doc/update/9.2-to-9.3.md +++ b/doc/update/9.2-to-9.3.md @@ -1,348 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 9.2 to 9.3 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz -echo '1014ee699071aa2ddd501907d18cbe15399c997d ruby-2.3.3.tar.gz' | shasum -c - && tar xzf ruby-2.3.3.tar.gz -cd ruby-2.3.3 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets and -it has a minimum requirement of node v4.3.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v4.3.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - - -Since 8.17, GitLab requires the use of yarn `>= v0.17.0` to manage -JavaScript dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.8.3 and dropped support for Go -1.5.x through 1.7.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.8.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 9-3-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 9-3-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -If you have not yet set up Gitaly then follow [Gitaly section of the installation -guide](../install/installation.md#install-gitaly). - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/9-2-stable:config/gitlab.yml.example origin/9-3-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/9-2-stable:lib/support/nginx/gitlab-ssl origin/9-3-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/9-2-stable:lib/support/nginx/gitlab origin/9-3-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-3-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-3-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/9-2-stable:lib/support/init.d/gitlab.default.example origin/9-3-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -GitLab 9.3.8 [introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/24570) -a dependency on the `re2` regular expression library. To install this dependency: - -```bash -sudo apt-get install libre2-dev -``` - -Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but -you can [install re2 manually](https://github.com/google/re2/wiki/Install). - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (9.2) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 9.1 to 9.2](9.1-to-9.2.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-3-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-3-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/9.3-to-9.4.md b/doc/update/9.3-to-9.4.md index 640b9c3997e..8514aa13f48 100644 --- a/doc/update/9.3-to-9.4.md +++ b/doc/update/9.3-to-9.4.md @@ -1,361 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 9.3 to 9.4 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz -echo '1014ee699071aa2ddd501907d18cbe15399c997d ruby-2.3.3.tar.gz' | shasum -c - && tar xzf ruby-2.3.3.tar.gz -cd ruby-2.3.3 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets and -it has a minimum requirement of node v4.3.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v4.3.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - - -Since 8.17, GitLab requires the use of yarn `>= v0.17.0` to manage -JavaScript dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.8.3 and dropped support for Go -1.5.x through 1.7.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.8.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 9-4-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 9-4-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -If you have not yet set up Gitaly then follow [Gitaly section of the installation -guide](../install/installation.md#install-gitaly). - -As of GitLab 9.4, Gitaly is a mandatory component of GitLab. - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-9.4 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/9-3-stable:config/gitlab.yml.example origin/9-4-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/9-3-stable:lib/support/nginx/gitlab-ssl origin/9-4-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/9-3-stable:lib/support/nginx/gitlab origin/9-4-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-4-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-4-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/9-3-stable:lib/support/init.d/gitlab.default.example origin/9-4-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -GitLab 9.4 [introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/24570) -a dependency on the `re2` regular expression library. To install this dependency: - -```bash -sudo apt-get install libre2-dev -``` - -Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but -you can [install re2 manually](https://github.com/google/re2/wiki/Install). - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (9.3) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 9.2 to 9.3](9.2-to-9.3.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-4-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-4-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/9.4-to-9.5.md b/doc/update/9.4-to-9.5.md index e6cfa70975e..8514aa13f48 100644 --- a/doc/update/9.4-to-9.5.md +++ b/doc/update/9.4-to-9.5.md @@ -1,360 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 9.4 to 9.5 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz -echo '1014ee699071aa2ddd501907d18cbe15399c997d ruby-2.3.3.tar.gz' | shasum -c - && tar xzf ruby-2.3.3.tar.gz -cd ruby-2.3.3 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets and -it has a minimum requirement of node v4.3.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v4.3.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - - -Since 8.17, GitLab requires the use of yarn `>= v0.17.0` to manage -JavaScript dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.8.3 and dropped support for Go -1.5.x through 1.7.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.8.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 9-5-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 9-5-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-9.5 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/9-4-stable:config/gitlab.yml.example origin/9-5-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/9-4-stable:lib/support/nginx/gitlab-ssl origin/9-5-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/9-4-stable:lib/support/nginx/gitlab origin/9-5-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-5-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-5-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/9-4-stable:lib/support/init.d/gitlab.default.example origin/9-5-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (9.4) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 9.3 to 9.4](9.3-to-9.4.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-5-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/9-5-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/9.5-to-10.0.md b/doc/update/9.5-to-10.0.md index 8b565f67cb1..8514aa13f48 100644 --- a/doc/update/9.5-to-10.0.md +++ b/doc/update/9.5-to-10.0.md @@ -1,360 +1,5 @@ --- -comments: false +redirect_to: upgrading_from_source.md --- -# From 9.5 to 10.0 - -Make sure you view this update guide from the tag (version) of GitLab you would -like to install. In most cases this should be the highest numbered production -tag (without rc in it). You can select the tag in the version dropdown at the -top left corner of GitLab (below the menu bar). - -If the highest number stable branch is unclear please check the -[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation -guide links by version. - -### 1. Stop server - -```bash -sudo service gitlab stop -``` - -### 2. Backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production -``` - -### 3. Update Ruby - -NOTE: GitLab 9.0 and higher only support Ruby 2.3.x and dropped support for Ruby 2.1.x. Be -sure to upgrade your interpreter if necessary. - -You can check which version you are running with `ruby -v`. - -Download and compile Ruby: - -```bash -mkdir /tmp/ruby && cd /tmp/ruby -curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz -echo '1014ee699071aa2ddd501907d18cbe15399c997d ruby-2.3.3.tar.gz' | shasum -c - && tar xzf ruby-2.3.3.tar.gz -cd ruby-2.3.3 -./configure --disable-install-rdoc -make -sudo make install -``` - -Install Bundler: - -```bash -sudo gem install bundler --no-document --version '< 2' -``` - -### 4. Update Node - -GitLab now runs [webpack](http://webpack.js.org) to compile frontend assets and -it has a minimum requirement of node v4.3.0. - -You can check which version you are running with `node -v`. If you are running -a version older than `v4.3.0` you will need to update to a newer version. You -can find instructions to install from community maintained packages or compile -from source at the nodejs.org website. - -<https://nodejs.org/en/download/> - - -Since 8.17, GitLab requires the use of yarn `>= v0.17.0` to manage -JavaScript dependencies. - -```bash -curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list -sudo apt-get update -sudo apt-get install yarn -``` - -More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). - -### 5. Update Go - -NOTE: GitLab 9.2 and higher only supports Go 1.8.3 and dropped support for Go -1.5.x through 1.7.x. Be sure to upgrade your installation if necessary. - -You can check which version you are running with `go version`. - -Download and install Go: - -```bash -# Remove former Go installation folder -sudo rm -rf /usr/local/go - -curl --remote-name --progress https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz -echo '1862f4c3d3907e59b04a757cfda0ea7aa9ef39274af99a784f5be843c80c6772 go1.8.3.linux-amd64.tar.gz' | shasum -a256 -c - && \ - sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz -sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ -rm go1.8.3.linux-amd64.tar.gz -``` - -### 6. Get latest code - -```bash -cd /home/git/gitlab - -sudo -u git -H git fetch --all -sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically -sudo -u git -H git checkout -- locale -``` - -For GitLab Community Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-0-stable -``` - -OR - -For GitLab Enterprise Edition: - -```bash -cd /home/git/gitlab - -sudo -u git -H git checkout 10-0-stable-ee -``` - -### 7. Update gitlab-shell - -```bash -cd /home/git/gitlab-shell - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) -sudo -u git -H bin/compile -``` - -### 8. Update gitlab-workhorse - -Install and compile gitlab-workhorse. GitLab-Workhorse uses -[GNU Make](https://www.gnu.org/software/make/). -If you are not using Linux you may have to run `gmake` instead of -`make` below. - -```bash -cd /home/git/gitlab-workhorse - -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) -sudo -u git -H make -``` - -### 9. Update Gitaly - -#### New Gitaly configuration options required - -In order to function Gitaly needs some additional configuration information. Below we assume you installed Gitaly in `/home/git/gitaly` and GitLab Shell in `/home/git/gitlab-shell`. - -```shell -echo ' -[gitaly-ruby] -dir = "/home/git/gitaly/ruby" - -[gitlab-shell] -dir = "/home/git/gitlab-shell" -' | sudo -u git tee -a /home/git/gitaly/config.toml -``` - -#### Check Gitaly configuration - -Due to a bug in the `rake gitlab:gitaly:install` script your Gitaly -configuration file may contain syntax errors. The block name -`[[storages]]`, which may occur more than once in your `config.toml` -file, should be `[[storage]]` instead. - -```shell -sudo -u git -H sed -i.pre-10.0 's/\[\[storages\]\]/[[storage]]/' /home/git/gitaly/config.toml -``` - -#### Compile Gitaly - -```shell -cd /home/git/gitaly -sudo -u git -H git fetch --all --tags -sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) -sudo -u git -H make -``` - -### 10. Update MySQL permissions - -If you are using MySQL you need to grant the GitLab user the necessary -permissions on the database: - -```bash -mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" -``` - -If you use MySQL with replication, or just have MySQL configured with binary logging, -you will need to also run the following on all of your MySQL servers: - -```bash -mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" -``` - -You can make this setting permanent by adding it to your `my.cnf`: - -``` -log_bin_trust_function_creators=1 -``` - -### 11. Update configuration files - -#### New configuration options for `gitlab.yml` - -There might be configuration options available for [`gitlab.yml`][yaml]. View them with the command below and apply them manually to your current `gitlab.yml`: - -```sh -cd /home/git/gitlab - -git diff origin/9-5-stable:config/gitlab.yml.example origin/10-0-stable:config/gitlab.yml.example -``` - -#### Nginx configuration - -Ensure you're still up-to-date with the latest NGINX configuration changes: - -```sh -cd /home/git/gitlab - -# For HTTPS configurations -git diff origin/9-5-stable:lib/support/nginx/gitlab-ssl origin/10-0-stable:lib/support/nginx/gitlab-ssl - -# For HTTP configurations -git diff origin/9-5-stable:lib/support/nginx/gitlab origin/10-0-stable:lib/support/nginx/gitlab -``` - -If you are using Strict-Transport-Security in your installation to continue using it you must enable it in your Nginx -configuration as GitLab application no longer handles setting it. - -If you are using Apache instead of NGINX please see the updated [Apache templates]. -Also note that because Apache does not support upstreams behind Unix sockets you -will need to let gitlab-workhorse listen on a TCP port. You can do this -via [/etc/default/gitlab]. - -[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache -[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-0-stable/lib/support/init.d/gitlab.default.example#L38 - -#### SMTP configuration - -If you're installing from source and use SMTP to deliver mail, you will need to add the following line -to config/initializers/smtp_settings.rb: - -```ruby -ActionMailer::Base.delivery_method = :smtp -``` - -See [smtp_settings.rb.sample] as an example. - -[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-0-stable/config/initializers/smtp_settings.rb.sample#L13 - -#### Init script - -There might be new configuration options available for [`gitlab.default.example`][gl-example]. View them with the command below and apply them manually to your current `/etc/default/gitlab`: - -```sh -cd /home/git/gitlab - -git diff origin/9-5-stable:lib/support/init.d/gitlab.default.example origin/10-0-stable:lib/support/init.d/gitlab.default.example -``` - -Ensure you're still up-to-date with the latest init script changes: - -```bash -cd /home/git/gitlab - -sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab -``` - -For Ubuntu 16.04.1 LTS: - -```bash -sudo systemctl daemon-reload -``` - -### 12. Install libs, migrations, etc. - -```bash -cd /home/git/gitlab - -# MySQL installations (note: the line below states '--without postgres') -sudo -u git -H bundle install --without postgres development test --deployment - -# PostgreSQL installations (note: the line below states '--without mysql') -sudo -u git -H bundle install --without mysql development test --deployment - -# Optional: clean up old gems -sudo -u git -H bundle clean - -# Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production - -# Compile GetText PO files - -sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production - -# Update node dependencies and recompile assets -sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production - -# Clean up cache -sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production -``` - -**MySQL installations**: Run through the `MySQL strings limits` and `Tables and data conversion to utf8mb4` [tasks](../install/database_mysql.md). - -### 13. Start application - -```bash -sudo service gitlab start -sudo service nginx restart -``` - -### 14. Check application status - -Check if GitLab and its environment are configured correctly: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production -``` - -To make sure you didn't miss anything run a more thorough check: - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -``` - -If all items are green, then congratulations, the upgrade is complete! - -## Things went south? Revert to previous version (9.5) - -### 1. Revert the code to the previous version - -Follow the [upgrade guide from 9.4 to 9.5](9.4-to-9.5.md), except for the -database migration (the backup is already migrated to the previous version). - -### 2. Restore from the backup - -```bash -cd /home/git/gitlab - -sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production -``` - -If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. - -[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-0-stable/config/gitlab.yml.example -[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/10-0-stable/lib/support/init.d/gitlab.default.example +This document was moved to [another location](upgrading_from_source.md). diff --git a/doc/update/README.md b/doc/update/README.md index d4fc0cc91bf..d098dc99518 100644 --- a/doc/update/README.md +++ b/doc/update/README.md @@ -18,14 +18,20 @@ Based on your installation, choose a section below that fits your needs. ## Installation from source -- [Upgrading Community Edition from source][source-ce] - The individual - upgrade guides are for those who have installed GitLab CE from source. -- [Upgrading Enterprise Edition from source][source-ee] - The individual - upgrade guides are for those who have installed GitLab EE from source. +- [Upgrading Community Edition and Enterprise Edition from + source](upgrading_from_source.md) - The guidelines for upgrading Community + Edition and Enterprise Edition from source. - [Patch versions](patch_versions.md) guide includes the steps needed for a patch version, eg. 6.2.0 to 6.2.1, and apply to both Community and Enterprise Editions. +In the past we used separate documents for the upgrading instructions, but we +have since switched to using a single document. The old upgrading guidelines +can still be found in the Git repository: + +- [Old upgrading guidelines for Community Edition][old-ce-upgrade-docs] +- [Old upgrading guidelines for Enterprise Edition][old-ee-upgrade-docs] + ## Installation using Docker GitLab provides official Docker images for both Community and Enterprise @@ -113,11 +119,10 @@ The following guides are for subscribers of the Enterprise Edition only. If you wish to upgrade your GitLab installation from Community to Enterprise Edition, follow the guides below based on the installation method: -- [Source CE to EE update guides][source-ee] - Find your version, and follow the - `-ce-to-ee.md` guide. The steps are very similar to a version upgrade: stop - the server, get the code, update config files for the new functionality, - install libraries and do migrations, update the init script, start the - application and check its status. +- [Source CE to EE update guides][source-ce-to-ee] - The steps are very similar + to a version upgrade: stop the server, get the code, update config files for + the new functionality, install libraries and do migrations, update the init + script, start the application and check its status. - [Omnibus CE to EE][omni-ce-ee] - Follow this guide to update your Omnibus GitLab Community Edition to the Enterprise Edition. @@ -138,8 +143,9 @@ possible. upgrading a PostgreSQL database with minimal downtime. [omnidocker]: http://docs.gitlab.com/omnibus/docker/README.html -[source-ee]: https://gitlab.com/gitlab-org/gitlab-ee/tree/master/doc/update -[source-ce]: https://gitlab.com/gitlab-org/gitlab-ce/tree/master/doc/update +[old-ee-upgrade-docs]: https://gitlab.com/gitlab-org/gitlab-ee/tree/11-8-stable-ee/doc/update +[old-ce-upgrade-docs]: https://gitlab.com/gitlab-org/gitlab-ce/tree/11-8-stable/doc/update +[source-ce-to-ee]: upgrading_from_ce_to_ee.md [ee-ce]: ../downgrade_ee_to_ce/README.md [ce]: https://about.gitlab.com/features/#community [ee]: https://about.gitlab.com/features/#enterprise diff --git a/doc/update/upgrading_from_ce_to_ee.md b/doc/update/upgrading_from_ce_to_ee.md new file mode 100644 index 00000000000..0d1ecab5f8e --- /dev/null +++ b/doc/update/upgrading_from_ce_to_ee.md @@ -0,0 +1,132 @@ +--- +comments: false +--- + +# Upgrading from Community Edition to Enterprise Edition from source + +NOTE: **NOTE** In the past we used separate documents for upgrading from +Community Edition to Enterprise Edition. These documents can be found in the +[`doc/update` directory of Enterprise Edition's source +code][old-ee-upgrade-docs]. + +## General upgrading steps + +This guide assumes you have a correctly configured and tested installation of +GitLab Community Edition. If you run into any trouble or if you have any +questions please contact us at [support@gitlab.com]. + +In all examples, replace `EE_BRANCH` with the Enterprise Edition branch for the +version you are using, and `CE_BRANCH` with the Community Edition branch. +Branch names use the format `major-minor-stable-ee` for Enterprise Edition, and +`major-minor-stable` for Community Edition. For example, for 11.8.0 you would +use the following branches: + +* Enterprise Edition: `11-8-stable-ee` +* Community Edition: `11-8-stable` + +### 0. Backup + +Make a backup just in case something goes wrong: + +```bash +cd /home/git/gitlab +sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production +``` + +For installations using MySQL, this may require granting "LOCK TABLES" +privileges to the GitLab user on the database version. + +### 1. Stop server + +```bash +sudo service gitlab stop +``` + +### 2. Get the EE code + +```bash +cd /home/git/gitlab +sudo -u git -H git remote add -f ee https://gitlab.com/gitlab-org/gitlab-ee.git +sudo -u git -H git checkout EE_BRANCH +``` + +### 3. Install libs, migrations, etc. + +```bash +cd /home/git/gitlab + +# MySQL installations (note: the line below states '--without postgres') +sudo -u git -H bundle install --without postgres development test --deployment + +# PostgreSQL installations (note: the line below states '--without mysql') +sudo -u git -H bundle install --without mysql development test --deployment + +# Run database migrations +sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production + +# Clean up assets and cache +sudo -u git -H bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production +``` + +### 4. Install `gitlab-elasticsearch-indexer` (optional) **[STARTER ONLY]** + +If you're interested in using GitLab's new [elasticsearch repository +indexer][indexer-beta] (currently in beta) please follow the instructions on the +document linked above and enable the indexer usage in the GitLab admin settings. + +### 5. Start application + +```bash +sudo service gitlab start +sudo service nginx restart +``` + +### 6. Check application status + +Check if GitLab and its environment are configured correctly: + +```bash +sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production +``` + +To make sure you didn't miss anything run a more thorough check with: + +```bash +sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production +``` + +If all items are green, then congratulations upgrade complete! + +## Things went south? Revert to previous version (Community Edition) + +### 1. Revert the code to the previous version + +```bash +cd /home/git/gitlab +sudo -u git -H git checkout CE_BRANCH +``` + +### 2. Restore from the backup + +```bash +cd /home/git/gitlab +sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production +``` + +## Version specific steps + +Certain versions of GitLab may require you to perform additional steps when +upgrading from Community Edition to Enterprise Edition. Should such steps be +necessary, they will listed per version below. + +<!-- +Example: + +### 11.8.0 + +Additional instructions here. +--> + +[support@gitlab.com]: mailto:support@gitlab.com +[old-ee-upgrade-docs]: https://gitlab.com/gitlab-org/gitlab-ee/tree/11-8-stable-ee/doc/update +[indexer-beta]: https://docs.gitlab.com/ee/integration/elasticsearch.html diff --git a/doc/update/upgrading_from_source.md b/doc/update/upgrading_from_source.md new file mode 100644 index 00000000000..20d8ebecc0a --- /dev/null +++ b/doc/update/upgrading_from_source.md @@ -0,0 +1,390 @@ +--- +comments: false +--- + +# Upgrading Community Edition and Enterprise Edition from source + +Make sure you view this update guide from the branch (version) of GitLab you +would like to install (e.g., `11.8`. You can select the version in the version +dropdown at the top left corner of GitLab (below the menu bar). + +In all examples, replace `BRANCH` with the branch for the version you uprading +to (e.g. `11-8-stable` for `11.8`), and replace `PREVIOUS_BRANCH` with the +branch for the version you are upgrading from (e.g. `11-7-stable` for `11.7`). + +If the highest number stable branch is unclear please check the +[GitLab Blog](https://about.gitlab.com/blog/archives.html) for installation +guide links by version. + +## Guidelines for all versions + +This section contains all the steps necessary to upgrade Community Edition or +Enterprise Edition, regardless of the version you are upgrading to. Version +specific guidelines (should there be any) are covered separately. + +### 1. Stop server + +```bash +sudo service gitlab stop +``` + +### 2. Backup + +NOTE: If you installed GitLab from source, make sure `rsync` is installed. + +```bash +cd /home/git/gitlab + +sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production +``` + +### 3. Update Ruby + +NOTE: Beginning in GitLab 11.0, we only support Ruby 2.4 or higher, and dropped +support for Ruby 2.3. Be sure to upgrade if necessary. + +You can check which version you are running with `ruby -v`. + +Download Ruby and compile it: + +```bash +mkdir /tmp/ruby && cd /tmp/ruby +curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.3.tar.gz +echo 'f919a9fbcdb7abecd887157b49833663c5c15fda ruby-2.5.3.tar.gz' | shasum -c - && tar xzf ruby-2.5.3.tar.gz +cd ruby-2.5.3 + +./configure --disable-install-rdoc +make +sudo make install +``` + +Install Bundler: + +```bash +sudo gem install bundler --no-document --version '< 2' +``` + +### 4. Update Node + +NOTE: Beginning in GitLab 11.8, we only support node 8 or higher, and dropped +support for node 6. Be sure to upgrade if necessary. + +GitLab utilizes [webpack](http://webpack.js.org) to compile frontend assets. +This requires a minimum version of node v8.10.0. + +You can check which version you are running with `node -v`. If you are running +a version older than `v8.10.0` you will need to update to a newer version. You +can find instructions to install from community maintained packages or compile +from source at the nodejs.org website. + +<https://nodejs.org/en/download/> + +GitLab also requires the use of yarn `>= v1.10.0` to manage JavaScript +dependencies. + +```bash +curl --silent --show-error https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - +echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list +sudo apt-get update +sudo apt-get install yarn +``` + +More information can be found on the [yarn website](https://yarnpkg.com/en/docs/install). + +### 5. Update Go + +NOTE: GitLab 11.4 and higher only supports Go 1.10.x and newer, and dropped support for Go +1.9.x. Be sure to upgrade your installation if necessary. + +You can check which version you are running with `go version`. + +Download and install Go: + +```bash +# Remove former Go installation folder +sudo rm -rf /usr/local/go + +curl --remote-name --progress https://dl.google.com/go/go1.10.5.linux-amd64.tar.gz +echo 'a035d9beda8341b645d3f45a1b620cf2d8fb0c5eb409be36b389c0fd384ecc3a go1.10.5.linux-amd64.tar.gz' | shasum -a256 -c - && \ + sudo tar -C /usr/local -xzf go1.10.5.linux-amd64.tar.gz +sudo ln -sf /usr/local/go/bin/{go,godoc,gofmt} /usr/local/bin/ +rm go1.10.5.linux-amd64.tar.gz +``` + +### 6. Get latest code + +```bash +cd /home/git/gitlab + +sudo -u git -H git fetch --all --prune +sudo -u git -H git checkout -- db/schema.rb # local changes will be restored automatically +sudo -u git -H git checkout -- locale +``` + +For GitLab Community Edition: + +```bash +cd /home/git/gitlab + +sudo -u git -H git checkout BRANCH +``` + +OR + +For GitLab Enterprise Edition: + +```bash +cd /home/git/gitlab + +sudo -u git -H git checkout BRANCH-ee +``` + +### 7. Update gitlab-shell + +```bash +cd /home/git/gitlab-shell + +sudo -u git -H git fetch --all --tags --prune +sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_SHELL_VERSION) +sudo -u git -H bin/compile +``` + +### 8. Update gitlab-workhorse + +Install and compile gitlab-workhorse. GitLab-Workhorse uses +[GNU Make](https://www.gnu.org/software/make/). +If you are not using Linux you may have to run `gmake` instead of +`make` below. + +```bash +cd /home/git/gitlab-workhorse + +sudo -u git -H git fetch --all --tags --prune +sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_WORKHORSE_VERSION) +sudo -u git -H make +``` + +### 9. Update Gitaly + +#### Compile Gitaly + +```shell +cd /home/git/gitaly +sudo -u git -H git fetch --all --tags --prune +sudo -u git -H git checkout v$(</home/git/gitlab/GITALY_SERVER_VERSION) +sudo -u git -H make +``` + +### 10. Update gitlab-pages + +#### Only needed if you use GitLab Pages + +Install and compile gitlab-pages. GitLab-Pages uses +[GNU Make](https://www.gnu.org/software/make/). +If you are not using Linux you may have to run `gmake` instead of +`make` below. + +```bash +cd /home/git/gitlab-pages + +sudo -u git -H git fetch --all --tags --prune +sudo -u git -H git checkout v$(</home/git/gitlab/GITLAB_PAGES_VERSION) +sudo -u git -H make +``` + +### 11. Update MySQL permissions + +If you are using MySQL you need to grant the GitLab user the necessary +permissions on the database: + +```bash +mysql -u root -p -e "GRANT TRIGGER ON \`gitlabhq_production\`.* TO 'git'@'localhost';" +``` + +If you use MySQL with replication, or just have MySQL configured with binary logging, +you will need to also run the following on all of your MySQL servers: + +```bash +mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 1;" +``` + +You can make this setting permanent by adding it to your `my.cnf`: + +``` +log_bin_trust_function_creators=1 +``` + +### 12. Update configuration files + +#### New configuration options for `gitlab.yml` + +There might be configuration options available for [`gitlab.yml`][yaml]. View +them with the command below and apply them manually to your current +`gitlab.yml`: + +```sh +cd /home/git/gitlab + +git diff origin/PREVIOUS_BRANCH:config/gitlab.yml.example origin/BRANCH:config/gitlab.yml.example +``` + +#### Nginx configuration + +Ensure you're still up-to-date with the latest NGINX configuration changes: + +```sh +cd /home/git/gitlab + +# For HTTPS configurations +git diff origin/PREVIOUS_BRANCH:lib/support/nginx/gitlab-ssl origin/BRANCH:lib/support/nginx/gitlab-ssl + +# For HTTP configurations +git diff origin/PREVIOUS_BRANCH:lib/support/nginx/gitlab origin/BRANCH:lib/support/nginx/gitlab +``` + +If you are using Strict-Transport-Security in your installation to continue +using it you must enable it in your Nginx configuration as GitLab application no +longer handles setting it. + +If you are using Apache instead of NGINX please see the updated [Apache templates]. +Also note that because Apache does not support upstreams behind Unix sockets you +will need to let gitlab-workhorse listen on a TCP port. You can do this +via [/etc/default/gitlab]. + +#### SMTP configuration + +If you're installing from source and use SMTP to deliver mail, you will need to +add the following line to `config/initializers/smtp_settings.rb`: + +```ruby +ActionMailer::Base.delivery_method = :smtp +``` + +See [smtp_settings.rb.sample] as an example. + +#### Init script + +There might be new configuration options available for +[`gitlab.default.example`][gl-example]. View them with the command below and +apply them manually to your current `/etc/default/gitlab`: + +```sh +cd /home/git/gitlab + +git diff origin/PREVIOUS_BRANCH:lib/support/init.d/gitlab.default.example origin/BRANCH:lib/support/init.d/gitlab.default.example +``` + +Ensure you're still up-to-date with the latest init script changes: + +```bash +cd /home/git/gitlab + +sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab +``` + +For Ubuntu 16.04.1 LTS: + +```bash +sudo systemctl daemon-reload +``` + +### 13. Install libs, migrations, etc. + +```bash +cd /home/git/gitlab + +# PostgreSQL installations (note: the line below states '--without mysql') +sudo -u git -H bundle install --deployment --without development test mysql aws kerberos + +# MySQL installations (note: the line below states '--without postgres') +sudo -u git -H bundle install --deployment --without development test postgres aws kerberos + + +# Optional: clean up old gems +sudo -u git -H bundle clean + +# Run database migrations +sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production + +# Compile GetText PO files + +sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production + +# Update node dependencies and recompile assets +sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production + +# Clean up cache +sudo -u git -H bundle exec rake cache:clear RAILS_ENV=production +``` + +**MySQL installations**: Run through the `MySQL strings limits` and `Tables and +data conversion to utf8mb4` [tasks](../install/database_mysql.md). + +### 14. Start application + +```bash +sudo service gitlab start +sudo service nginx restart +``` + +### 15. Check application status + +Check if GitLab and its environment are configured correctly: + +```bash +cd /home/git/gitlab + +sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production +``` + +To make sure you didn't miss anything run a more thorough check: + +```bash +cd /home/git/gitlab + +sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production +``` + +If all items are green, then congratulations, the upgrade is complete! + +## Version specific upgrading instructions + +This section contains upgrading instructions for specific versions. When +present, first follow the upgrading guidelines for all versions. If the version +you are upgrading to is not listed here, then no additional steps are required. + +<!-- +Example: + +### 11.8.0 + +Additional instructions here. +--> + +## Things went south? Revert to previous version + +### 1. Revert the code to the previous version + +To revert to a previous version, you'll need to following the upgrading guides +for the previous version. If you upgraded to 11.8 and want to revert back to +11.7, you'll need to follow the guides for upgrading from 11.6 to 11.7. You can +use the version dropdown at the top of the page to select the right version. + +When reverting, you should _not_ follow the database migration guides, as the +backup is already migrated to the previous version. + +### 2. Restore from the backup + +```bash +cd /home/git/gitlab + +sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production +``` + +If you have more than one backup `*.tar` file(s) please add `BACKUP=timestamp_of_backup` to the command above. + +[yaml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example +[gl-example]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/init.d/gitlab.default.example +[smtp_settings.rb.sample]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/initializers/smtp_settings.rb.sample#L13 +[Apache templates]: https://gitlab.com/gitlab-org/gitlab-recipes/tree/master/web-server/apache +[/etc/default/gitlab]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/init.d/gitlab.default.example#L38 diff --git a/doc/user/index.md b/doc/user/index.md index 36aba5e01c6..22506b30498 100644 --- a/doc/user/index.md +++ b/doc/user/index.md @@ -65,7 +65,9 @@ and [Multiple Issue Boards](https://docs.gitlab.com/ee/user/project/issue_board. - View the current health and status of each CI environment running on Kubernetes with [Deploy Boards](https://docs.gitlab.com/ee/user/project/deploy_boards.html) - Leverage continuous delivery method with [Canary Deployments](https://docs.gitlab.com/ee/user/project/canary_deployments.html) -You can also [integrate](project/integrations/project_services.md) GitLab with numerous third-party applications, such as Mattermost, Microsoft Teams, HipChat, Trello, Slack, Bamboo CI, JIRA, and a lot more. +You can also [integrate](project/integrations/project_services.md) GitLab with +numerous third-party applications, such as Mattermost, Microsoft Teams, Trello, +Slack, Bamboo CI, JIRA, and a lot more. ## Projects diff --git a/doc/user/project/integrations/hipchat.md b/doc/user/project/integrations/hipchat.md deleted file mode 100644 index 0fd847d415f..00000000000 --- a/doc/user/project/integrations/hipchat.md +++ /dev/null @@ -1,53 +0,0 @@ -# Atlassian HipChat - -GitLab provides a way to send HipChat notifications upon a number of events, -such as when a user pushes code, creates a branch or tag, adds a comment, and -creates a merge request. - -## Setup - -GitLab requires the use of a HipChat v2 API token to work. v1 tokens are -not supported at this time. Note the differences between v1 and v2 tokens: - -HipChat v1 API (legacy) supports "API Auth Tokens" in the Group API menu. A v1 -token is allowed to send messages to *any* room. - -HipChat v2 API has tokens that are can be created using the Integrations tab -in the Group or Room admin page. By design, these are lightweight tokens that -allow GitLab to send messages only to *one* room. - -### Complete these steps in HipChat - -1. Go to: <https://admin.hipchat.com/admin> -1. Click on "Group Admin" -> "Integrations". -1. Find "Build Your Own!" and click "Create". -1. Select the desired room, name the integration "GitLab", and click "Create". -1. In the "Send messages to this room by posting this URL" column, you should -see a URL in the format: - -``` -https://api.hipchat.com/v2/room/<room>/notification?auth_token=<token> -``` - -HipChat is now ready to accept messages from GitLab. Next, set up the HipChat -service in GitLab. - -### Complete these steps in GitLab - -1. Navigate to the project you want to configure for notifications. -1. Navigate to the [Integrations page](project_services.md#accessing-the-project-services) -1. Click "HipChat". -1. Select the "Active" checkbox. -1. Insert the `token` field from the URL into the `Token` field on the Web page. -1. Insert the `room` field from the URL into the `Room` field on the Web page. -1. Save or optionally click "Test Settings". - -## Troubleshooting - -If you do not see notifications, make sure you are using a HipChat v2 API -token, not a v1 token. - -Note that the v2 token is tied to a specific room. If you want to be able to -specify arbitrary rooms, you can create an API token for a specific user in -HipChat under "Account settings" and "API access". Use the `XXX` value under -`auth_token=XXX`. diff --git a/doc/user/project/integrations/project_services.md b/doc/user/project/integrations/project_services.md index be45ce46dfd..cec9018b67f 100644 --- a/doc/user/project/integrations/project_services.md +++ b/doc/user/project/integrations/project_services.md @@ -36,7 +36,6 @@ Click on the service links to see further configuration instructions and details | External Wiki | Replaces the link to the internal wiki with a link to an external wiki | | Flowdock | Flowdock is a collaboration web app for technical teams | | [Hangouts Chat](hangouts_chat.md) | Receive events notifications in Google Hangouts Chat | -| [HipChat](hipchat.md) | Private group chat and IM | | [Irker (IRC gateway)](irker.md) | Send IRC messages, on update, to a list of recipients through an Irker gateway | | [JIRA](jira.md) | JIRA issue tracker | | JetBrains TeamCity CI | A continuous integration and build server | diff --git a/doc/user/project/pages/introduction.md b/doc/user/project/pages/introduction.md index cebff38ba88..fa65a206273 100644 --- a/doc/user/project/pages/introduction.md +++ b/doc/user/project/pages/introduction.md @@ -348,8 +348,8 @@ This can be achieved by including a `script:` command like this in your pages: # Other directives script: - - # build the public/ directory first - - find public -type f -iregex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -execdir gzip -f --keep {} \; + # Build the public/ directory first + - find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec gzip -f -k {} \; ``` By pre-compressing the files and including both versions in the artifact, Pages diff --git a/lib/api/services.rb b/lib/api/services.rb index 637b5a8a89a..36bdba2d765 100644 --- a/lib/api/services.rb +++ b/lib/api/services.rb @@ -370,44 +370,6 @@ module API desc: 'The Hangouts Chat webhook. e.g. https://chat.googleapis.com/v1/spaces…' } ], - 'hipchat' => [ - { - required: true, - name: :token, - type: String, - desc: 'The room token' - }, - { - required: false, - name: :room, - type: String, - desc: 'The room name or ID' - }, - { - required: false, - name: :color, - type: String, - desc: 'The room color' - }, - { - required: false, - name: :notify, - type: Boolean, - desc: 'Enable notifications' - }, - { - required: false, - name: :api_version, - type: String, - desc: 'Leave blank for default (v2)' - }, - { - required: false, - name: :server, - type: String, - desc: 'Leave blank for default. https://hipchat.example.com' - } - ], 'irker' => [ { required: true, @@ -691,7 +653,6 @@ module API ExternalWikiService, FlowdockService, HangoutsChatService, - HipchatService, IrkerService, JiraService, KubernetesService, diff --git a/spec/factories/services.rb b/spec/factories/services.rb index 0d8c26a2ee9..70c34f8640b 100644 --- a/spec/factories/services.rb +++ b/spec/factories/services.rb @@ -62,10 +62,4 @@ FactoryBot.define do project_key: 'jira-key' ) end - - factory :hipchat_service do - project - type 'HipchatService' - token 'test_token' - end end diff --git a/spec/features/projects/services/disable_triggers_spec.rb b/spec/features/projects/services/disable_triggers_spec.rb index 1a13fe03a67..65b597da269 100644 --- a/spec/features/projects/services/disable_triggers_spec.rb +++ b/spec/features/projects/services/disable_triggers_spec.rb @@ -14,10 +14,11 @@ describe 'Disable individual triggers' do end context 'service has multiple supported events' do - let(:service_name) { 'HipChat' } + let(:service_name) { 'JIRA' } it 'shows trigger checkboxes' do - event_count = HipchatService.supported_events.count + event_count = JiraService.supported_events.count + expect(event_count).to be > 1 expect(page).to have_content "Trigger" expect(page).to have_css(checkbox_selector, count: event_count) diff --git a/spec/features/projects/services/user_activates_hipchat_spec.rb b/spec/features/projects/services/user_activates_hipchat_spec.rb deleted file mode 100644 index 2f5313c91f9..00000000000 --- a/spec/features/projects/services/user_activates_hipchat_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -require 'spec_helper' - -describe 'User activates HipChat' do - let(:project) { create(:project) } - let(:user) { create(:user) } - - before do - project.add_maintainer(user) - sign_in(user) - - visit(project_settings_integrations_path(project)) - - click_link('HipChat') - end - - context 'with standart settings' do - it 'activates service' do - check('Active') - fill_in('Room', with: 'gitlab') - fill_in('Token', with: 'verySecret') - click_button('Save') - - expect(page).to have_content('HipChat activated.') - end - end - - context 'with custom settings' do - it 'activates service' do - check('Active') - fill_in('Room', with: 'gitlab_custom') - fill_in('Token', with: 'secretCustom') - fill_in('Server', with: 'https://chat.example.com') - click_button('Save') - - expect(page).to have_content('HipChat activated.') - end - end -end diff --git a/spec/features/projects/services/user_views_services_spec.rb b/spec/features/projects/services/user_views_services_spec.rb index e9c8cf0fe34..b0a838a7d2b 100644 --- a/spec/features/projects/services/user_views_services_spec.rb +++ b/spec/features/projects/services/user_views_services_spec.rb @@ -14,7 +14,6 @@ describe 'User views services' do it 'shows the list of available services' do expect(page).to have_content('Project services') expect(page).to have_content('Campfire') - expect(page).to have_content('HipChat') expect(page).to have_content('Assembla') expect(page).to have_content('Pushover') expect(page).to have_content('Atlassian Bamboo') @@ -22,5 +21,7 @@ describe 'User views services' do expect(page).to have_content('Asana') expect(page).to have_content('Irker (IRC gateway)') expect(page).to have_content('Packagist') + expect(page).to have_content('Mattermost') + expect(page).to have_content('Slack') end end diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index 6897ac8a3a8..c15b360b563 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -219,7 +219,6 @@ project: - packagist_service - pivotaltracker_service - prometheus_service -- hipchat_service - flowdock_service - assembla_service - asana_service diff --git a/spec/lib/gitlab/import_export/project.json b/spec/lib/gitlab/import_export/project.json index 58949f76bd6..1327f414498 100644 --- a/spec/lib/gitlab/import_export/project.json +++ b/spec/lib/gitlab/import_export/project.json @@ -6775,28 +6775,6 @@ "wiki_page_events": true }, { - "id": 93, - "title": "HipChat", - "project_id": 5, - "created_at": "2016-06-14T15:01:51.219Z", - "updated_at": "2016-06-14T15:01:51.219Z", - "active": false, - "properties": { - "notify_only_broken_pipelines": true - }, - "template": false, - "push_events": true, - "issues_events": true, - "merge_requests_events": true, - "tag_push_events": true, - "note_events": true, - "pipeline_events": true, - "type": "HipchatService", - "category": "common", - "default": false, - "wiki_page_events": true - }, - { "id": 91, "title": "Flowdock", "project_id": 5, diff --git a/spec/models/project_services/hipchat_service_spec.rb b/spec/models/project_services/hipchat_service_spec.rb deleted file mode 100644 index b0fd2ceead0..00000000000 --- a/spec/models/project_services/hipchat_service_spec.rb +++ /dev/null @@ -1,408 +0,0 @@ -require 'spec_helper' - -describe HipchatService do - describe "Associations" do - it { is_expected.to belong_to :project } - it { is_expected.to have_one :service_hook } - end - - describe 'Validations' do - context 'when service is active' do - before do - subject.active = true - end - - it { is_expected.to validate_presence_of(:token) } - end - - context 'when service is inactive' do - before do - subject.active = false - end - - it { is_expected.not_to validate_presence_of(:token) } - end - end - - describe "Execute" do - let(:hipchat) { described_class.new } - let(:user) { create(:user) } - let(:project) { create(:project, :repository) } - let(:api_url) { 'https://hipchat.example.com/v2/room/123456/notification?auth_token=verySecret' } - let(:project_name) { project.full_name.gsub(/\s/, '') } - let(:token) { 'verySecret' } - let(:server_url) { 'https://hipchat.example.com'} - let(:push_sample_data) do - Gitlab::DataBuilder::Push.build_sample(project, user) - end - - before do - allow(hipchat).to receive_messages( - project_id: project.id, - project: project, - room: 123456, - server: server_url, - token: token - ) - WebMock.stub_request(:post, api_url) - end - - it 'tests and return errors' do - allow(hipchat).to receive(:execute).and_raise(StandardError, 'no such room') - result = hipchat.test(push_sample_data) - - expect(result[:success]).to be_falsey - expect(result[:result].to_s).to eq('no such room') - end - - it 'uses v1 if version is provided' do - allow(hipchat).to receive(:api_version).and_return('v1') - expect(HipChat::Client).to receive(:new).with( - token, - api_version: 'v1', - server_url: server_url - ).and_return(double(:hipchat_service).as_null_object) - hipchat.execute(push_sample_data) - end - - it 'uses v2 as the version when nothing is provided' do - allow(hipchat).to receive(:api_version).and_return('') - expect(HipChat::Client).to receive(:new).with( - token, - api_version: 'v2', - server_url: server_url - ).and_return(double(:hipchat_service).as_null_object) - hipchat.execute(push_sample_data) - end - - context 'push events' do - it "calls Hipchat API for push events" do - hipchat.execute(push_sample_data) - - expect(WebMock).to have_requested(:post, api_url).once - end - - it "creates a push message" do - message = hipchat.send(:create_push_message, push_sample_data) - - push_sample_data[:object_attributes] - branch = push_sample_data[:ref].gsub('refs/heads/', '') - expect(message).to include("#{user.name} pushed to branch " \ - "<a href=\"#{project.web_url}/commits/#{branch}\">#{branch}</a> of " \ - "<a href=\"#{project.web_url}\">#{project_name}</a>") - end - end - - context 'tag_push events' do - let(:push_sample_data) do - Gitlab::DataBuilder::Push.build( - project, - user, - Gitlab::Git::BLANK_SHA, - '1' * 40, - 'refs/tags/test', - []) - end - - it "calls Hipchat API for tag push events" do - hipchat.execute(push_sample_data) - - expect(WebMock).to have_requested(:post, api_url).once - end - - it "creates a tag push message" do - message = hipchat.send(:create_push_message, push_sample_data) - - push_sample_data[:object_attributes] - expect(message).to eq("#{user.name} pushed new tag " \ - "<a href=\"#{project.web_url}/commits/test\">test</a> to " \ - "<a href=\"#{project.web_url}\">#{project_name}</a>\n") - end - end - - context 'issue events' do - let(:issue) { create(:issue, title: 'Awesome issue', description: '**please** fix') } - let(:issue_service) { Issues::CreateService.new(project, user) } - let(:issues_sample_data) { issue_service.hook_data(issue, 'open') } - - it "calls Hipchat API for issue events" do - hipchat.execute(issues_sample_data) - - expect(WebMock).to have_requested(:post, api_url).once - end - - it "creates an issue message" do - message = hipchat.send(:create_issue_message, issues_sample_data) - - obj_attr = issues_sample_data[:object_attributes] - expect(message).to eq("#{user.name} opened " \ - "<a href=\"#{obj_attr[:url]}\">issue ##{obj_attr["iid"]}</a> in " \ - "<a href=\"#{project.web_url}\">#{project_name}</a>: " \ - "<b>Awesome issue</b>" \ - "<pre><strong>please</strong> fix</pre>") - end - end - - context 'merge request events' do - let(:merge_request) { create(:merge_request, description: '**please** fix', title: 'Awesome merge request', target_project: project, source_project: project) } - let(:merge_service) { MergeRequests::CreateService.new(project, user) } - let(:merge_sample_data) { merge_service.hook_data(merge_request, 'open') } - - it "calls Hipchat API for merge requests events" do - hipchat.execute(merge_sample_data) - - expect(WebMock).to have_requested(:post, api_url).once - end - - it "creates a merge request message" do - message = hipchat.send(:create_merge_request_message, - merge_sample_data) - - obj_attr = merge_sample_data[:object_attributes] - expect(message).to eq("#{user.name} opened " \ - "<a href=\"#{obj_attr[:url]}\">merge request !#{obj_attr["iid"]}</a> in " \ - "<a href=\"#{project.web_url}\">#{project_name}</a>: " \ - "<b>Awesome merge request</b>" \ - "<pre><strong>please</strong> fix</pre>") - end - end - - context "Note events" do - let(:user) { create(:user) } - let(:project) { create(:project, :repository, creator: user) } - - context 'when commit comment event triggered' do - let(:commit_note) do - create(:note_on_commit, author: user, project: project, - commit_id: project.repository.commit.id, - note: 'a comment on a commit') - end - - it "calls Hipchat API for commit comment events" do - data = Gitlab::DataBuilder::Note.build(commit_note, user) - hipchat.execute(data) - - expect(WebMock).to have_requested(:post, api_url).once - - message = hipchat.send(:create_message, data) - - obj_attr = data[:object_attributes] - commit_id = Commit.truncate_sha(data[:commit][:id]) - title = hipchat.send(:format_title, data[:commit][:message]) - - expect(message).to eq("#{user.name} commented on " \ - "<a href=\"#{obj_attr[:url]}\">commit #{commit_id}</a> in " \ - "<a href=\"#{project.web_url}\">#{project_name}</a>: " \ - "#{title}" \ - "<pre>a comment on a commit</pre>") - end - end - - context 'when merge request comment event triggered' do - let(:merge_request) do - create(:merge_request, source_project: project, - target_project: project) - end - - let(:merge_request_note) do - create(:note_on_merge_request, noteable: merge_request, - project: project, - note: "merge request **note**") - end - - it "calls Hipchat API for merge request comment events" do - data = Gitlab::DataBuilder::Note.build(merge_request_note, user) - hipchat.execute(data) - - expect(WebMock).to have_requested(:post, api_url).once - - message = hipchat.send(:create_message, data) - - obj_attr = data[:object_attributes] - merge_id = data[:merge_request]['iid'] - title = data[:merge_request]['title'] - - expect(message).to eq("#{user.name} commented on " \ - "<a href=\"#{obj_attr[:url]}\">merge request !#{merge_id}</a> in " \ - "<a href=\"#{project.web_url}\">#{project_name}</a>: " \ - "<b>#{title}</b>" \ - "<pre>merge request <strong>note</strong></pre>") - end - end - - context 'when issue comment event triggered' do - let(:issue) { create(:issue, project: project) } - let(:issue_note) do - create(:note_on_issue, noteable: issue, project: project, - note: "issue **note**") - end - - it "calls Hipchat API for issue comment events" do - data = Gitlab::DataBuilder::Note.build(issue_note, user) - hipchat.execute(data) - - message = hipchat.send(:create_message, data) - - obj_attr = data[:object_attributes] - issue_id = data[:issue]['iid'] - title = data[:issue]['title'] - - expect(message).to eq("#{user.name} commented on " \ - "<a href=\"#{obj_attr[:url]}\">issue ##{issue_id}</a> in " \ - "<a href=\"#{project.web_url}\">#{project_name}</a>: " \ - "<b>#{title}</b>" \ - "<pre>issue <strong>note</strong></pre>") - end - - context 'with confidential issue' do - before do - issue.update!(confidential: true) - end - - it 'calls Hipchat API with issue comment' do - data = Gitlab::DataBuilder::Note.build(issue_note, user) - hipchat.execute(data) - - message = hipchat.send(:create_message, data) - - expect(message).to include("<pre>issue <strong>note</strong></pre>") - end - end - end - - context 'when snippet comment event triggered' do - let(:snippet) { create(:project_snippet, project: project) } - let(:snippet_note) do - create(:note_on_project_snippet, noteable: snippet, - project: project, - note: "snippet note") - end - - it "calls Hipchat API for snippet comment events" do - data = Gitlab::DataBuilder::Note.build(snippet_note, user) - hipchat.execute(data) - - expect(WebMock).to have_requested(:post, api_url).once - - message = hipchat.send(:create_message, data) - - obj_attr = data[:object_attributes] - snippet_id = data[:snippet]['id'] - title = data[:snippet]['title'] - - expect(message).to eq("#{user.name} commented on " \ - "<a href=\"#{obj_attr[:url]}\">snippet ##{snippet_id}</a> in " \ - "<a href=\"#{project.web_url}\">#{project_name}</a>: " \ - "<b>#{title}</b>" \ - "<pre>snippet note</pre>") - end - end - end - - context 'pipeline events' do - let(:pipeline) { create(:ci_empty_pipeline, user: create(:user)) } - let(:data) { Gitlab::DataBuilder::Pipeline.build(pipeline) } - - context 'for failed' do - before do - pipeline.drop - end - - it "calls Hipchat API" do - hipchat.execute(data) - - expect(WebMock).to have_requested(:post, api_url).once - end - - it "creates a build message" do - message = hipchat.__send__(:create_pipeline_message, data) - - project_url = project.web_url - project_name = project.full_name.gsub(/\s/, '') - pipeline_attributes = data[:object_attributes] - ref = pipeline_attributes[:ref] - ref_type = pipeline_attributes[:tag] ? 'tag' : 'branch' - duration = pipeline_attributes[:duration] - user_name = data[:user][:name] - - expect(message).to eq("<a href=\"#{project_url}\">#{project_name}</a>: " \ - "Pipeline <a href=\"#{project_url}/pipelines/#{pipeline.id}\">##{pipeline.id}</a> " \ - "of <a href=\"#{project_url}/commits/#{ref}\">#{ref}</a> #{ref_type} " \ - "by #{user_name} failed in #{duration} second(s)") - end - end - - context 'for succeeded' do - before do - pipeline.succeed - end - - it "calls Hipchat API" do - hipchat.notify_only_broken_pipelines = false - hipchat.execute(data) - expect(WebMock).to have_requested(:post, api_url).once - end - - it "notifies only broken" do - hipchat.notify_only_broken_pipelines = true - hipchat.execute(data) - expect(WebMock).not_to have_requested(:post, api_url).once - end - end - end - - context "#message_options" do - it "is set to the defaults" do - expect(hipchat.__send__(:message_options)).to eq({ notify: false, color: 'yellow' }) - end - - it "sets notify to true" do - allow(hipchat).to receive(:notify).and_return('1') - - expect(hipchat.__send__(:message_options)).to eq({ notify: true, color: 'yellow' }) - end - - it "sets the color" do - allow(hipchat).to receive(:color).and_return('red') - - expect(hipchat.__send__(:message_options)).to eq({ notify: false, color: 'red' }) - end - - context 'with a successful build' do - it 'uses the green color' do - data = { object_kind: 'pipeline', - object_attributes: { status: 'success' } } - - expect(hipchat.__send__(:message_options, data)).to eq({ notify: false, color: 'green' }) - end - end - - context 'with a failed build' do - it 'uses the red color' do - data = { object_kind: 'pipeline', - object_attributes: { status: 'failed' } } - - expect(hipchat.__send__(:message_options, data)).to eq({ notify: false, color: 'red' }) - end - end - end - end - - context 'with UrlBlocker' do - let(:user) { create(:user) } - let(:project) { create(:project, :repository) } - let(:hipchat) { described_class.new(project: project) } - let(:push_sample_data) { Gitlab::DataBuilder::Push.build_sample(project, user) } - - describe '#execute' do - before do - hipchat.server = 'http://localhost:9123' - end - - it 'raises UrlBlocker for localhost' do - expect(Gitlab::UrlBlocker).to receive(:validate!).and_call_original - expect { hipchat.execute(push_sample_data) }.to raise_error(Gitlab::HTTP::BlockedUrlError) - end - end - end -end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index ac9362339e5..7b364395faf 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -41,7 +41,6 @@ describe Project do it { is_expected.to have_one(:pipelines_email_service) } it { is_expected.to have_one(:irker_service) } it { is_expected.to have_one(:pivotaltracker_service) } - it { is_expected.to have_one(:hipchat_service) } it { is_expected.to have_one(:flowdock_service) } it { is_expected.to have_one(:assembla_service) } it { is_expected.to have_one(:slack_slash_commands_service) } diff --git a/vendor/licenses.csv b/vendor/licenses.csv index d706d76358a..ed79ec5bac3 100644 --- a/vendor/licenses.csv +++ b/vendor/licenses.csv @@ -520,7 +520,6 @@ hashie-forbidden_attributes,0.1.1,MIT he,1.1.1,MIT health_check,2.6.0,MIT highlight.js,9.13.1,New BSD -hipchat,1.5.2,MIT hmac-drbg,1.0.1,MIT hoopy,0.1.4,MIT html-pipeline,2.8.4,MIT |