Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-01 18:08:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-01 18:08:30 +0300
commita0fdcfcdd514c2af98f18cadfa75f8a6a85b4d2c (patch)
treeecba106fd4d1426cc2109a6ba3da091be2de1f87 /doc
parent2828f81d2a41f46b89e13dc057b982f27aeee547 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r--doc/administration/geo/disaster_recovery/planned_failover.md4
-rw-r--r--doc/administration/geo/setup/index.md4
-rw-r--r--doc/administration/object_storage.md6
-rw-r--r--doc/administration/operations/moving_repositories.md4
-rw-r--r--doc/administration/reference_architectures/10k_users.md2
-rw-r--r--doc/administration/reference_architectures/25k_users.md2
-rw-r--r--doc/administration/reference_architectures/2k_users.md2
-rw-r--r--doc/administration/reference_architectures/3k_users.md2
-rw-r--r--doc/administration/reference_architectures/50k_users.md2
-rw-r--r--doc/administration/reference_architectures/5k_users.md2
-rw-r--r--doc/administration/reference_architectures/index.md2
-rw-r--r--doc/administration/reference_architectures/troubleshooting.md2
-rw-r--r--doc/api/integrations.md1
-rw-r--r--doc/ci/cloud_deployment/ecs/deploy_to_aws_ecs.md6
-rw-r--r--doc/development/testing_guide/end_to_end/resources.md10
-rw-r--r--doc/install/aws/manual_install_aws.md8
-rw-r--r--doc/raketasks/backup_gitlab.md908
-rw-r--r--doc/raketasks/backup_restore.md1265
-rw-r--r--doc/raketasks/restore_gitlab.md367
-rw-r--r--doc/update/package/downgrade.md2
-rw-r--r--doc/update/plan_your_upgrade.md4
-rw-r--r--doc/user/admin_area/settings/incident_management_rate_limits.md4
-rw-r--r--doc/user/analytics/index.md6
-rw-r--r--doc/user/application_security/index.md2
-rw-r--r--doc/user/group/value_stream_analytics/index.md2
-rw-r--r--doc/user/project/merge_requests/img/attention_request_list_v14_10.pngbin11932 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/img/attention_request_sidebar_v14_10.pngbin20471 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/index.md47
-rw-r--r--doc/user/project/merge_requests/reviews/index.md6
-rw-r--r--doc/user/project/quick_actions.md1
30 files changed, 1320 insertions, 1353 deletions
diff --git a/doc/administration/geo/disaster_recovery/planned_failover.md b/doc/administration/geo/disaster_recovery/planned_failover.md
index c351b4031b5..5a5d896c20a 100644
--- a/doc/administration/geo/disaster_recovery/planned_failover.md
+++ b/doc/administration/geo/disaster_recovery/planned_failover.md
@@ -60,8 +60,8 @@ Alternatively, you can [back up](../../../raketasks/backup_restore.md#back-up-gi
the container registry on the primary site and restore it onto the secondary
site:
-1. On your primary site, back up only the registry and [exclude specific directories
-from the backup](../../../raketasks/backup_restore.md#excluding-specific-directories-from-the-backup):
+1. On your primary site, back up only the registry and
+ [exclude specific directories from the backup](../../../raketasks/backup_gitlab.md#excluding-specific-directories-from-the-backup):
```shell
# Create a backup in the /var/opt/gitlab/backups folder
diff --git a/doc/administration/geo/setup/index.md b/doc/administration/geo/setup/index.md
index f7d47d82e71..5ddfee6774e 100644
--- a/doc/administration/geo/setup/index.md
+++ b/doc/administration/geo/setup/index.md
@@ -16,13 +16,13 @@ You must use a [GitLab Premium](https://about.gitlab.com/pricing/) license or hi
but you only need one license for all the sites.
WARNING:
-The steps below should be followed in the order they appear. **Make sure the GitLab version is the same on all sites.**
+The steps below should be followed in the order they appear. **Make sure the GitLab version is the same on all sites. Do not create an account or log in to the new secondary.**
## Using Omnibus GitLab
If you installed GitLab using the Omnibus packages (highly recommended):
-1. [Install GitLab Enterprise Edition](https://about.gitlab.com/install/) on the nodes that serve as the **secondary** site. Do not create an account or log in to the new **secondary** site. The **GitLab version must match** across primary and secondary sites.
+1. [Install GitLab Enterprise Edition](https://about.gitlab.com/install/) on the nodes that serve as the **secondary** site. **Do not create an account or log in** to the new **secondary** site. The **GitLab version must match** across primary and secondary sites.
1. [Add the GitLab License](../../../user/admin_area/license.md) on the **primary** site to unlock Geo. The license must be for [GitLab Premium](https://about.gitlab.com/pricing/) or higher.
1. [Set up the database replication](database.md) (`primary (read-write) <-> secondary (read-only)` topology).
1. [Configure fast lookup of authorized SSH keys in the database](../../operations/fast_ssh_key_lookup.md). This step is required and needs to be done on **both** the **primary** and **secondary** sites.
diff --git a/doc/administration/object_storage.md b/doc/administration/object_storage.md
index 5e54835c670..ddeaf0280eb 100644
--- a/doc/administration/object_storage.md
+++ b/doc/administration/object_storage.md
@@ -76,7 +76,7 @@ because it does not require a shared folder.
Consolidated object storage configuration can't be used for backups or
Mattermost. See the [full table for a complete list](#storage-specific-configuration).
-However, backups can be configured with [server side encryption](../raketasks/backup_restore.md#s3-encrypted-buckets) separately.
+However, backups can be configured with [server side encryption](../raketasks/backup_gitlab.md#s3-encrypted-buckets) separately.
Enabling consolidated object storage enables object storage for all object
types. If not all buckets are specified, `sudo gitlab-ctl reconfigure` may fail with the error like:
@@ -528,7 +528,7 @@ supported by consolidated configuration form, refer to the following guides:
| Object storage type | Supported by consolidated configuration? |
|---------------------|------------------------------------------|
-| [Backups](../raketasks/backup_restore.md#uploading-backups-to-a-remote-cloud-storage) | **{dotted-circle}** No |
+| [Backups](../raketasks/backup_gitlab.md#uploading-backups-to-a-remote-cloud-storage) | **{dotted-circle}** No |
| [Job artifacts](job_artifacts.md#using-object-storage) including archived job logs | **{check-circle}** Yes |
| [LFS objects](lfs/index.md#storing-lfs-objects-in-remote-object-storage) | **{check-circle}** Yes |
| [Uploads](uploads.md#using-object-storage) | **{check-circle}** Yes |
@@ -587,7 +587,7 @@ Helm-based installs require separate buckets to
### S3 API compatibility issues
-Not all S3 providers [are fully compatible](../raketasks/backup_restore.md#other-s3-providers)
+Not all S3 providers [are fully compatible](../raketasks/backup_gitlab.md#other-s3-providers)
with the Fog library that GitLab uses. Symptoms include an error in `production.log`:
```plaintext
diff --git a/doc/administration/operations/moving_repositories.md b/doc/administration/operations/moving_repositories.md
index 1de04978958..8d36a40663f 100644
--- a/doc/administration/operations/moving_repositories.md
+++ b/doc/administration/operations/moving_repositories.md
@@ -189,9 +189,9 @@ should be used. Git repositories are accessed, managed, and stored on GitLab ser
can result from directly accessing and copying Gitaly's files using tools like `rsync`.
- From GitLab 13.3, backup performance can be improved by
- [processing multiple repositories concurrently](../../raketasks/backup_restore.md#back-up-git-repositories-concurrently).
+ [processing multiple repositories concurrently](../../raketasks/backup_gitlab.md#back-up-git-repositories-concurrently).
- Backups can be created of just the repositories using the
- [skip feature](../../raketasks/backup_restore.md#excluding-specific-directories-from-the-backup).
+ [skip feature](../../raketasks/backup_gitlab.md#excluding-specific-directories-from-the-backup).
No other method works for Gitaly Cluster targets.
diff --git a/doc/administration/reference_architectures/10k_users.md b/doc/administration/reference_architectures/10k_users.md
index 99272cdd226..7901fcaf78d 100644
--- a/doc/administration/reference_architectures/10k_users.md
+++ b/doc/administration/reference_architectures/10k_users.md
@@ -2202,7 +2202,7 @@ on what features you intend to use:
|Object storage type|Supported by consolidated configuration?|
|-------------------|----------------------------------------|
-| [Backups](../../raketasks/backup_restore.md#uploading-backups-to-a-remote-cloud-storage) | No |
+| [Backups](../../raketasks/backup_gitlab.md#uploading-backups-to-a-remote-cloud-storage) | No |
| [Job artifacts](../job_artifacts.md#using-object-storage) including archived job logs | Yes |
| [LFS objects](../lfs/index.md#storing-lfs-objects-in-remote-object-storage) | Yes |
| [Uploads](../uploads.md#using-object-storage) | Yes |
diff --git a/doc/administration/reference_architectures/25k_users.md b/doc/administration/reference_architectures/25k_users.md
index 367654b8e59..3ebe37efe4e 100644
--- a/doc/administration/reference_architectures/25k_users.md
+++ b/doc/administration/reference_architectures/25k_users.md
@@ -2206,7 +2206,7 @@ on what features you intend to use:
|Object storage type|Supported by consolidated configuration?|
|-------------------|----------------------------------------|
-| [Backups](../../raketasks/backup_restore.md#uploading-backups-to-a-remote-cloud-storage) | No |
+| [Backups](../../raketasks/backup_gitlab.md#uploading-backups-to-a-remote-cloud-storage) | No |
| [Job artifacts](../job_artifacts.md#using-object-storage) including archived job logs | Yes |
| [LFS objects](../lfs/index.md#storing-lfs-objects-in-remote-object-storage) | Yes |
| [Uploads](../uploads.md#using-object-storage) | Yes |
diff --git a/doc/administration/reference_architectures/2k_users.md b/doc/administration/reference_architectures/2k_users.md
index 3b9a8f966c8..30af94cd745 100644
--- a/doc/administration/reference_architectures/2k_users.md
+++ b/doc/administration/reference_architectures/2k_users.md
@@ -916,7 +916,7 @@ on what features you intend to use:
|Object storage type|Supported by consolidated configuration?|
|-------------------|----------------------------------------|
-| [Backups](../../raketasks/backup_restore.md#uploading-backups-to-a-remote-cloud-storage) | No |
+| [Backups](../../raketasks/backup_gitlab.md#uploading-backups-to-a-remote-cloud-storage) | No |
| [Job artifacts](../job_artifacts.md#using-object-storage) including archived job logs | Yes |
| [LFS objects](../lfs/index.md#storing-lfs-objects-in-remote-object-storage) | Yes |
| [Uploads](../uploads.md#using-object-storage) | Yes |
diff --git a/doc/administration/reference_architectures/3k_users.md b/doc/administration/reference_architectures/3k_users.md
index a43d33a4d4a..0dbeb480ed0 100644
--- a/doc/administration/reference_architectures/3k_users.md
+++ b/doc/administration/reference_architectures/3k_users.md
@@ -2141,7 +2141,7 @@ on what features you intend to use:
|Object storage type|Supported by consolidated configuration?|
|-------------------|----------------------------------------|
-| [Backups](../../raketasks/backup_restore.md#uploading-backups-to-a-remote-cloud-storage) | No |
+| [Backups](../../raketasks/backup_gitlab.md#uploading-backups-to-a-remote-cloud-storage) | No |
| [Job artifacts](../job_artifacts.md#using-object-storage) including archived job logs | Yes |
| [LFS objects](../lfs/index.md#storing-lfs-objects-in-remote-object-storage) | Yes |
| [Uploads](../uploads.md#using-object-storage) | Yes |
diff --git a/doc/administration/reference_architectures/50k_users.md b/doc/administration/reference_architectures/50k_users.md
index 316969dfacc..ac41a6fbf53 100644
--- a/doc/administration/reference_architectures/50k_users.md
+++ b/doc/administration/reference_architectures/50k_users.md
@@ -2222,7 +2222,7 @@ on what features you intend to use:
|Object storage type|Supported by consolidated configuration?|
|-------------------|----------------------------------------|
-| [Backups](../../raketasks/backup_restore.md#uploading-backups-to-a-remote-cloud-storage) | No |
+| [Backups](../../raketasks/backup_gitlab.md#uploading-backups-to-a-remote-cloud-storage) | No |
| [Job artifacts](../job_artifacts.md#using-object-storage) including archived job logs | Yes |
| [LFS objects](../lfs/index.md#storing-lfs-objects-in-remote-object-storage) | Yes |
| [Uploads](../uploads.md#using-object-storage) | Yes |
diff --git a/doc/administration/reference_architectures/5k_users.md b/doc/administration/reference_architectures/5k_users.md
index fda539a3989..2751443ca65 100644
--- a/doc/administration/reference_architectures/5k_users.md
+++ b/doc/administration/reference_architectures/5k_users.md
@@ -2141,7 +2141,7 @@ on what features you intend to use:
|Object storage type|Supported by consolidated configuration?|
|-------------------|----------------------------------------|
-| [Backups](../../raketasks/backup_restore.md#uploading-backups-to-a-remote-cloud-storage) | No |
+| [Backups](../../raketasks/backup_gitlab.md#uploading-backups-to-a-remote-cloud-storage) | No |
| [Job artifacts](../job_artifacts.md#using-object-storage) including archived job logs | Yes |
| [LFS objects](../lfs/index.md#storing-lfs-objects-in-remote-object-storage) | Yes |
| [Uploads](../uploads.md#using-object-storage) | Yes |
diff --git a/doc/administration/reference_architectures/index.md b/doc/administration/reference_architectures/index.md
index e56c5ba1277..aa11d2a8866 100644
--- a/doc/administration/reference_architectures/index.md
+++ b/doc/administration/reference_architectures/index.md
@@ -401,7 +401,7 @@ have more actual perceived uptime for your users.
This solution is appropriate for many teams that have the default GitLab installation.
With automatic backups of the GitLab repositories, configuration, and the database,
this can be an optimal solution if you don't have strict requirements.
-[Automated backups](../../raketasks/backup_restore.md#configuring-cron-to-make-daily-backups)
+[Automated backups](../../raketasks/backup_gitlab.md#configuring-cron-to-make-daily-backups)
is the least complex to setup. This provides a point-in-time recovery of a predetermined schedule.
### Traffic load balancer **(PREMIUM SELF)**
diff --git a/doc/administration/reference_architectures/troubleshooting.md b/doc/administration/reference_architectures/troubleshooting.md
index 2d10d05da37..ce14e0f96ef 100644
--- a/doc/administration/reference_architectures/troubleshooting.md
+++ b/doc/administration/reference_architectures/troubleshooting.md
@@ -13,7 +13,7 @@ the [reference architectures](index.md#reference-architectures).
### S3 API compatibility issues
-Not all S3 providers [are fully compatible](../../raketasks/backup_restore.md#other-s3-providers)
+Not all S3 providers [are fully compatible](../../raketasks/backup_gitlab.md#other-s3-providers)
with the Fog library that GitLab uses. Symptoms include:
```plaintext
diff --git a/doc/api/integrations.md b/doc/api/integrations.md
index eaa826b3686..fca1d02161b 100644
--- a/doc/api/integrations.md
+++ b/doc/api/integrations.md
@@ -1033,7 +1033,6 @@ Parameters:
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `recipients` | string | yes | Comma-separated list of recipient email addresses |
-| `add_pusher` | boolean | no | Add pusher to recipients list |
| `notify_only_broken_pipelines` | boolean | no | Notify only broken pipelines |
| `branches_to_be_notified` | string | false | Branches to send notifications for. Valid options are "all", "default", "protected", and "default_and_protected. The default value is "default" |
| `notify_only_default_branch` | boolean | no | Send notifications only for the default branch ([introduced in GitLab 12.0](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/28271)) |
diff --git a/doc/ci/cloud_deployment/ecs/deploy_to_aws_ecs.md b/doc/ci/cloud_deployment/ecs/deploy_to_aws_ecs.md
index 5894efa95ab..aea7b492d4e 100644
--- a/doc/ci/cloud_deployment/ecs/deploy_to_aws_ecs.md
+++ b/doc/ci/cloud_deployment/ecs/deploy_to_aws_ecs.md
@@ -252,7 +252,7 @@ To use [Review Apps](../../../development/testing_guide/review_apps.md) with ECS
1. Set up a new [service](#create-an-ecs-service).
1. Use the `CI_AWS_ECS_SERVICE` variable to set the name.
-1. Set the environment scope to `review/*`.
+1. Set the environment scope to `review/*`.
Only one Review App at a time can be deployed because this service is shared by all review apps.
@@ -282,9 +282,9 @@ include:
To use DAST on the default branch:
1. Set up a new [service](#create-an-ecs-service). This service will be used to deploy a temporary
-DAST environment.
+DAST environment.
1. Use the `CI_AWS_ECS_SERVICE` variable to set the name.
-1. Set the scope to the `dast-default` environment.
+1. Set the scope to the `dast-default` environment.
1. Add the following to your `.gitlab-ci.yml` file:
```yaml
diff --git a/doc/development/testing_guide/end_to_end/resources.md b/doc/development/testing_guide/end_to_end/resources.md
index a7626d372a8..a519d1ecb47 100644
--- a/doc/development/testing_guide/end_to_end/resources.md
+++ b/doc/development/testing_guide/end_to_end/resources.md
@@ -570,12 +570,12 @@ end
### Resources cleanup
-We have a mechanism to [collect](https://gitlab.com/gitlab-org/gitlab/-/blob/44345381e89d6bbd440f7b4c680d03e8b75b86de/qa/qa/tools/test_resource_data_processor.rb#L32)
-all resources created during test executions, and another to [handle](https://gitlab.com/gitlab-org/gitlab/-/blob/44345381e89d6bbd440f7b4c680d03e8b75b86de/qa/qa/tools/test_resources_handler.rb#L44)
-these resources. On [dotcom environments](https://about.gitlab.com/handbook/engineering/infrastructure/environments/#environments), after a test suite finishes in the [QA pipelines](https://about.gitlab.com/handbook/engineering/quality/quality-engineering/debugging-qa-test-failures/#scheduled-qa-test-pipelines), resources from all passing test are
-automatically deleted in the same pipeline run. Resources from all failed tests are reserved for investigation,
+We have a mechanism to [collect](https://gitlab.com/gitlab-org/gitlab/-/blob/44345381e89d6bbd440f7b4c680d03e8b75b86de/qa/qa/tools/test_resource_data_processor.rb#L32)
+all resources created during test executions, and another to [handle](https://gitlab.com/gitlab-org/gitlab/-/blob/44345381e89d6bbd440f7b4c680d03e8b75b86de/qa/qa/tools/test_resources_handler.rb#L44)
+these resources. On [dotcom environments](https://about.gitlab.com/handbook/engineering/infrastructure/environments/#environments), after a test suite finishes in the [QA pipelines](https://about.gitlab.com/handbook/engineering/quality/quality-engineering/debugging-qa-test-failures/#scheduled-qa-test-pipelines), resources from all passing test are
+automatically deleted in the same pipeline run. Resources from all failed tests are reserved for investigation,
and won't be deleted until the following Saturday by a scheduled pipeline. When introducing new resources, please
-also make sure to add any resource that cannot be deleted to the [IGNORED_RESOURCES](https://gitlab.com/gitlab-org/gitlab/-/blob/44345381e89d6bbd440f7b4c680d03e8b75b86de/qa/qa/tools/test_resources_handler.rb#L29)
+also make sure to add any resource that cannot be deleted to the [IGNORED_RESOURCES](https://gitlab.com/gitlab-org/gitlab/-/blob/44345381e89d6bbd440f7b4c680d03e8b75b86de/qa/qa/tools/test_resources_handler.rb#L29)
list.
## Where to ask for help?
diff --git a/doc/install/aws/manual_install_aws.md b/doc/install/aws/manual_install_aws.md
index 060bd08580f..7494dc1e95e 100644
--- a/doc/install/aws/manual_install_aws.md
+++ b/doc/install/aws/manual_install_aws.md
@@ -754,10 +754,10 @@ and restore its Git data, database, attachments, LFS objects, and so on.
Some important things to know:
- The backup/restore tool **does not** store some configuration files, like secrets; you
- must [configure this yourself](../../raketasks/backup_restore.md#storing-configuration-files).
+ must [configure this yourself](../../raketasks/backup_gitlab.md#storing-configuration-files).
- By default, the backup files are stored locally, but you can
- [backup GitLab using S3](../../raketasks/backup_restore.md#using-amazon-s3).
-- You can [exclude specific directories form the backup](../../raketasks/backup_restore.md#excluding-specific-directories-from-the-backup).
+ [backup GitLab using S3](../../raketasks/backup_gitlab.md#using-amazon-s3).
+- You can [exclude specific directories form the backup](../../raketasks/backup_gitlab.md#excluding-specific-directories-from-the-backup).
### Backing up GitLab
@@ -777,7 +777,7 @@ For GitLab 12.1 and earlier, use `gitlab-rake gitlab:backup:create`.
To restore GitLab, first review the [restore documentation](../../raketasks/backup_restore.md#restore-gitlab),
and primarily the restore prerequisites. Then, follow the steps under the
-[Omnibus installations section](../../raketasks/backup_restore.md#restore-for-omnibus-gitlab-installations).
+[Omnibus installations section](../../raketasks/restore_gitlab.md#restore-for-omnibus-gitlab-installations).
## Updating GitLab
diff --git a/doc/raketasks/backup_gitlab.md b/doc/raketasks/backup_gitlab.md
new file mode 100644
index 00000000000..8d5ae14a043
--- /dev/null
+++ b/doc/raketasks/backup_gitlab.md
@@ -0,0 +1,908 @@
+---
+stage: Systems
+group: Geo
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
+---
+
+# Back up GitLab
+
+GitLab provides a command line interface to back up your entire instance,
+including:
+
+- Database
+- Attachments
+- Git repositories data
+- CI/CD job output logs
+- CI/CD job artifacts
+- LFS objects
+- Terraform states ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/331806) in GitLab 14.7)
+- Container Registry images
+- GitLab Pages content
+- Packages ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/332006) in GitLab 14.7)
+- Snippets
+- [Group wikis](../user/project/wiki/group.md)
+
+Backups do not include:
+
+- [Mattermost data](https://docs.mattermost.com/administration/config-settings.html#file-storage)
+- Redis (and thus Sidekiq jobs)
+
+WARNING:
+GitLab does not back up any configuration files (`/etc/gitlab`), TLS keys and certificates, or system
+files. You are highly advised to read about [storing configuration files](#storing-configuration-files).
+
+WARNING:
+The backup command requires [additional parameters](backup_restore.md#back-up-and-restore-for-installations-using-pgbouncer) when
+your installation is using PgBouncer, for either performance reasons or when using it with a Patroni cluster.
+
+Depending on your version of GitLab, use the following command if you installed
+GitLab using the Omnibus package:
+
+- GitLab 12.2 or later:
+
+ ```shell
+ sudo gitlab-backup create
+ ```
+
+- GitLab 12.1 and earlier:
+
+ ```shell
+ gitlab-rake gitlab:backup:create
+ ```
+
+If you installed GitLab from source, use the following command:
+
+```shell
+sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
+```
+
+If you're running GitLab from within a Docker container, run the backup from
+the host, based on your installed version of GitLab:
+
+- GitLab 12.2 or later:
+
+ ```shell
+ docker exec -t <container name> gitlab-backup create
+ ```
+
+- GitLab 12.1 and earlier:
+
+ ```shell
+ docker exec -t <container name> gitlab-rake gitlab:backup:create
+ ```
+
+If you're using the [GitLab Helm chart](https://gitlab.com/gitlab-org/charts/gitlab)
+on a Kubernetes cluster, you can run the backup task by using `kubectl` to run the `backup-utility`
+script on the GitLab toolbox pod. For more details, see the
+[charts backup documentation](https://docs.gitlab.com/charts/backup-restore/backup.html).
+
+Similar to the Kubernetes case, if you have scaled out your GitLab cluster to
+use multiple application servers, you should pick a designated node (that isn't
+auto-scaled away) for running the backup Rake task. Because the backup Rake
+task is tightly coupled to the main Rails application, this is typically a node
+on which you're also running Puma or Sidekiq.
+
+Example output:
+
+```plaintext
+Dumping database tables:
+- Dumping table events... [DONE]
+- Dumping table issues... [DONE]
+- Dumping table keys... [DONE]
+- Dumping table merge_requests... [DONE]
+- Dumping table milestones... [DONE]
+- Dumping table namespaces... [DONE]
+- Dumping table notes... [DONE]
+- Dumping table projects... [DONE]
+- Dumping table protected_branches... [DONE]
+- Dumping table schema_migrations... [DONE]
+- Dumping table services... [DONE]
+- Dumping table snippets... [DONE]
+- Dumping table taggings... [DONE]
+- Dumping table tags... [DONE]
+- Dumping table users... [DONE]
+- Dumping table users_projects... [DONE]
+- Dumping table web_hooks... [DONE]
+- Dumping table wikis... [DONE]
+Dumping repositories:
+- Dumping repository abcd... [DONE]
+Creating backup archive: $TIMESTAMP_gitlab_backup.tar [DONE]
+Deleting tmp directories...[DONE]
+Deleting old backups... [SKIPPING]
+```
+
+## Storing configuration files
+
+The [backup Rake task](#back-up-gitlab) GitLab provides does _not_ store your
+configuration files. The primary reason for this is that your database contains
+items including encrypted information for two-factor authentication and the
+CI/CD _secure variables_. Storing encrypted information in the same location
+as its key defeats the purpose of using encryption in the first place.
+
+WARNING:
+The secrets file is essential to preserve your database encryption key.
+
+At the very **minimum**, you must back up:
+
+For Omnibus:
+
+- `/etc/gitlab/gitlab-secrets.json`
+- `/etc/gitlab/gitlab.rb`
+
+For installation from source:
+
+- `/home/git/gitlab/config/secrets.yml`
+- `/home/git/gitlab/config/gitlab.yml`
+
+For [Docker installations](https://docs.gitlab.com/omnibus/docker/), you must
+back up the volume where the configuration files are stored. If you created
+the GitLab container according to the documentation, it should be in the
+`/srv/gitlab/config` directory.
+
+For [GitLab Helm chart installations](https://gitlab.com/gitlab-org/charts/gitlab)
+on a Kubernetes cluster, you must follow the
+[Back up the secrets](https://docs.gitlab.com/charts/backup-restore/backup.html#backup-the-secrets)
+instructions.
+
+You may also want to back up any TLS keys and certificates (`/etc/gitlab/ssl`, `/etc/gitlab/trusted-certs`), and your
+[SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079)
+to avoid man-in-the-middle attack warnings if you have to perform a full machine restore.
+
+If you use Omnibus GitLab, review additional information to
+[backup your configuration](https://docs.gitlab.com/omnibus/settings/backups.html).
+
+In the unlikely event that the secrets file is lost, see the
+[troubleshooting section](backup_restore.md#when-the-secrets-file-is-lost).
+
+## Backup options
+
+The command line tool GitLab provides to backup your instance can accept more
+options.
+
+### Backup strategy option
+
+The default backup strategy is to essentially stream data from the respective
+data locations to the backup using the Linux command `tar` and `gzip`. This works
+fine in most cases, but can cause problems when data is rapidly changing.
+
+When data changes while `tar` is reading it, the error `file changed as we read
+it` may occur, and causes the backup process to fail. To combat this, 8.17
+introduces a new backup strategy called `copy`. The strategy copies data files
+to a temporary location before calling `tar` and `gzip`, avoiding the error.
+
+A side-effect is that the backup process takes up to an additional 1X disk
+space. The process does its best to clean up the temporary files at each stage
+so the problem doesn't compound, but it could be a considerable change for large
+installations. This is why the `copy` strategy is not the default in 8.17.
+
+To use the `copy` strategy instead of the default streaming strategy, specify
+`STRATEGY=copy` in the Rake task command. For example:
+
+```shell
+sudo gitlab-backup create STRATEGY=copy
+```
+
+Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
+
+### Backup filename
+
+WARNING:
+If you use a custom backup filename, you can't
+[limit the lifetime of the backups](#limit-backup-lifetime-for-local-files-prune-old-backups).
+
+By default, a backup file is created according to the specification in the
+previous [Backup timestamp](backup_restore.md#backup-timestamp) section. You can, however,
+override the `[TIMESTAMP]` portion of the filename by setting the `BACKUP`
+environment variable. For example:
+
+```shell
+sudo gitlab-backup create BACKUP=dump
+```
+
+Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
+
+The resulting file is named `dump_gitlab_backup.tar`. This is useful for
+systems that make use of rsync and incremental backups, and results in
+considerably faster transfer speeds.
+
+### Confirm archive can be transferred
+
+To ensure the generated archive is transferable by rsync, you can set the `GZIP_RSYNCABLE=yes`
+option. This sets the `--rsyncable` option to `gzip`, which is useful only in
+combination with setting [the Backup filename option](#backup-filename).
+
+Note that the `--rsyncable` option in `gzip` isn't guaranteed to be available
+on all distributions. To verify that it's available in your distribution, run
+`gzip --help` or consult the man pages.
+
+```shell
+sudo gitlab-backup create BACKUP=dump GZIP_RSYNCABLE=yes
+```
+
+Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
+
+### Excluding specific directories from the backup
+
+You can exclude specific directories from the backup by adding the environment variable `SKIP`, whose values are a comma-separated list of the following options:
+
+- `db` (database)
+- `uploads` (attachments)
+- `builds` (CI job output logs)
+- `artifacts` (CI job artifacts)
+- `lfs` (LFS objects)
+- `terraform_state` (Terraform states)
+- `registry` (Container Registry images)
+- `pages` (Pages content)
+- `repositories` (Git repositories data)
+- `packages` (Packages)
+
+All wikis are backed up as part of the `repositories` group. Non-existent wikis are skipped during a backup.
+
+NOTE:
+When [backing up and restoring Helm Charts](https://docs.gitlab.com/charts/architecture/backup-restore.html), there is an additional option `packages`, which refers to any packages managed by the GitLab [package registry](../user/packages/package_registry/index.md).
+For more information see [command line arguments](https://docs.gitlab.com/charts/architecture/backup-restore.html#command-line-arguments).
+
+All wikis are backed up as part of the `repositories` group. Non-existent
+wikis are skipped during a backup.
+
+For Omnibus GitLab packages:
+
+```shell
+sudo gitlab-backup create SKIP=db,uploads
+```
+
+Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
+
+For installations from source:
+
+```shell
+sudo -u git -H bundle exec rake gitlab:backup:create SKIP=db,uploads RAILS_ENV=production
+```
+
+### Skipping tar creation
+
+NOTE:
+It is not possible to skip the tar creation when using [object storage](#uploading-backups-to-a-remote-cloud-storage) for backups.
+
+The last part of creating a backup is generation of a `.tar` file containing
+all the parts. In some cases (for example, if the backup is picked up by other
+backup software) creating a `.tar` file might be wasted effort or even directly
+harmful, so you can skip this step by adding `tar` to the `SKIP` environment
+variable.
+
+Adding `tar` to the `SKIP` variable leaves the files and directories containing the
+backup in the directory used for the intermediate files. These files are
+overwritten when a new backup is created, so you should make sure they are copied
+elsewhere, because you can only have one backup on the system.
+
+For Omnibus GitLab packages:
+
+```shell
+sudo gitlab-backup create SKIP=tar
+```
+
+For installations from source:
+
+```shell
+sudo -u git -H bundle exec rake gitlab:backup:create SKIP=tar RAILS_ENV=production
+```
+
+### Back up Git repositories concurrently
+
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37158) in GitLab 13.3.
+> - [Concurrent restore introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69330) in GitLab 14.3
+
+When using [multiple repository storages](../administration/repository_storage_paths.md),
+repositories can be backed up or restored concurrently to help fully use CPU time. The
+following variables are available to modify the default behavior of the Rake
+task:
+
+- `GITLAB_BACKUP_MAX_CONCURRENCY`: The maximum number of projects to back up at
+ the same time. Defaults to the number of logical CPUs (in GitLab 14.1 and
+ earlier, defaults to `1`).
+- `GITLAB_BACKUP_MAX_STORAGE_CONCURRENCY`: The maximum number of projects to
+ back up at the same time on each storage. This allows the repository backups
+ to be spread across storages. Defaults to `2` (in GitLab 14.1 and earlier,
+ defaults to `1`).
+
+For example, for Omnibus GitLab installations with 4 repository storages:
+
+```shell
+sudo gitlab-backup create GITLAB_BACKUP_MAX_CONCURRENCY=4 GITLAB_BACKUP_MAX_STORAGE_CONCURRENCY=1
+```
+
+For example, for installations from source:
+
+```shell
+sudo -u git -H bundle exec rake gitlab:backup:create GITLAB_BACKUP_MAX_CONCURRENCY=4 GITLAB_BACKUP_MAX_STORAGE_CONCURRENCY=1
+```
+
+### Incremental repository backups
+
+> - Introduced in GitLab 14.9 [with a flag](../administration/feature_flags.md) named `incremental_repository_backup`. Disabled by default.
+> - [Enabled on self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/355945) in GitLab 14.10.
+> - `PREVIOUS_BACKUP` option [introduced](https://gitlab.com/gitlab-org/gitaly/-/issues/4184) in GitLab 15.0.
+
+FLAG:
+On self-managed GitLab, by default this feature is available. To hide the feature, ask an administrator to [disable the feature flag](../administration/feature_flags.md) named `incremental_repository_backup`.
+On GitLab.com, this feature is not available.
+
+Incremental backups can be faster than full backups because they only pack changes since the last backup into the backup
+bundle for each repository. There must be an existing backup to create an incremental backup from:
+
+- In GitLab 14.9 and 14.10, use the `BACKUP=<timestamp_of_backup>` option to choose the backup to use. The chosen previous backup is overwritten.
+- In GitLab 15.0 and later, use the `PREVIOUS_BACKUP=<timestamp_of_backup>` option to choose the backup to use. By default, a backup file is created
+ as documented in the [Backup timestamp](backup_restore.md#backup-timestamp) section. You can override the `[TIMESTAMP]` portion of the filename by setting the
+ [`BACKUP` environment variable](#backup-filename).
+
+To create an incremental backup, run:
+
+```shell
+sudo gitlab-backup create INCREMENTAL=yes PREVIOUS_BACKUP=<timestamp_of_backup>
+```
+
+Incremental backups can also be created from [an untarred backup](#skipping-tar-creation) by using `SKIP=tar`:
+
+```shell
+sudo gitlab-backup create INCREMENTAL=yes SKIP=tar
+```
+
+### Back up specific repository storages
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86896) in GitLab 15.0.
+
+When using [multiple repository storages](../administration/repository_storage_paths.md),
+repositories from specific repository storages can be backed up separately
+using the `REPOSITORIES_STORAGES` option. The option accepts a comma-separated list of
+storage names.
+
+For example, for Omnibus GitLab installations:
+
+```shell
+sudo gitlab-backup create REPOSITORIES_STORAGES=storage1,storage2
+```
+
+For example, for installations from source:
+
+```shell
+sudo -u git -H bundle exec rake gitlab:backup:create REPOSITORIES_STORAGES=storage1,storage2
+```
+
+### Back up specific repositories
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88094) in GitLab 15.1.
+
+You can back up a specific repositories using the `REPOSITORIES_PATHS` option.
+The option accepts a comma-separated list of project and group paths. If you
+specify a group path, all repositories in all projects in the group and
+descendent groups are included.
+
+For example, to back up all repositories for all projects in **Group A** (`group-a`), and the repository for **Project C** in **Group B** (`group-b/project-c`):
+
+- Omnibus GitLab installations:
+
+ ```shell
+ sudo gitlab-backup create REPOSITORIES_PATHS=group-a,group-b/project-c
+ ```
+
+- Installations from source:
+
+ ```shell
+ sudo -u git -H bundle exec rake gitlab:backup:create REPOSITORIES_PATHS=group-a,group-b/project-c
+ ```
+
+### Uploading backups to a remote (cloud) storage
+
+NOTE:
+It is not possible to [skip the tar creation](#skipping-tar-creation) when using object storage for backups.
+
+You can let the backup script upload (using the [Fog library](https://fog.io/))
+the `.tar` file it creates. In the following example, we use Amazon S3 for
+storage, but Fog also lets you use [other storage providers](https://fog.io/storage/).
+GitLab also [imports cloud drivers](https://gitlab.com/gitlab-org/gitlab/-/blob/da46c9655962df7d49caef0e2b9f6bbe88462a02/Gemfile#L113)
+for AWS, Google, OpenStack Swift, Rackspace, and Aliyun. A local driver is
+[also available](#uploading-to-locally-mounted-shares).
+
+[Read more about using object storage with GitLab](../administration/object_storage.md).
+
+#### Using Amazon S3
+
+For Omnibus GitLab packages:
+
+1. Add the following to `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ gitlab_rails['backup_upload_connection'] = {
+ 'provider' => 'AWS',
+ 'region' => 'eu-west-1',
+ 'aws_access_key_id' => 'AKIAKIAKI',
+ 'aws_secret_access_key' => 'secret123'
+ # If using an IAM Profile, don't configure aws_access_key_id & aws_secret_access_key
+ # 'use_iam_profile' => true
+ }
+ gitlab_rails['backup_upload_remote_directory'] = 'my.s3.bucket'
+ ```
+
+1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
+ for the changes to take effect
+
+#### S3 Encrypted Buckets
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64765) in GitLab 14.3.
+
+AWS supports these [modes for server side encryption](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html):
+
+- Amazon S3-Managed Keys (SSE-S3)
+- Customer Master Keys (CMKs) Stored in AWS Key Management Service (SSE-KMS)
+- Customer-Provided Keys (SSE-C)
+
+Use your mode of choice with GitLab. Each mode has similar, but slightly
+different, configuration methods.
+
+##### SSE-S3
+
+To enable SSE-S3, in the backup storage options set the `server_side_encryption`
+field to `AES256`. For example, in Omnibus GitLab:
+
+```ruby
+gitlab_rails['backup_upload_storage_options'] = {
+ 'server_side_encryption' => 'AES256'
+}
+```
+
+##### SSE-KMS
+
+To enable SSE-KMS, you'll need the [KMS key via its Amazon Resource Name (ARN)
+in the `arn:aws:kms:region:acct-id:key/key-id` format](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html). Under the `backup_upload_storage_options` configuration setting, set:
+
+- `server_side_encryption` to `aws:kms`.
+- `server_side_encryption_kms_key_id` to the ARN of the key.
+
+For example, in Omnibus GitLab:
+
+```ruby
+gitlab_rails['backup_upload_storage_options'] = {
+ 'server_side_encryption' => 'aws:kms',
+ 'server_side_encryption_kms_key_id' => 'arn:aws:<YOUR KMS KEY ID>:'
+}
+```
+
+##### SSE-C
+
+SSE-C requires you to set these encryption options:
+
+- `backup_encryption`: AES256.
+- `backup_encryption_key`: Unencoded, 32-byte (256 bits) key. The upload fails if this isn't exactly 32 bytes.
+
+For example, in Omnibus GitLab:
+
+```ruby
+gitlab_rails['backup_encryption'] = 'AES256'
+gitlab_rails['backup_encryption_key'] = '<YOUR 32-BYTE KEY HERE>'
+```
+
+If the key contains binary characters and cannot be encoded in UTF-8,
+instead, specify the key with the `GITLAB_BACKUP_ENCRYPTION_KEY` environment variable.
+For example:
+
+```ruby
+gitlab_rails['env'] = { 'GITLAB_BACKUP_ENCRYPTION_KEY' => "\xDE\xAD\xBE\xEF" * 8 }
+```
+
+#### Digital Ocean Spaces
+
+This example can be used for a bucket in Amsterdam (AMS3):
+
+1. Add the following to `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ gitlab_rails['backup_upload_connection'] = {
+ 'provider' => 'AWS',
+ 'region' => 'ams3',
+ 'aws_access_key_id' => 'AKIAKIAKI',
+ 'aws_secret_access_key' => 'secret123',
+ 'endpoint' => 'https://ams3.digitaloceanspaces.com'
+ }
+ gitlab_rails['backup_upload_remote_directory'] = 'my.s3.bucket'
+ ```
+
+1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
+ for the changes to take effect
+
+If you see a `400 Bad Request` error message when using Digital Ocean Spaces,
+the cause may be the use of backup encryption. Because Digital Ocean Spaces
+doesn't support encryption, remove or comment the line that contains
+`gitlab_rails['backup_encryption']`.
+
+#### Other S3 Providers
+
+Not all S3 providers are fully compatible with the Fog library. For example,
+if you see a `411 Length Required` error message after attempting to upload,
+you may need to downgrade the `aws_signature_version` value from the default
+value to `2`, [due to this issue](https://github.com/fog/fog-aws/issues/428).
+
+For installations from source:
+
+1. Edit `home/git/gitlab/config/gitlab.yml`:
+
+ ```yaml
+ backup:
+ # snip
+ upload:
+ # Fog storage connection settings, see https://fog.io/storage/ .
+ connection:
+ provider: AWS
+ region: eu-west-1
+ aws_access_key_id: AKIAKIAKI
+ aws_secret_access_key: 'secret123'
+ # If using an IAM Profile, leave aws_access_key_id & aws_secret_access_key empty
+ # ie. aws_access_key_id: ''
+ # use_iam_profile: 'true'
+ # The remote 'directory' to store your backups. For S3, this would be the bucket name.
+ remote_directory: 'my.s3.bucket'
+ # Specifies Amazon S3 storage class to use for backups, this is optional
+ # storage_class: 'STANDARD'
+ #
+ # Turns on AWS Server-Side Encryption with Amazon Customer-Provided Encryption Keys for backups, this is optional
+ # 'encryption' must be set in order for this to have any effect.
+ # 'encryption_key' should be set to the 256-bit encryption key for Amazon S3 to use to encrypt or decrypt.
+ # To avoid storing the key on disk, the key can also be specified via the `GITLAB_BACKUP_ENCRYPTION_KEY` your data.
+ # encryption: 'AES256'
+ # encryption_key: '<key>'
+ #
+ #
+ # Turns on AWS Server-Side Encryption with Amazon S3-Managed keys (optional)
+ # https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html
+ # For SSE-S3, set 'server_side_encryption' to 'AES256'.
+ # For SS3-KMS, set 'server_side_encryption' to 'aws:kms'. Set
+ # 'server_side_encryption_kms_key_id' to the ARN of customer master key.
+ # storage_options:
+ # server_side_encryption: 'aws:kms'
+ # server_side_encryption_kms_key_id: 'arn:aws:kms:YOUR-KEY-ID-HERE'
+ ```
+
+1. [Restart GitLab](../administration/restart_gitlab.md#installations-from-source)
+ for the changes to take effect
+
+If you're uploading your backups to S3, you should create a new
+IAM user with restricted access rights. To give the upload user access only for
+uploading backups create the following IAM profile, replacing `my.s3.bucket`
+with the name of your bucket:
+
+```json
+{
+ "Version": "2012-10-17",
+ "Statement": [
+ {
+ "Sid": "Stmt1412062044000",
+ "Effect": "Allow",
+ "Action": [
+ "s3:AbortMultipartUpload",
+ "s3:GetBucketAcl",
+ "s3:GetBucketLocation",
+ "s3:GetObject",
+ "s3:GetObjectAcl",
+ "s3:ListBucketMultipartUploads",
+ "s3:PutObject",
+ "s3:PutObjectAcl"
+ ],
+ "Resource": [
+ "arn:aws:s3:::my.s3.bucket/*"
+ ]
+ },
+ {
+ "Sid": "Stmt1412062097000",
+ "Effect": "Allow",
+ "Action": [
+ "s3:GetBucketLocation",
+ "s3:ListAllMyBuckets"
+ ],
+ "Resource": [
+ "*"
+ ]
+ },
+ {
+ "Sid": "Stmt1412062128000",
+ "Effect": "Allow",
+ "Action": [
+ "s3:ListBucket"
+ ],
+ "Resource": [
+ "arn:aws:s3:::my.s3.bucket"
+ ]
+ }
+ ]
+}
+```
+
+#### Using Google Cloud Storage
+
+To use Google Cloud Storage to save backups, you must first create an
+access key from the Google console:
+
+1. Go to the [Google storage settings page](https://console.cloud.google.com/storage/settings).
+1. Select **Interoperability**, and then create an access key.
+1. Make note of the **Access Key** and **Secret** and replace them in the
+ following configurations.
+1. In the buckets advanced settings ensure the Access Control option
+ **Set object-level and bucket-level permissions** is selected.
+1. Ensure you have already created a bucket.
+
+For Omnibus GitLab packages:
+
+1. Edit `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ gitlab_rails['backup_upload_connection'] = {
+ 'provider' => 'Google',
+ 'google_storage_access_key_id' => 'Access Key',
+ 'google_storage_secret_access_key' => 'Secret',
+
+ ## If you have CNAME buckets (foo.example.com), you might run into SSL issues
+ ## when uploading backups ("hostname foo.example.com.storage.googleapis.com
+ ## does not match the server certificate"). In that case, uncomnent the following
+ ## setting. See: https://github.com/fog/fog/issues/2834
+ #'path_style' => true
+ }
+ gitlab_rails['backup_upload_remote_directory'] = 'my.google.bucket'
+ ```
+
+1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
+ for the changes to take effect
+
+For installations from source:
+
+1. Edit `home/git/gitlab/config/gitlab.yml`:
+
+ ```yaml
+ backup:
+ upload:
+ connection:
+ provider: 'Google'
+ google_storage_access_key_id: 'Access Key'
+ google_storage_secret_access_key: 'Secret'
+ remote_directory: 'my.google.bucket'
+ ```
+
+1. [Restart GitLab](../administration/restart_gitlab.md#installations-from-source)
+ for the changes to take effect
+
+#### Using Azure Blob storage
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25877) in GitLab 13.4.
+
+For Omnibus GitLab packages:
+
+1. Edit `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ gitlab_rails['backup_upload_connection'] = {
+ 'provider' => 'AzureRM',
+ 'azure_storage_account_name' => '<AZURE STORAGE ACCOUNT NAME>',
+ 'azure_storage_access_key' => '<AZURE STORAGE ACCESS KEY>',
+ 'azure_storage_domain' => 'blob.core.windows.net', # Optional
+ }
+ gitlab_rails['backup_upload_remote_directory'] = '<AZURE BLOB CONTAINER>'
+ ```
+
+1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
+ for the changes to take effect
+
+For installations from source:
+
+1. Edit `home/git/gitlab/config/gitlab.yml`:
+
+ ```yaml
+ backup:
+ upload:
+ connection:
+ provider: 'AzureRM'
+ azure_storage_account_name: '<AZURE STORAGE ACCOUNT NAME>'
+ azure_storage_access_key: '<AZURE STORAGE ACCESS KEY>'
+ remote_directory: '<AZURE BLOB CONTAINER>'
+ ```
+
+1. [Restart GitLab](../administration/restart_gitlab.md#installations-from-source)
+ for the changes to take effect
+
+For more details, see the [table of Azure parameters](../administration/object_storage.md#azure-blob-storage).
+
+#### Specifying a custom directory for backups
+
+This option works only for remote storage. If you want to group your backups,
+you can pass a `DIRECTORY` environment variable:
+
+```shell
+sudo gitlab-backup create DIRECTORY=daily
+sudo gitlab-backup create DIRECTORY=weekly
+```
+
+Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
+
+### Skip uploading backups to remote storage
+
+If you have configured GitLab to [upload backups in a remote storage](#uploading-backups-to-a-remote-cloud-storage),
+you can use the `SKIP=remote` option to skip uploading your backups to the remote storage.
+
+For Omnibus GitLab packages:
+
+```shell
+sudo gitlab-backup create SKIP=remote
+```
+
+For installations from source:
+
+```shell
+sudo -u git -H bundle exec rake gitlab:backup:create SKIP=remote RAILS_ENV=production
+```
+
+### Uploading to locally mounted shares
+
+You may also send backups to a mounted share (for example, `NFS`,`CIFS`, or
+`SMB`) by using the Fog [`Local`](https://github.com/fog/fog-local#usage)
+storage provider. The directory pointed to by the `local_root` key _must_ be
+owned by the `git` user _when mounted_ (mounting with the `uid=` of the `git`
+user for `CIFS` and `SMB`) or the user that you are executing the backup tasks
+as (for Omnibus packages, this is the `git` user).
+
+The `backup_upload_remote_directory` _must_ be set in addition to the
+`local_root` key. This is the sub directory inside the mounted directory that
+backups are copied to, and is created if it does not exist. If the
+directory that you want to copy the tarballs to is the root of your mounted
+directory, use `.` instead.
+
+Because file system performance may affect overall GitLab performance,
+[GitLab doesn't recommend using cloud-based file systems for storage](../administration/nfs.md#avoid-using-cloud-based-file-systems).
+
+For Omnibus GitLab packages:
+
+1. Edit `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ gitlab_rails['backup_upload_connection'] = {
+ :provider => 'Local',
+ :local_root => '/mnt/backups'
+ }
+
+ # The directory inside the mounted folder to copy backups to
+ # Use '.' to store them in the root directory
+ gitlab_rails['backup_upload_remote_directory'] = 'gitlab_backups'
+ ```
+
+1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
+ for the changes to take effect.
+
+For installations from source:
+
+1. Edit `home/git/gitlab/config/gitlab.yml`:
+
+ ```yaml
+ backup:
+ upload:
+ # Fog storage connection settings, see https://fog.io/storage/ .
+ connection:
+ provider: Local
+ local_root: '/mnt/backups'
+ # The directory inside the mounted folder to copy backups to
+ # Use '.' to store them in the root directory
+ remote_directory: 'gitlab_backups'
+ ```
+
+1. [Restart GitLab](../administration/restart_gitlab.md#installations-from-source)
+ for the changes to take effect.
+
+### Backup archive permissions
+
+The backup archives created by GitLab (`1393513186_2014_02_27_gitlab_backup.tar`)
+have the owner/group `git`/`git` and 0600 permissions by default. This is
+meant to avoid other system users reading GitLab data. If you need the backup
+archives to have different permissions, you can use the `archive_permissions`
+setting.
+
+For Omnibus GitLab packages:
+
+1. Edit `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ gitlab_rails['backup_archive_permissions'] = 0644 # Makes the backup archives world-readable
+ ```
+
+1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
+ for the changes to take effect.
+
+For installations from source:
+
+1. Edit `/home/git/gitlab/config/gitlab.yml`:
+
+ ```yaml
+ backup:
+ archive_permissions: 0644 # Makes the backup archives world-readable
+ ```
+
+1. [Restart GitLab](../administration/restart_gitlab.md#installations-from-source)
+ for the changes to take effect.
+
+### Configuring cron to make daily backups
+
+WARNING:
+The following cron jobs do not [back up your GitLab configuration files](#storing-configuration-files)
+or [SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079).
+
+You can schedule a cron job that backs up your repositories and GitLab metadata.
+
+For Omnibus GitLab packages:
+
+1. Edit the crontab for the `root` user:
+
+ ```shell
+ sudo su -
+ crontab -e
+ ```
+
+1. There, add the following line to schedule the backup for everyday at 2 AM:
+
+ ```plaintext
+ 0 2 * * * /opt/gitlab/bin/gitlab-backup create CRON=1
+ ```
+
+ Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
+
+For installations from source:
+
+1. Edit the crontab for the `git` user:
+
+ ```shell
+ sudo -u git crontab -e
+ ```
+
+1. Add the following lines at the bottom:
+
+ ```plaintext
+ # Create a full backup of the GitLab repositories and SQL database every day at 2am
+ 0 2 * * * cd /home/git/gitlab && PATH=/usr/local/bin:/usr/bin:/bin bundle exec rake gitlab:backup:create RAILS_ENV=production CRON=1
+ ```
+
+The `CRON=1` environment setting directs the backup script to hide all progress
+output if there aren't any errors. This is recommended to reduce cron spam.
+When troubleshooting backup problems, however, replace `CRON=1` with `--trace` to log verbosely.
+
+## Limit backup lifetime for local files (prune old backups)
+
+WARNING:
+The process described in this section don't work if you used a [custom filename](#backup-filename)
+for your backups.
+
+To prevent regular backups from using all your disk space, you may want to set a limited lifetime
+for backups. The next time the backup task runs, backups older than the `backup_keep_time` are
+pruned.
+
+This configuration option manages only local files. GitLab doesn't prune old
+files stored in a third-party [object storage](#uploading-backups-to-a-remote-cloud-storage)
+because the user may not have permission to list and delete files. It's
+recommended that you configure the appropriate retention policy for your object
+storage (for example, [AWS S3](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-lifecycle.html)).
+
+For Omnibus GitLab packages:
+
+1. Edit `/etc/gitlab/gitlab.rb`:
+
+ ```ruby
+ ## Limit backup lifetime to 7 days - 604800 seconds
+ gitlab_rails['backup_keep_time'] = 604800
+ ```
+
+1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
+ for the changes to take effect.
+
+For installations from source:
+
+1. Edit `/home/git/gitlab/config/gitlab.yml`:
+
+ ```yaml
+ backup:
+ ## Limit backup lifetime to 7 days - 604800 seconds
+ keep_time: 604800
+ ```
+
+1. [Restart GitLab](../administration/restart_gitlab.md#installations-from-source)
+ for the changes to take effect.
diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md
index 16185310d99..58222196077 100644
--- a/doc/raketasks/backup_restore.md
+++ b/doc/raketasks/backup_restore.md
@@ -49,1268 +49,11 @@ the timestamp is `1493107454_2018_04_25_10.6.4-ce`.
## Back up GitLab
-GitLab provides a command line interface to back up your entire instance,
-including:
-
-- Database
-- Attachments
-- Git repositories data
-- CI/CD job output logs
-- CI/CD job artifacts
-- LFS objects
-- Terraform states ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/331806) in GitLab 14.7)
-- Container Registry images
-- GitLab Pages content
-- Packages ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/332006) in GitLab 14.7)
-- Snippets
-- [Group wikis](../user/project/wiki/group.md)
-
-Backups do not include:
-
-- [Mattermost data](https://docs.mattermost.com/administration/config-settings.html#file-storage)
-- Redis (and thus Sidekiq jobs)
-
-WARNING:
-GitLab does not back up any configuration files (`/etc/gitlab`), TLS keys and certificates, or system
-files. You are highly advised to read about [storing configuration files](#storing-configuration-files).
-
-WARNING:
-The backup command requires [additional parameters](#back-up-and-restore-for-installations-using-pgbouncer) when
-your installation is using PgBouncer, for either performance reasons or when using it with a Patroni cluster.
-
-Depending on your version of GitLab, use the following command if you installed
-GitLab using the Omnibus package:
-
-- GitLab 12.2 or later:
-
- ```shell
- sudo gitlab-backup create
- ```
-
-- GitLab 12.1 and earlier:
-
- ```shell
- gitlab-rake gitlab:backup:create
- ```
-
-If you installed GitLab from source, use the following command:
-
-```shell
-sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
-```
-
-If you're running GitLab from within a Docker container, run the backup from
-the host, based on your installed version of GitLab:
-
-- GitLab 12.2 or later:
-
- ```shell
- docker exec -t <container name> gitlab-backup create
- ```
-
-- GitLab 12.1 and earlier:
-
- ```shell
- docker exec -t <container name> gitlab-rake gitlab:backup:create
- ```
-
-If you're using the [GitLab Helm chart](https://gitlab.com/gitlab-org/charts/gitlab)
-on a Kubernetes cluster, you can run the backup task by using `kubectl` to run the `backup-utility`
-script on the GitLab toolbox pod. For more details, see the
-[charts backup documentation](https://docs.gitlab.com/charts/backup-restore/backup.html).
-
-Similar to the Kubernetes case, if you have scaled out your GitLab cluster to
-use multiple application servers, you should pick a designated node (that isn't
-auto-scaled away) for running the backup Rake task. Because the backup Rake
-task is tightly coupled to the main Rails application, this is typically a node
-on which you're also running Puma or Sidekiq.
-
-Example output:
-
-```plaintext
-Dumping database tables:
-- Dumping table events... [DONE]
-- Dumping table issues... [DONE]
-- Dumping table keys... [DONE]
-- Dumping table merge_requests... [DONE]
-- Dumping table milestones... [DONE]
-- Dumping table namespaces... [DONE]
-- Dumping table notes... [DONE]
-- Dumping table projects... [DONE]
-- Dumping table protected_branches... [DONE]
-- Dumping table schema_migrations... [DONE]
-- Dumping table services... [DONE]
-- Dumping table snippets... [DONE]
-- Dumping table taggings... [DONE]
-- Dumping table tags... [DONE]
-- Dumping table users... [DONE]
-- Dumping table users_projects... [DONE]
-- Dumping table web_hooks... [DONE]
-- Dumping table wikis... [DONE]
-Dumping repositories:
-- Dumping repository abcd... [DONE]
-Creating backup archive: $TIMESTAMP_gitlab_backup.tar [DONE]
-Deleting tmp directories...[DONE]
-Deleting old backups... [SKIPPING]
-```
-
-### Storing configuration files
-
-The [backup Rake task](#back-up-gitlab) GitLab provides does _not_ store your
-configuration files. The primary reason for this is that your database contains
-items including encrypted information for two-factor authentication and the
-CI/CD _secure variables_. Storing encrypted information in the same location
-as its key defeats the purpose of using encryption in the first place.
-
-WARNING:
-The secrets file is essential to preserve your database encryption key.
-
-At the very **minimum**, you must back up:
-
-For Omnibus:
-
-- `/etc/gitlab/gitlab-secrets.json`
-- `/etc/gitlab/gitlab.rb`
-
-For installation from source:
-
-- `/home/git/gitlab/config/secrets.yml`
-- `/home/git/gitlab/config/gitlab.yml`
-
-For [Docker installations](https://docs.gitlab.com/omnibus/docker/), you must
-back up the volume where the configuration files are stored. If you created
-the GitLab container according to the documentation, it should be in the
-`/srv/gitlab/config` directory.
-
-For [GitLab Helm chart installations](https://gitlab.com/gitlab-org/charts/gitlab)
-on a Kubernetes cluster, you must follow the
-[Back up the secrets](https://docs.gitlab.com/charts/backup-restore/backup.html#backup-the-secrets)
-instructions.
-
-You may also want to back up any TLS keys and certificates (`/etc/gitlab/ssl`, `/etc/gitlab/trusted-certs`), and your
-[SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079)
-to avoid man-in-the-middle attack warnings if you have to perform a full machine restore.
-
-If you use Omnibus GitLab, review additional information to
-[backup your configuration](https://docs.gitlab.com/omnibus/settings/backups.html).
-
-In the unlikely event that the secrets file is lost, see the
-[troubleshooting section](#when-the-secrets-file-is-lost).
-
-### Backup options
-
-The command line tool GitLab provides to backup your instance can accept more
-options.
-
-#### Backup strategy option
-
-The default backup strategy is to essentially stream data from the respective
-data locations to the backup using the Linux command `tar` and `gzip`. This works
-fine in most cases, but can cause problems when data is rapidly changing.
-
-When data changes while `tar` is reading it, the error `file changed as we read
-it` may occur, and causes the backup process to fail. To combat this, 8.17
-introduces a new backup strategy called `copy`. The strategy copies data files
-to a temporary location before calling `tar` and `gzip`, avoiding the error.
-
-A side-effect is that the backup process takes up to an additional 1X disk
-space. The process does its best to clean up the temporary files at each stage
-so the problem doesn't compound, but it could be a considerable change for large
-installations. This is why the `copy` strategy is not the default in 8.17.
-
-To use the `copy` strategy instead of the default streaming strategy, specify
-`STRATEGY=copy` in the Rake task command. For example:
-
-```shell
-sudo gitlab-backup create STRATEGY=copy
-```
-
-Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
-
-#### Backup filename
-
-WARNING:
-If you use a custom backup filename, you can't
-[limit the lifetime of the backups](#limit-backup-lifetime-for-local-files-prune-old-backups).
-
-By default, a backup file is created according to the specification in the
-previous [Backup timestamp](#backup-timestamp) section. You can, however,
-override the `[TIMESTAMP]` portion of the filename by setting the `BACKUP`
-environment variable. For example:
-
-```shell
-sudo gitlab-backup create BACKUP=dump
-```
-
-Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
-
-The resulting file is named `dump_gitlab_backup.tar`. This is useful for
-systems that make use of rsync and incremental backups, and results in
-considerably faster transfer speeds.
-
-#### Confirm archive can be transferred
-
-To ensure the generated archive is transferable by rsync, you can set the `GZIP_RSYNCABLE=yes`
-option. This sets the `--rsyncable` option to `gzip`, which is useful only in
-combination with setting [the Backup filename option](#backup-filename).
-
-Note that the `--rsyncable` option in `gzip` isn't guaranteed to be available
-on all distributions. To verify that it's available in your distribution, run
-`gzip --help` or consult the man pages.
-
-```shell
-sudo gitlab-backup create BACKUP=dump GZIP_RSYNCABLE=yes
-```
-
-Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
-
-#### Excluding specific directories from the backup
-
-You can exclude specific directories from the backup by adding the environment variable `SKIP`, whose values are a comma-separated list of the following options:
-
-- `db` (database)
-- `uploads` (attachments)
-- `builds` (CI job output logs)
-- `artifacts` (CI job artifacts)
-- `lfs` (LFS objects)
-- `terraform_state` (Terraform states)
-- `registry` (Container Registry images)
-- `pages` (Pages content)
-- `repositories` (Git repositories data)
-- `packages` (Packages)
-
-All wikis are backed up as part of the `repositories` group. Non-existent wikis are skipped during a backup.
-
-NOTE:
-When [backing up and restoring Helm Charts](https://docs.gitlab.com/charts/architecture/backup-restore.html), there is an additional option `packages`, which refers to any packages managed by the GitLab [package registry](../user/packages/package_registry/index.md).
-For more information see [command line arguments](https://docs.gitlab.com/charts/architecture/backup-restore.html#command-line-arguments).
-
-All wikis are backed up as part of the `repositories` group. Non-existent
-wikis are skipped during a backup.
-
-For Omnibus GitLab packages:
-
-```shell
-sudo gitlab-backup create SKIP=db,uploads
-```
-
-Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
-
-For installations from source:
-
-```shell
-sudo -u git -H bundle exec rake gitlab:backup:create SKIP=db,uploads RAILS_ENV=production
-```
-
-#### Skipping tar creation
-
-NOTE:
-It is not possible to skip the tar creation when using [object storage](#uploading-backups-to-a-remote-cloud-storage) for backups.
-
-The last part of creating a backup is generation of a `.tar` file containing
-all the parts. In some cases (for example, if the backup is picked up by other
-backup software) creating a `.tar` file might be wasted effort or even directly
-harmful, so you can skip this step by adding `tar` to the `SKIP` environment
-variable.
-
-Adding `tar` to the `SKIP` variable leaves the files and directories containing the
-backup in the directory used for the intermediate files. These files are
-overwritten when a new backup is created, so you should make sure they are copied
-elsewhere, because you can only have one backup on the system.
-
-For Omnibus GitLab packages:
-
-```shell
-sudo gitlab-backup create SKIP=tar
-```
-
-For installations from source:
-
-```shell
-sudo -u git -H bundle exec rake gitlab:backup:create SKIP=tar RAILS_ENV=production
-```
-
-#### Disabling prompts during restore
-
-During a restore from backup, the restore script may ask for confirmation before
-proceeding. If you wish to disable these prompts, you can set the `GITLAB_ASSUME_YES`
-environment variable to `1`.
-
-For Omnibus GitLab packages:
-
-```shell
-sudo GITLAB_ASSUME_YES=1 gitlab-backup restore
-```
-
-For installations from source:
-
-```shell
-sudo -u git -H GITLAB_ASSUME_YES=1 bundle exec rake gitlab:backup:restore RAILS_ENV=production
-```
-
-#### Back up Git repositories concurrently
-
-> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37158) in GitLab 13.3.
-> - [Concurrent restore introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69330) in GitLab 14.3
-
-When using [multiple repository storages](../administration/repository_storage_paths.md),
-repositories can be backed up or restored concurrently to help fully use CPU time. The
-following variables are available to modify the default behavior of the Rake
-task:
-
-- `GITLAB_BACKUP_MAX_CONCURRENCY`: The maximum number of projects to back up at
- the same time. Defaults to the number of logical CPUs (in GitLab 14.1 and
- earlier, defaults to `1`).
-- `GITLAB_BACKUP_MAX_STORAGE_CONCURRENCY`: The maximum number of projects to
- back up at the same time on each storage. This allows the repository backups
- to be spread across storages. Defaults to `2` (in GitLab 14.1 and earlier,
- defaults to `1`).
-
-For example, for Omnibus GitLab installations with 4 repository storages:
-
-```shell
-sudo gitlab-backup create GITLAB_BACKUP_MAX_CONCURRENCY=4 GITLAB_BACKUP_MAX_STORAGE_CONCURRENCY=1
-```
-
-For example, for installations from source:
-
-```shell
-sudo -u git -H bundle exec rake gitlab:backup:create GITLAB_BACKUP_MAX_CONCURRENCY=4 GITLAB_BACKUP_MAX_STORAGE_CONCURRENCY=1
-```
-
-#### Incremental repository backups
-
-> - Introduced in GitLab 14.9 [with a flag](../administration/feature_flags.md) named `incremental_repository_backup`. Disabled by default.
-> - [Enabled on self-managed](https://gitlab.com/gitlab-org/gitlab/-/issues/355945) in GitLab 14.10.
-> - `PREVIOUS_BACKUP` option [introduced](https://gitlab.com/gitlab-org/gitaly/-/issues/4184) in GitLab 15.0.
-
-FLAG:
-On self-managed GitLab, by default this feature is available. To hide the feature, ask an administrator to [disable the feature flag](../administration/feature_flags.md) named `incremental_repository_backup`.
-On GitLab.com, this feature is not available.
-
-Incremental backups can be faster than full backups because they only pack changes since the last backup into the backup
-bundle for each repository. There must be an existing backup to create an incremental backup from:
-
-- In GitLab 14.9 and 14.10, use the `BACKUP=<timestamp_of_backup>` option to choose the backup to use. The chosen previous backup is overwritten.
-- In GitLab 15.0 and later, use the `PREVIOUS_BACKUP=<timestamp_of_backup>` option to choose the backup to use. By default, a backup file is created
- as documented in the [Backup timestamp](#backup-timestamp) section. You can override the `[TIMESTAMP]` portion of the filename by setting the
- [`BACKUP` environment variable](#backup-filename).
-
-To create an incremental backup, run:
-
-```shell
-sudo gitlab-backup create INCREMENTAL=yes PREVIOUS_BACKUP=<timestamp_of_backup>
-```
-
-Incremental backups can also be created from [an untarred backup](#skipping-tar-creation) by using `SKIP=tar`:
-
-```shell
-sudo gitlab-backup create INCREMENTAL=yes SKIP=tar
-```
-
-#### Back up specific repository storages
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86896) in GitLab 15.0.
-
-When using [multiple repository storages](../administration/repository_storage_paths.md),
-repositories from specific repository storages can be backed up separately
-using the `REPOSITORIES_STORAGES` option. The option accepts a comma-separated list of
-storage names.
-
-For example, for Omnibus GitLab installations:
-
-```shell
-sudo gitlab-backup create REPOSITORIES_STORAGES=storage1,storage2
-```
-
-For example, for installations from source:
-
-```shell
-sudo -u git -H bundle exec rake gitlab:backup:create REPOSITORIES_STORAGES=storage1,storage2
-```
-
-#### Back up specific repositories
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88094) in GitLab 15.1.
-
-You can back up a specific repositories using the `REPOSITORIES_PATHS` option.
-The option accepts a comma-separated list of project and group paths. If you
-specify a group path, all repositories in all projects in the group and
-descendent groups are included.
-
-For example, to back up all repositories for all projects in **Group A** (`group-a`), and the repository for **Project C** in **Group B** (`group-b/project-c`):
-
-- Omnibus GitLab installations:
-
- ```shell
- sudo gitlab-backup create REPOSITORIES_PATHS=group-a,group-b/project-c
- ```
-
-- Installations from source:
-
- ```shell
- sudo -u git -H bundle exec rake gitlab:backup:create REPOSITORIES_PATHS=group-a,group-b/project-c
- ```
-
-#### Uploading backups to a remote (cloud) storage
-
-NOTE:
-It is not possible to [skip the tar creation](#skipping-tar-creation) when using object storage for backups.
-
-You can let the backup script upload (using the [Fog library](https://fog.io/))
-the `.tar` file it creates. In the following example, we use Amazon S3 for
-storage, but Fog also lets you use [other storage providers](https://fog.io/storage/).
-GitLab also [imports cloud drivers](https://gitlab.com/gitlab-org/gitlab/-/blob/da46c9655962df7d49caef0e2b9f6bbe88462a02/Gemfile#L113)
-for AWS, Google, OpenStack Swift, Rackspace, and Aliyun. A local driver is
-[also available](#uploading-to-locally-mounted-shares).
-
-[Read more about using object storage with GitLab](../administration/object_storage.md).
-
-##### Using Amazon S3
-
-For Omnibus GitLab packages:
-
-1. Add the following to `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- gitlab_rails['backup_upload_connection'] = {
- 'provider' => 'AWS',
- 'region' => 'eu-west-1',
- 'aws_access_key_id' => 'AKIAKIAKI',
- 'aws_secret_access_key' => 'secret123'
- # If using an IAM Profile, don't configure aws_access_key_id & aws_secret_access_key
- # 'use_iam_profile' => true
- }
- gitlab_rails['backup_upload_remote_directory'] = 'my.s3.bucket'
- ```
-
-1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
- for the changes to take effect
-
-##### S3 Encrypted Buckets
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64765) in GitLab 14.3.
-
-AWS supports these [modes for server side encryption](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html):
-
-- Amazon S3-Managed Keys (SSE-S3)
-- Customer Master Keys (CMKs) Stored in AWS Key Management Service (SSE-KMS)
-- Customer-Provided Keys (SSE-C)
-
-Use your mode of choice with GitLab. Each mode has similar, but slightly
-different, configuration methods.
-
-###### SSE-S3
-
-To enable SSE-S3, in the backup storage options set the `server_side_encryption`
-field to `AES256`. For example, in Omnibus GitLab:
-
-```ruby
-gitlab_rails['backup_upload_storage_options'] = {
- 'server_side_encryption' => 'AES256'
-}
-```
-
-###### SSE-KMS
-
-To enable SSE-KMS, you'll need the [KMS key via its Amazon Resource Name (ARN)
-in the `arn:aws:kms:region:acct-id:key/key-id` format](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html). Under the `backup_upload_storage_options` configuration setting, set:
-
-- `server_side_encryption` to `aws:kms`.
-- `server_side_encryption_kms_key_id` to the ARN of the key.
-
-For example, in Omnibus GitLab:
-
-```ruby
-gitlab_rails['backup_upload_storage_options'] = {
- 'server_side_encryption' => 'aws:kms',
- 'server_side_encryption_kms_key_id' => 'arn:aws:<YOUR KMS KEY ID>:'
-}
-```
-
-###### SSE-C
-
-SSE-C requires you to set these encryption options:
-
-- `backup_encryption`: AES256.
-- `backup_encryption_key`: Unencoded, 32-byte (256 bits) key. The upload fails if this isn't exactly 32 bytes.
-
-For example, in Omnibus GitLab:
-
-```ruby
-gitlab_rails['backup_encryption'] = 'AES256'
-gitlab_rails['backup_encryption_key'] = '<YOUR 32-BYTE KEY HERE>'
-```
-
-If the key contains binary characters and cannot be encoded in UTF-8,
-instead, specify the key with the `GITLAB_BACKUP_ENCRYPTION_KEY` environment variable.
-For example:
-
-```ruby
-gitlab_rails['env'] = { 'GITLAB_BACKUP_ENCRYPTION_KEY' => "\xDE\xAD\xBE\xEF" * 8 }
-```
-
-##### Digital Ocean Spaces
-
-This example can be used for a bucket in Amsterdam (AMS3):
-
-1. Add the following to `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- gitlab_rails['backup_upload_connection'] = {
- 'provider' => 'AWS',
- 'region' => 'ams3',
- 'aws_access_key_id' => 'AKIAKIAKI',
- 'aws_secret_access_key' => 'secret123',
- 'endpoint' => 'https://ams3.digitaloceanspaces.com'
- }
- gitlab_rails['backup_upload_remote_directory'] = 'my.s3.bucket'
- ```
-
-1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
- for the changes to take effect
-
-If you see a `400 Bad Request` error message when using Digital Ocean Spaces,
-the cause may be the use of backup encryption. Because Digital Ocean Spaces
-doesn't support encryption, remove or comment the line that contains
-`gitlab_rails['backup_encryption']`.
-
-##### Other S3 Providers
-
-Not all S3 providers are fully compatible with the Fog library. For example,
-if you see a `411 Length Required` error message after attempting to upload,
-you may need to downgrade the `aws_signature_version` value from the default
-value to `2`, [due to this issue](https://github.com/fog/fog-aws/issues/428).
-
-For installations from source:
-
-1. Edit `home/git/gitlab/config/gitlab.yml`:
-
- ```yaml
- backup:
- # snip
- upload:
- # Fog storage connection settings, see https://fog.io/storage/ .
- connection:
- provider: AWS
- region: eu-west-1
- aws_access_key_id: AKIAKIAKI
- aws_secret_access_key: 'secret123'
- # If using an IAM Profile, leave aws_access_key_id & aws_secret_access_key empty
- # ie. aws_access_key_id: ''
- # use_iam_profile: 'true'
- # The remote 'directory' to store your backups. For S3, this would be the bucket name.
- remote_directory: 'my.s3.bucket'
- # Specifies Amazon S3 storage class to use for backups, this is optional
- # storage_class: 'STANDARD'
- #
- # Turns on AWS Server-Side Encryption with Amazon Customer-Provided Encryption Keys for backups, this is optional
- # 'encryption' must be set in order for this to have any effect.
- # 'encryption_key' should be set to the 256-bit encryption key for Amazon S3 to use to encrypt or decrypt.
- # To avoid storing the key on disk, the key can also be specified via the `GITLAB_BACKUP_ENCRYPTION_KEY` your data.
- # encryption: 'AES256'
- # encryption_key: '<key>'
- #
- #
- # Turns on AWS Server-Side Encryption with Amazon S3-Managed keys (optional)
- # https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html
- # For SSE-S3, set 'server_side_encryption' to 'AES256'.
- # For SS3-KMS, set 'server_side_encryption' to 'aws:kms'. Set
- # 'server_side_encryption_kms_key_id' to the ARN of customer master key.
- # storage_options:
- # server_side_encryption: 'aws:kms'
- # server_side_encryption_kms_key_id: 'arn:aws:kms:YOUR-KEY-ID-HERE'
- ```
-
-1. [Restart GitLab](../administration/restart_gitlab.md#installations-from-source)
- for the changes to take effect
-
-If you're uploading your backups to S3, you should create a new
-IAM user with restricted access rights. To give the upload user access only for
-uploading backups create the following IAM profile, replacing `my.s3.bucket`
-with the name of your bucket:
-
-```json
-{
- "Version": "2012-10-17",
- "Statement": [
- {
- "Sid": "Stmt1412062044000",
- "Effect": "Allow",
- "Action": [
- "s3:AbortMultipartUpload",
- "s3:GetBucketAcl",
- "s3:GetBucketLocation",
- "s3:GetObject",
- "s3:GetObjectAcl",
- "s3:ListBucketMultipartUploads",
- "s3:PutObject",
- "s3:PutObjectAcl"
- ],
- "Resource": [
- "arn:aws:s3:::my.s3.bucket/*"
- ]
- },
- {
- "Sid": "Stmt1412062097000",
- "Effect": "Allow",
- "Action": [
- "s3:GetBucketLocation",
- "s3:ListAllMyBuckets"
- ],
- "Resource": [
- "*"
- ]
- },
- {
- "Sid": "Stmt1412062128000",
- "Effect": "Allow",
- "Action": [
- "s3:ListBucket"
- ],
- "Resource": [
- "arn:aws:s3:::my.s3.bucket"
- ]
- }
- ]
-}
-```
-
-##### Using Google Cloud Storage
-
-To use Google Cloud Storage to save backups, you must first create an
-access key from the Google console:
-
-1. Go to the [Google storage settings page](https://console.cloud.google.com/storage/settings).
-1. Select **Interoperability**, and then create an access key.
-1. Make note of the **Access Key** and **Secret** and replace them in the
- following configurations.
-1. In the buckets advanced settings ensure the Access Control option
- **Set object-level and bucket-level permissions** is selected.
-1. Ensure you have already created a bucket.
-
-For Omnibus GitLab packages:
-
-1. Edit `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- gitlab_rails['backup_upload_connection'] = {
- 'provider' => 'Google',
- 'google_storage_access_key_id' => 'Access Key',
- 'google_storage_secret_access_key' => 'Secret',
-
- ## If you have CNAME buckets (foo.example.com), you might run into SSL issues
- ## when uploading backups ("hostname foo.example.com.storage.googleapis.com
- ## does not match the server certificate"). In that case, uncomnent the following
- ## setting. See: https://github.com/fog/fog/issues/2834
- #'path_style' => true
- }
- gitlab_rails['backup_upload_remote_directory'] = 'my.google.bucket'
- ```
-
-1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
- for the changes to take effect
-
-For installations from source:
-
-1. Edit `home/git/gitlab/config/gitlab.yml`:
-
- ```yaml
- backup:
- upload:
- connection:
- provider: 'Google'
- google_storage_access_key_id: 'Access Key'
- google_storage_secret_access_key: 'Secret'
- remote_directory: 'my.google.bucket'
- ```
-
-1. [Restart GitLab](../administration/restart_gitlab.md#installations-from-source)
- for the changes to take effect
-
-##### Using Azure Blob storage
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25877) in GitLab 13.4.
-
-For Omnibus GitLab packages:
-
-1. Edit `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- gitlab_rails['backup_upload_connection'] = {
- 'provider' => 'AzureRM',
- 'azure_storage_account_name' => '<AZURE STORAGE ACCOUNT NAME>',
- 'azure_storage_access_key' => '<AZURE STORAGE ACCESS KEY>',
- 'azure_storage_domain' => 'blob.core.windows.net', # Optional
- }
- gitlab_rails['backup_upload_remote_directory'] = '<AZURE BLOB CONTAINER>'
- ```
-
-1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
- for the changes to take effect
-
-For installations from source:
-
-1. Edit `home/git/gitlab/config/gitlab.yml`:
-
- ```yaml
- backup:
- upload:
- connection:
- provider: 'AzureRM'
- azure_storage_account_name: '<AZURE STORAGE ACCOUNT NAME>'
- azure_storage_access_key: '<AZURE STORAGE ACCESS KEY>'
- remote_directory: '<AZURE BLOB CONTAINER>'
- ```
-
-1. [Restart GitLab](../administration/restart_gitlab.md#installations-from-source)
- for the changes to take effect
-
-For more details, see the [table of Azure parameters](../administration/object_storage.md#azure-blob-storage).
-
-##### Specifying a custom directory for backups
-
-This option works only for remote storage. If you want to group your backups,
-you can pass a `DIRECTORY` environment variable:
-
-```shell
-sudo gitlab-backup create DIRECTORY=daily
-sudo gitlab-backup create DIRECTORY=weekly
-```
-
-Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
-
-#### Skip uploading backups to remote storage
-
-If you have configured GitLab to [upload backups in a remote storage](#uploading-backups-to-a-remote-cloud-storage),
-you can use the `SKIP=remote` option to skip uploading your backups to the remote storage.
-
-For Omnibus GitLab packages:
-
-```shell
-sudo gitlab-backup create SKIP=remote
-```
-
-For installations from source:
-
-```shell
-sudo -u git -H bundle exec rake gitlab:backup:create SKIP=remote RAILS_ENV=production
-```
-
-#### Uploading to locally mounted shares
-
-You may also send backups to a mounted share (for example, `NFS`,`CIFS`, or
-`SMB`) by using the Fog [`Local`](https://github.com/fog/fog-local#usage)
-storage provider. The directory pointed to by the `local_root` key _must_ be
-owned by the `git` user _when mounted_ (mounting with the `uid=` of the `git`
-user for `CIFS` and `SMB`) or the user that you are executing the backup tasks
-as (for Omnibus packages, this is the `git` user).
-
-The `backup_upload_remote_directory` _must_ be set in addition to the
-`local_root` key. This is the sub directory inside the mounted directory that
-backups are copied to, and is created if it does not exist. If the
-directory that you want to copy the tarballs to is the root of your mounted
-directory, use `.` instead.
-
-Because file system performance may affect overall GitLab performance,
-[GitLab doesn't recommend using cloud-based file systems for storage](../administration/nfs.md#avoid-using-cloud-based-file-systems).
-
-For Omnibus GitLab packages:
-
-1. Edit `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- gitlab_rails['backup_upload_connection'] = {
- :provider => 'Local',
- :local_root => '/mnt/backups'
- }
-
- # The directory inside the mounted folder to copy backups to
- # Use '.' to store them in the root directory
- gitlab_rails['backup_upload_remote_directory'] = 'gitlab_backups'
- ```
-
-1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
- for the changes to take effect.
-
-For installations from source:
-
-1. Edit `home/git/gitlab/config/gitlab.yml`:
-
- ```yaml
- backup:
- upload:
- # Fog storage connection settings, see https://fog.io/storage/ .
- connection:
- provider: Local
- local_root: '/mnt/backups'
- # The directory inside the mounted folder to copy backups to
- # Use '.' to store them in the root directory
- remote_directory: 'gitlab_backups'
- ```
-
-1. [Restart GitLab](../administration/restart_gitlab.md#installations-from-source)
- for the changes to take effect.
-
-#### Backup archive permissions
-
-The backup archives created by GitLab (`1393513186_2014_02_27_gitlab_backup.tar`)
-have the owner/group `git`/`git` and 0600 permissions by default. This is
-meant to avoid other system users reading GitLab data. If you need the backup
-archives to have different permissions, you can use the `archive_permissions`
-setting.
-
-For Omnibus GitLab packages:
-
-1. Edit `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- gitlab_rails['backup_archive_permissions'] = 0644 # Makes the backup archives world-readable
- ```
-
-1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
- for the changes to take effect.
-
-For installations from source:
-
-1. Edit `/home/git/gitlab/config/gitlab.yml`:
-
- ```yaml
- backup:
- archive_permissions: 0644 # Makes the backup archives world-readable
- ```
-
-1. [Restart GitLab](../administration/restart_gitlab.md#installations-from-source)
- for the changes to take effect.
-
-#### Configuring cron to make daily backups
-
-WARNING:
-The following cron jobs do not [back up your GitLab configuration files](#storing-configuration-files)
-or [SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079).
-
-You can schedule a cron job that backs up your repositories and GitLab metadata.
-
-For Omnibus GitLab packages:
-
-1. Edit the crontab for the `root` user:
-
- ```shell
- sudo su -
- crontab -e
- ```
-
-1. There, add the following line to schedule the backup for everyday at 2 AM:
-
- ```plaintext
- 0 2 * * * /opt/gitlab/bin/gitlab-backup create CRON=1
- ```
-
- Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
-
-For installations from source:
-
-1. Edit the crontab for the `git` user:
-
- ```shell
- sudo -u git crontab -e
- ```
-
-1. Add the following lines at the bottom:
-
- ```plaintext
- # Create a full backup of the GitLab repositories and SQL database every day at 2am
- 0 2 * * * cd /home/git/gitlab && PATH=/usr/local/bin:/usr/bin:/bin bundle exec rake gitlab:backup:create RAILS_ENV=production CRON=1
- ```
-
-The `CRON=1` environment setting directs the backup script to hide all progress
-output if there aren't any errors. This is recommended to reduce cron spam.
-When troubleshooting backup problems, however, replace `CRON=1` with `--trace` to log verbosely.
-
-### Limit backup lifetime for local files (prune old backups)
-
-WARNING:
-The process described in this section don't work if you used a [custom filename](#backup-filename)
-for your backups.
-
-To prevent regular backups from using all your disk space, you may want to set a limited lifetime
-for backups. The next time the backup task runs, backups older than the `backup_keep_time` are
-pruned.
-
-This configuration option manages only local files. GitLab doesn't prune old
-files stored in a third-party [object storage](#uploading-backups-to-a-remote-cloud-storage)
-because the user may not have permission to list and delete files. It's
-recommended that you configure the appropriate retention policy for your object
-storage (for example, [AWS S3](https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-lifecycle.html)).
-
-For Omnibus GitLab packages:
-
-1. Edit `/etc/gitlab/gitlab.rb`:
-
- ```ruby
- ## Limit backup lifetime to 7 days - 604800 seconds
- gitlab_rails['backup_keep_time'] = 604800
- ```
-
-1. [Reconfigure GitLab](../administration/restart_gitlab.md#omnibus-gitlab-reconfigure)
- for the changes to take effect.
-
-For installations from source:
-
-1. Edit `/home/git/gitlab/config/gitlab.yml`:
-
- ```yaml
- backup:
- ## Limit backup lifetime to 7 days - 604800 seconds
- keep_time: 604800
- ```
-
-1. [Restart GitLab](../administration/restart_gitlab.md#installations-from-source)
- for the changes to take effect.
+For detailed information on backing up GitLab, see [Backup GitLab](backup_gitlab.md).
## Restore GitLab
-GitLab provides a command line interface to restore your entire installation,
-and is flexible enough to fit your needs.
-
-The [restore prerequisites section](#restore-prerequisites) includes crucial
-information. Be sure to read and test the complete restore process at least
-once before attempting to perform it in a production environment.
-
-You can restore a backup only to _the exact same version and type (CE/EE)_ of
-GitLab that you created it on (for example CE 9.1.0).
-
-If your backup is a different version than the current installation, you must
-[downgrade your GitLab installation](../update/package/downgrade.md)
-before restoring the backup.
-
-### Restore prerequisites
-
-You need to have a working GitLab installation before you can perform a
-restore. This is because the system user performing the restore actions (`git`)
-is usually not allowed to create or delete the SQL database needed to import
-data into (`gitlabhq_production`). All existing data is either erased
-(SQL) or moved to a separate directory (such as repositories and uploads).
-
-To restore a backup, you must restore `/etc/gitlab/gitlab-secrets.json`
-(for Omnibus packages) or `/home/git/gitlab/.secret` (for installations from
-source). This file contains the database encryption key,
-[CI/CD variables](../ci/variables/index.md), and
-variables used for [two-factor authentication](../user/profile/account/two_factor_authentication.md).
-If you fail to restore this encryption key file along with the application data
-backup, users with two-factor authentication enabled and GitLab Runner
-loses access to your GitLab server.
-
-You may also want to restore your previous `/etc/gitlab/gitlab.rb` (for Omnibus packages)
-or `/home/git/gitlab/config/gitlab.yml` (for installations from source) and
-any TLS keys, certificates (`/etc/gitlab/ssl`, `/etc/gitlab/trusted-certs`), or
-[SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079).
-
-Starting with GitLab 12.9, if an untarred backup (like the ones made with
-`SKIP=tar`) is found, and no backup is chosen with `BACKUP=<timestamp>`, the
-untarred backup is used.
-
-Depending on your case, you might want to run the restore command with one or
-more of the following options:
-
-- `BACKUP=timestamp_of_backup`: Required if more than one backup exists.
- Read what the [backup timestamp is about](#backup-timestamp).
-- `force=yes`: Doesn't ask if the `authorized_keys` file should get regenerated,
- and assumes 'yes' for warning about database tables being removed,
- enabling the `Write to authorized_keys file` setting, and updating LDAP
- providers.
-
-If you're restoring into directories that are mount points, you must ensure these directories are
-empty before attempting a restore. Otherwise, GitLab attempts to move these directories before
-restoring the new data, which causes an error.
-
-Read more about [configuring NFS mounts](../administration/nfs.md)
-
-### Restore for Omnibus GitLab installations
-
-This procedure assumes that:
-
-- You have installed the **exact same version and type (CE/EE)** of GitLab
- Omnibus with which the backup was created.
-- You have run `sudo gitlab-ctl reconfigure` at least once.
-- GitLab is running. If not, start it using `sudo gitlab-ctl start`.
-
-First ensure your backup tar file is in the backup directory described in the
-`gitlab.rb` configuration `gitlab_rails['backup_path']`. The default is
-`/var/opt/gitlab/backups`. The backup file needs to be owned by the `git` user.
-
-```shell
-sudo cp 11493107454_2018_04_25_10.6.4-ce_gitlab_backup.tar /var/opt/gitlab/backups/
-sudo chown git:git /var/opt/gitlab/backups/11493107454_2018_04_25_10.6.4-ce_gitlab_backup.tar
-```
-
-Stop the processes that are connected to the database. Leave the rest of GitLab
-running:
-
-```shell
-sudo gitlab-ctl stop puma
-sudo gitlab-ctl stop sidekiq
-# Verify
-sudo gitlab-ctl status
-```
-
-Next, restore the backup, specifying the timestamp of the backup you wish to
-restore:
-
-```shell
-# This command will overwrite the contents of your GitLab database!
-sudo gitlab-backup restore BACKUP=11493107454_2018_04_25_10.6.4-ce
-```
-
-Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:restore` instead.
-Some [known non-blocking error messages may appear](#restoring-database-backup-using-omnibus-packages-outputs-warnings).
-
-WARNING:
-`gitlab-rake gitlab:backup:restore` doesn't set the correct file system
-permissions on your Registry directory. This is a [known issue](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/62759).
-In GitLab 12.2 or later, you can use `gitlab-backup restore` to avoid this
-issue.
-
-If there's a GitLab version mismatch between your backup tar file and the
-installed version of GitLab, the restore command aborts with an error
-message. Install the [correct GitLab version](https://packages.gitlab.com/gitlab/),
-and then try again.
-
-WARNING:
-The restore command requires [additional parameters](#back-up-and-restore-for-installations-using-pgbouncer) when
-your installation is using PgBouncer, for either performance reasons or when using it with a Patroni cluster.
-
-Next, restore `/etc/gitlab/gitlab-secrets.json` if necessary,
-[as previously mentioned](#restore-prerequisites).
-
-Reconfigure, restart and [check](../administration/raketasks/maintenance.md#check-gitlab-configuration) GitLab:
-
-```shell
-sudo gitlab-ctl reconfigure
-sudo gitlab-ctl restart
-sudo gitlab-rake gitlab:check SANITIZE=true
-```
-
-In GitLab 13.1 and later, check [database values can be decrypted](../administration/raketasks/check.md#verify-database-values-can-be-decrypted-using-the-current-secrets)
-especially if `/etc/gitlab/gitlab-secrets.json` was restored, or if a different server is
-the target for the restore.
-
-```shell
-sudo gitlab-rake gitlab:doctor:secrets
-```
-
-For added assurance, you can perform [an integrity check on the uploaded files](../administration/raketasks/check.md#uploaded-files-integrity):
-
-```shell
-sudo gitlab-rake gitlab:artifacts:check
-sudo gitlab-rake gitlab:lfs:check
-sudo gitlab-rake gitlab:uploads:check
-```
-
-### Restore for Docker image and GitLab Helm chart installations
-
-For GitLab installations using the Docker image or the GitLab Helm chart on a
-Kubernetes cluster, the restore task expects the restore directories to be
-empty. However, with Docker and Kubernetes volume mounts, some system level
-directories may be created at the volume roots, such as the `lost+found`
-directory found in Linux operating systems. These directories are usually owned
-by `root`, which can cause access permission errors since the restore Rake task
-runs as the `git` user. To restore a GitLab installation, users have to confirm
-the restore target directories are empty.
-
-For both these installation types, the backup tarball has to be available in
-the backup location (default location is `/var/opt/gitlab/backups`).
-
-For Docker installations, the restore task can be run from host:
-
-```shell
-# Stop the processes that are connected to the database
-docker exec -it <name of container> gitlab-ctl stop puma
-docker exec -it <name of container> gitlab-ctl stop sidekiq
-
-# Verify that the processes are all down before continuing
-docker exec -it <name of container> gitlab-ctl status
-
-# Run the restore. NOTE: "_gitlab_backup.tar" is omitted from the name
-docker exec -it <name of container> gitlab-backup restore BACKUP=11493107454_2018_04_25_10.6.4-ce
-
-# Restart the GitLab container
-docker restart <name of container>
-
-# Check GitLab
-docker exec -it <name of container> gitlab-rake gitlab:check SANITIZE=true
-```
-
-Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
-
-WARNING:
-`gitlab-rake gitlab:backup:restore` doesn't set the correct file system
-permissions on your Registry directory. This is a [known issue](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/62759).
-In GitLab 12.2 or later, you can use `gitlab-backup restore` to avoid this
-issue.
-
-The GitLab Helm chart uses a different process, documented in
-[restoring a GitLab Helm chart installation](https://gitlab.com/gitlab-org/charts/gitlab/blob/master/doc/backup-restore/restore.md).
-
-### Restore for installation from source
-
-First, ensure your backup tar file is in the backup directory described in the
-`gitlab.yml` configuration:
-
-```yaml
-## Backup settings
-backup:
- path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)
-```
-
-The default is `/home/git/gitlab/tmp/backups`, and it needs to be owned by the `git` user. Now, you can begin the backup procedure:
-
-```shell
-# Stop processes that are connected to the database
-sudo service gitlab stop
-
-sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production
-```
-
-Example output:
-
-```plaintext
-Unpacking backup... [DONE]
-Restoring database tables:
--- create_table("events", {:force=>true})
- -> 0.2231s
-[...]
-- Loading fixture events...[DONE]
-- Loading fixture issues...[DONE]
-- Loading fixture keys...[SKIPPING]
-- Loading fixture merge_requests...[DONE]
-- Loading fixture milestones...[DONE]
-- Loading fixture namespaces...[DONE]
-- Loading fixture notes...[DONE]
-- Loading fixture projects...[DONE]
-- Loading fixture protected_branches...[SKIPPING]
-- Loading fixture schema_migrations...[DONE]
-- Loading fixture services...[SKIPPING]
-- Loading fixture snippets...[SKIPPING]
-- Loading fixture taggings...[SKIPPING]
-- Loading fixture tags...[SKIPPING]
-- Loading fixture users...[DONE]
-- Loading fixture users_projects...[DONE]
-- Loading fixture web_hooks...[SKIPPING]
-- Loading fixture wikis...[SKIPPING]
-Restoring repositories:
-- Restoring repository abcd... [DONE]
-- Object pool 1 ...
-Deleting tmp directories...[DONE]
-```
-
-Next, restore `/home/git/gitlab/.secret` if necessary, [as previously mentioned](#restore-prerequisites).
-
-Restart GitLab:
-
-```shell
-sudo service gitlab restart
-```
-
-### Restoring only one or a few projects or groups from a backup
-
-Although the Rake task used to restore a GitLab instance doesn't support
-restoring a single project or group, you can use a workaround by restoring
-your backup to a separate, temporary GitLab instance, and then export your
-project or group from there:
-
-1. [Install a new GitLab](../install/index.md) instance at the same version as
- the backed-up instance from which you want to restore.
-1. [Restore the backup](#restore-gitlab) into this new instance, then
- export your [project](../user/project/settings/import_export.md)
- or [group](../user/group/settings/import_export.md). Be sure to read the
- **Important Notes** on either export feature's documentation to understand
- what is and isn't exported.
-1. After the export is complete, go to the old instance and then import it.
-1. After importing the projects or groups that you wanted is complete, you may
- delete the new, temporary GitLab instance.
-
-A feature request to provide direct restore of individual projects or groups
-is being discussed in [issue #17517](https://gitlab.com/gitlab-org/gitlab/-/issues/17517).
-
-### Restore options
-
-The command line tool GitLab provides to restore from backup can accept more
-options.
-
-#### Excluding tasks on restore
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/19347) in GitLab 14.10.
-
-You can exclude specific tasks on restore by adding the environment variable `SKIP`, whose values are a comma-separated list of the following options:
-
-- `db` (database)
-- `uploads` (attachments)
-- `builds` (CI job output logs)
-- `artifacts` (CI job artifacts)
-- `lfs` (LFS objects)
-- `terraform_state` (Terraform states)
-- `registry` (Container Registry images)
-- `pages` (Pages content)
-- `repositories` (Git repositories data)
-- `packages` (Packages)
-
-For Omnibus GitLab packages:
-
-```shell
-sudo gitlab-backup restore BACKUP=timestamp_of_backup SKIP=db,uploads
-```
-
-For installations from source:
-
-```shell
-sudo -u git -H bundle exec rake gitlab:backup:restore BACKUP=timestamp_of_backup SKIP=db,uploads RAILS_ENV=production
-```
-
-#### Restore specific repository storages
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86896) in GitLab 15.0.
-
-When using [multiple repository storages](../administration/repository_storage_paths.md),
-repositories from specific repository storages can be restored separately
-using the `REPOSITORIES_STORAGES` option. The option accepts a comma-separated list of
-storage names.
-
-For example, for Omnibus GitLab installations:
-
-```shell
-sudo gitlab-backup restore BACKUP=timestamp_of_backup REPOSITORIES_STORAGES=storage1,storage2
-```
-
-For example, for installations from source:
-
-```shell
-sudo -u git -H bundle exec rake gitlab:backup:restore BACKUP=timestamp_of_backup REPOSITORIES_STORAGES=storage1,storage2
-```
-
-#### Restore specific repositories
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88094) in GitLab 15.1.
-
-You can restore specific repositories using the `REPOSITORIES_PATHS` option.
-The option accepts a comma-separated list of project and group paths. If you
-specify a group path, all repositories in all projects in the group and
-descendent groups are included. The project and group repositories must exist
-within the specified backup.
-
-For example, to restore all repositories for all projects in **Group A** (`group-a`), and the repository for **Project C** in **Group B** (`group-b/project-c`):
-
-- Omnibus GitLab installations:
-
- ```shell
- sudo gitlab-backup restore BACKUP=timestamp_of_backup REPOSITORIES_PATHS=group-a,group-b/project-c
- ```
-
-- Installations from source:
-
- ```shell
- sudo -u git -H bundle exec rake gitlab:backup:restore BACKUP=timestamp_of_backup REPOSITORIES_PATHS=group-a,group-b/project-c
- ```
+For detailed information on restoring GitLab, see [Restore GitLab](restore_gitlab.md).
## Alternative backup strategies
@@ -1341,7 +84,7 @@ practical use.
### Back up repository data separately
-First, ensure you back up existing GitLab data while [skipping repositories](#excluding-specific-directories-from-the-backup):
+First, ensure you back up existing GitLab data while [skipping repositories](backup_gitlab.md#excluding-specific-directories-from-the-backup):
```shell
# for Omnibus GitLab package installations
@@ -1710,7 +453,7 @@ For more information, see:
### When the secrets file is lost
-If you didn't [back up the secrets file](#storing-configuration-files), you
+If you didn't [back up the secrets file](backup_gitlab.md#storing-configuration-files), you
must complete several steps to get GitLab working properly again.
The secrets file is responsible for storing the encryption key for the columns
diff --git a/doc/raketasks/restore_gitlab.md b/doc/raketasks/restore_gitlab.md
new file mode 100644
index 00000000000..9d9a4d7b8c8
--- /dev/null
+++ b/doc/raketasks/restore_gitlab.md
@@ -0,0 +1,367 @@
+---
+stage: Systems
+group: Geo
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
+---
+
+# Restore GitLab
+
+GitLab provides a command line interface to restore your entire installation,
+and is flexible enough to fit your needs.
+
+The [restore prerequisites section](#restore-prerequisites) includes crucial
+information. Be sure to read and test the complete restore process at least
+once before attempting to perform it in a production environment.
+
+You can restore a backup only to _the exact same version and type (CE/EE)_ of
+GitLab that you created it on (for example CE 9.1.0).
+
+If your backup is a different version than the current installation, you must
+[downgrade your GitLab installation](../update/package/downgrade.md)
+before restoring the backup.
+
+## Restore prerequisites
+
+You need to have a working GitLab installation before you can perform a
+restore. This is because the system user performing the restore actions (`git`)
+is usually not allowed to create or delete the SQL database needed to import
+data into (`gitlabhq_production`). All existing data is either erased
+(SQL) or moved to a separate directory (such as repositories and uploads).
+
+To restore a backup, you must restore `/etc/gitlab/gitlab-secrets.json`
+(for Omnibus packages) or `/home/git/gitlab/.secret` (for installations from
+source). This file contains the database encryption key,
+[CI/CD variables](../ci/variables/index.md), and
+variables used for [two-factor authentication](../user/profile/account/two_factor_authentication.md).
+If you fail to restore this encryption key file along with the application data
+backup, users with two-factor authentication enabled and GitLab Runner
+loses access to your GitLab server.
+
+You may also want to restore your previous `/etc/gitlab/gitlab.rb` (for Omnibus packages)
+or `/home/git/gitlab/config/gitlab.yml` (for installations from source) and
+any TLS keys, certificates (`/etc/gitlab/ssl`, `/etc/gitlab/trusted-certs`), or
+[SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079).
+
+Starting with GitLab 12.9, if an untarred backup (like the ones made with
+`SKIP=tar`) is found, and no backup is chosen with `BACKUP=<timestamp>`, the
+untarred backup is used.
+
+Depending on your case, you might want to run the restore command with one or
+more of the following options:
+
+- `BACKUP=timestamp_of_backup`: Required if more than one backup exists.
+ Read what the [backup timestamp is about](backup_restore.md#backup-timestamp).
+- `force=yes`: Doesn't ask if the `authorized_keys` file should get regenerated,
+ and assumes 'yes' for warning about database tables being removed,
+ enabling the `Write to authorized_keys file` setting, and updating LDAP
+ providers.
+
+If you're restoring into directories that are mount points, you must ensure these directories are
+empty before attempting a restore. Otherwise, GitLab attempts to move these directories before
+restoring the new data, which causes an error.
+
+Read more about [configuring NFS mounts](../administration/nfs.md)
+
+## Restore for Omnibus GitLab installations
+
+This procedure assumes that:
+
+- You have installed the **exact same version and type (CE/EE)** of GitLab
+ Omnibus with which the backup was created.
+- You have run `sudo gitlab-ctl reconfigure` at least once.
+- GitLab is running. If not, start it using `sudo gitlab-ctl start`.
+
+First ensure your backup tar file is in the backup directory described in the
+`gitlab.rb` configuration `gitlab_rails['backup_path']`. The default is
+`/var/opt/gitlab/backups`. The backup file needs to be owned by the `git` user.
+
+```shell
+sudo cp 11493107454_2018_04_25_10.6.4-ce_gitlab_backup.tar /var/opt/gitlab/backups/
+sudo chown git:git /var/opt/gitlab/backups/11493107454_2018_04_25_10.6.4-ce_gitlab_backup.tar
+```
+
+Stop the processes that are connected to the database. Leave the rest of GitLab
+running:
+
+```shell
+sudo gitlab-ctl stop puma
+sudo gitlab-ctl stop sidekiq
+# Verify
+sudo gitlab-ctl status
+```
+
+Next, restore the backup, specifying the timestamp of the backup you wish to
+restore:
+
+```shell
+# This command will overwrite the contents of your GitLab database!
+sudo gitlab-backup restore BACKUP=11493107454_2018_04_25_10.6.4-ce
+```
+
+Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:restore` instead.
+Some [known non-blocking error messages may appear](backup_restore.md#restoring-database-backup-using-omnibus-packages-outputs-warnings).
+
+WARNING:
+`gitlab-rake gitlab:backup:restore` doesn't set the correct file system
+permissions on your Registry directory. This is a [known issue](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/62759).
+In GitLab 12.2 or later, you can use `gitlab-backup restore` to avoid this
+issue.
+
+If there's a GitLab version mismatch between your backup tar file and the
+installed version of GitLab, the restore command aborts with an error
+message. Install the [correct GitLab version](https://packages.gitlab.com/gitlab/),
+and then try again.
+
+WARNING:
+The restore command requires [additional parameters](backup_restore.md#back-up-and-restore-for-installations-using-pgbouncer) when
+your installation is using PgBouncer, for either performance reasons or when using it with a Patroni cluster.
+
+Next, restore `/etc/gitlab/gitlab-secrets.json` if necessary,
+[as previously mentioned](#restore-prerequisites).
+
+Reconfigure, restart and [check](../administration/raketasks/maintenance.md#check-gitlab-configuration) GitLab:
+
+```shell
+sudo gitlab-ctl reconfigure
+sudo gitlab-ctl restart
+sudo gitlab-rake gitlab:check SANITIZE=true
+```
+
+In GitLab 13.1 and later, check [database values can be decrypted](../administration/raketasks/check.md#verify-database-values-can-be-decrypted-using-the-current-secrets)
+especially if `/etc/gitlab/gitlab-secrets.json` was restored, or if a different server is
+the target for the restore.
+
+```shell
+sudo gitlab-rake gitlab:doctor:secrets
+```
+
+For added assurance, you can perform [an integrity check on the uploaded files](../administration/raketasks/check.md#uploaded-files-integrity):
+
+```shell
+sudo gitlab-rake gitlab:artifacts:check
+sudo gitlab-rake gitlab:lfs:check
+sudo gitlab-rake gitlab:uploads:check
+```
+
+## Restore for Docker image and GitLab Helm chart installations
+
+For GitLab installations using the Docker image or the GitLab Helm chart on a
+Kubernetes cluster, the restore task expects the restore directories to be
+empty. However, with Docker and Kubernetes volume mounts, some system level
+directories may be created at the volume roots, such as the `lost+found`
+directory found in Linux operating systems. These directories are usually owned
+by `root`, which can cause access permission errors since the restore Rake task
+runs as the `git` user. To restore a GitLab installation, users have to confirm
+the restore target directories are empty.
+
+For both these installation types, the backup tarball has to be available in
+the backup location (default location is `/var/opt/gitlab/backups`).
+
+For Docker installations, the restore task can be run from host:
+
+```shell
+# Stop the processes that are connected to the database
+docker exec -it <name of container> gitlab-ctl stop puma
+docker exec -it <name of container> gitlab-ctl stop sidekiq
+
+# Verify that the processes are all down before continuing
+docker exec -it <name of container> gitlab-ctl status
+
+# Run the restore. NOTE: "_gitlab_backup.tar" is omitted from the name
+docker exec -it <name of container> gitlab-backup restore BACKUP=11493107454_2018_04_25_10.6.4-ce
+
+# Restart the GitLab container
+docker restart <name of container>
+
+# Check GitLab
+docker exec -it <name of container> gitlab-rake gitlab:check SANITIZE=true
+```
+
+Users of GitLab 12.1 and earlier should use the command `gitlab-rake gitlab:backup:create` instead.
+
+WARNING:
+`gitlab-rake gitlab:backup:restore` doesn't set the correct file system
+permissions on your Registry directory. This is a [known issue](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/62759).
+In GitLab 12.2 or later, you can use `gitlab-backup restore` to avoid this
+issue.
+
+The GitLab Helm chart uses a different process, documented in
+[restoring a GitLab Helm chart installation](https://gitlab.com/gitlab-org/charts/gitlab/blob/master/doc/backup-restore/restore.md).
+
+## Restore for installation from source
+
+First, ensure your backup tar file is in the backup directory described in the
+`gitlab.yml` configuration:
+
+```yaml
+## Backup settings
+backup:
+ path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/)
+```
+
+The default is `/home/git/gitlab/tmp/backups`, and it needs to be owned by the `git` user. Now, you can begin the backup procedure:
+
+```shell
+# Stop processes that are connected to the database
+sudo service gitlab stop
+
+sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production
+```
+
+Example output:
+
+```plaintext
+Unpacking backup... [DONE]
+Restoring database tables:
+-- create_table("events", {:force=>true})
+ -> 0.2231s
+[...]
+- Loading fixture events...[DONE]
+- Loading fixture issues...[DONE]
+- Loading fixture keys...[SKIPPING]
+- Loading fixture merge_requests...[DONE]
+- Loading fixture milestones...[DONE]
+- Loading fixture namespaces...[DONE]
+- Loading fixture notes...[DONE]
+- Loading fixture projects...[DONE]
+- Loading fixture protected_branches...[SKIPPING]
+- Loading fixture schema_migrations...[DONE]
+- Loading fixture services...[SKIPPING]
+- Loading fixture snippets...[SKIPPING]
+- Loading fixture taggings...[SKIPPING]
+- Loading fixture tags...[SKIPPING]
+- Loading fixture users...[DONE]
+- Loading fixture users_projects...[DONE]
+- Loading fixture web_hooks...[SKIPPING]
+- Loading fixture wikis...[SKIPPING]
+Restoring repositories:
+- Restoring repository abcd... [DONE]
+- Object pool 1 ...
+Deleting tmp directories...[DONE]
+```
+
+Next, restore `/home/git/gitlab/.secret` if necessary, [as previously mentioned](#restore-prerequisites).
+
+Restart GitLab:
+
+```shell
+sudo service gitlab restart
+```
+
+## Restoring only one or a few projects or groups from a backup
+
+Although the Rake task used to restore a GitLab instance doesn't support
+restoring a single project or group, you can use a workaround by restoring
+your backup to a separate, temporary GitLab instance, and then export your
+project or group from there:
+
+1. [Install a new GitLab](../install/index.md) instance at the same version as
+ the backed-up instance from which you want to restore.
+1. [Restore the backup](#restore-gitlab) into this new instance, then
+ export your [project](../user/project/settings/import_export.md)
+ or [group](../user/group/settings/import_export.md). Be sure to read the
+ **Important Notes** on either export feature's documentation to understand
+ what is and isn't exported.
+1. After the export is complete, go to the old instance and then import it.
+1. After importing the projects or groups that you wanted is complete, you may
+ delete the new, temporary GitLab instance.
+
+A feature request to provide direct restore of individual projects or groups
+is being discussed in [issue #17517](https://gitlab.com/gitlab-org/gitlab/-/issues/17517).
+
+## Restore options
+
+The command line tool GitLab provides to restore from backup can accept more
+options.
+
+### Disabling prompts during restore
+
+During a restore from backup, the restore script may ask for confirmation before
+proceeding. If you wish to disable these prompts, you can set the `GITLAB_ASSUME_YES`
+environment variable to `1`.
+
+For Omnibus GitLab packages:
+
+```shell
+sudo GITLAB_ASSUME_YES=1 gitlab-backup restore
+```
+
+For installations from source:
+
+```shell
+sudo -u git -H GITLAB_ASSUME_YES=1 bundle exec rake gitlab:backup:restore RAILS_ENV=production
+```
+
+### Excluding tasks on restore
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/19347) in GitLab 14.10.
+
+You can exclude specific tasks on restore by adding the environment variable `SKIP`, whose values are a comma-separated list of the following options:
+
+- `db` (database)
+- `uploads` (attachments)
+- `builds` (CI job output logs)
+- `artifacts` (CI job artifacts)
+- `lfs` (LFS objects)
+- `terraform_state` (Terraform states)
+- `registry` (Container Registry images)
+- `pages` (Pages content)
+- `repositories` (Git repositories data)
+- `packages` (Packages)
+
+For Omnibus GitLab packages:
+
+```shell
+sudo gitlab-backup restore BACKUP=timestamp_of_backup SKIP=db,uploads
+```
+
+For installations from source:
+
+```shell
+sudo -u git -H bundle exec rake gitlab:backup:restore BACKUP=timestamp_of_backup SKIP=db,uploads RAILS_ENV=production
+```
+
+### Restore specific repository storages
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86896) in GitLab 15.0.
+
+When using [multiple repository storages](../administration/repository_storage_paths.md),
+repositories from specific repository storages can be restored separately
+using the `REPOSITORIES_STORAGES` option. The option accepts a comma-separated list of
+storage names.
+
+For example, for Omnibus GitLab installations:
+
+```shell
+sudo gitlab-backup restore BACKUP=timestamp_of_backup REPOSITORIES_STORAGES=storage1,storage2
+```
+
+For example, for installations from source:
+
+```shell
+sudo -u git -H bundle exec rake gitlab:backup:restore BACKUP=timestamp_of_backup REPOSITORIES_STORAGES=storage1,storage2
+```
+
+### Restore specific repositories
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88094) in GitLab 15.1.
+
+You can restore specific repositories using the `REPOSITORIES_PATHS` option.
+The option accepts a comma-separated list of project and group paths. If you
+specify a group path, all repositories in all projects in the group and
+descendent groups are included. The project and group repositories must exist
+within the specified backup.
+
+For example, to restore all repositories for all projects in **Group A** (`group-a`), and the repository for **Project C** in **Group B** (`group-b/project-c`):
+
+- Omnibus GitLab installations:
+
+ ```shell
+ sudo gitlab-backup restore BACKUP=timestamp_of_backup REPOSITORIES_PATHS=group-a,group-b/project-c
+ ```
+
+- Installations from source:
+
+ ```shell
+ sudo -u git -H bundle exec rake gitlab:backup:restore BACKUP=timestamp_of_backup REPOSITORIES_PATHS=group-a,group-b/project-c
+ ```
diff --git a/doc/update/package/downgrade.md b/doc/update/package/downgrade.md
index 7b8b4da0383..f48ba31568f 100644
--- a/doc/update/package/downgrade.md
+++ b/doc/update/package/downgrade.md
@@ -79,5 +79,5 @@ Steps:
sudo gitlab-ctl reconfigure
```
-1. [Restore GitLab](../../raketasks/backup_restore.md#restore-for-omnibus-gitlab-installations)
+1. [Restore GitLab](../../raketasks/restore_gitlab.md#restore-for-omnibus-gitlab-installations)
to complete the downgrade.
diff --git a/doc/update/plan_your_upgrade.md b/doc/update/plan_your_upgrade.md
index cdc3ec39f9a..2374856ff0c 100644
--- a/doc/update/plan_your_upgrade.md
+++ b/doc/update/plan_your_upgrade.md
@@ -87,7 +87,7 @@ to roll back GitLab to a working state if there's a problem with the upgrade:
- Create a [GitLab backup](../raketasks/backup_restore.md).
Make sure to follow the instructions based on your installation method.
- Don't forget to back up the [secrets and configuration files](../raketasks/backup_restore.md#storing-configuration-files).
+ Don't forget to back up the [secrets and configuration files](../raketasks/backup_gitlab.md#storing-configuration-files).
- Alternatively, create a snapshot of your instance. If this is a multi-node
installation, you must snapshot every node.
**This process is out of scope for GitLab Support.**
@@ -103,7 +103,7 @@ To restore your GitLab backup:
the versions of the backed up and the new GitLab instance must be the same.
- [Restore GitLab](../raketasks/backup_restore.md#restore-gitlab).
Make sure to follow the instructions based on your installation method.
- Confirm that the [secrets and configuration files](../raketasks/backup_restore.md#storing-configuration-files) are also restored.
+ Confirm that the [secrets and configuration files](../raketasks/backup_gitlab.md#storing-configuration-files) are also restored.
- If restoring from a snapshot, know the steps to do this.
**This process is out of scope for GitLab Support.**
diff --git a/doc/user/admin_area/settings/incident_management_rate_limits.md b/doc/user/admin_area/settings/incident_management_rate_limits.md
index 6226ec23be7..ed2d707af0a 100644
--- a/doc/user/admin_area/settings/incident_management_rate_limits.md
+++ b/doc/user/admin_area/settings/incident_management_rate_limits.md
@@ -12,9 +12,9 @@ info: To determine the technical writer assigned to the Stage/Group associated w
You can limit the number of inbound alerts for [incidents](../../../operations/incident_management/incidents.md)
that can be created in a period of time. The inbound [incident management](../../../operations/incident_management/index.md)
alert limit can help prevent overloading your incident responders by reducing the
-number of alerts or duplicate issues.
+number of alerts or duplicate issues.
-As an example, if you set a limit of `10` requests every `60` seconds,
+As an example, if you set a limit of `10` requests every `60` seconds,
and `11` requests are sent to an [alert integration endpoint](../../../operations/incident_management/integrations.md) within one minute,
the eleventh request is blocked. Access to the endpoint is allowed again after one minute.
diff --git a/doc/user/analytics/index.md b/doc/user/analytics/index.md
index 61e652496e5..b8c0e9af745 100644
--- a/doc/user/analytics/index.md
+++ b/doc/user/analytics/index.md
@@ -76,6 +76,8 @@ Deployment frequency displays in several charts:
- [Project-level value stream analytics](value_stream_analytics.md)
- [CI/CD analytics](ci_cd_analytics.md)
+To retrieve metrics for deployment frequency, use the [GraphQL](../../api/graphql/reference/index.md) or the [REST](../../api/dora/metrics.md) APIs.
+
### Lead time for changes
Lead time for changes measures the time to deliver a feature once it has been developed,
@@ -87,6 +89,8 @@ Lead time for changes displays in several charts:
- [Project-level value stream analytics](value_stream_analytics.md)
- [CI/CD analytics](ci_cd_analytics.md)
+To retrieve metrics for lead time for changes, use the [GraphQL](../../api/graphql/reference/index.md) or the [REST](../../api/dora/metrics.md) APIs.
+
### Time to restore service
Time to restore service measures how long it takes an organization to recover from a failure in production.
@@ -126,7 +130,7 @@ To retrieve metrics for change failure rate, use the [GraphQL](../../api/graphql
| `deployment_frequency` | Group | [GitLab 13.10 and later](../../api/dora/metrics.md) | GitLab 13.12 and later | |
| `lead_time_for_changes` | Project | [GitLab 13.10 and later](../../api/dora/metrics.md) | GitLab 13.11 and later | Unit in seconds. Aggregation method is median. |
| `lead_time_for_changes` | Group | [GitLab 13.10 and later](../../api/dora/metrics.md) | GitLab 14.0 and later | Unit in seconds. Aggregation method is median. |
-| `time_to_restore_service` | Project and group | [GitLab 14.9 and later](../../api/dora/metrics.md) | Not supported | |
+| `time_to_restore_service` | Project and group | [GitLab 14.9 and later](../../api/dora/metrics.md) | GitLab 15.1 and later | Unit in days. Aggregation method is median. |
| `change_failure_rate` | Project and group | [GitLab 14.10 and later](../../api/dora/metrics.md) | Not supported | |
## Definitions
diff --git a/doc/user/application_security/index.md b/doc/user/application_security/index.md
index b5f9ba2ca3b..90893a01462 100644
--- a/doc/user/application_security/index.md
+++ b/doc/user/application_security/index.md
@@ -421,7 +421,7 @@ You can always find supported and deprecated schema versions in the [source code
This feature was [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/354928) in GitLab 14.9
and [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85400) in GitLab 15.0.
-
+
<!--- end_remove -->
## Interact with findings and vulnerabilities
diff --git a/doc/user/group/value_stream_analytics/index.md b/doc/user/group/value_stream_analytics/index.md
index e2a49df616a..960552cc10f 100644
--- a/doc/user/group/value_stream_analytics/index.md
+++ b/doc/user/group/value_stream_analytics/index.md
@@ -66,7 +66,7 @@ The table shows a list of related workflow items for the selected stage. Based o
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/323982) in GitLab 13.12.
The **Overview** dashboard in value stream analytics shows key metrics and DORA metrics of group performance. Based on the filter you select,
-the dashboard automatically aggregates DORA metrics and displays the current status of the value stream.
+the dashboard automatically aggregates DORA metrics and displays the current status of the value stream. Select a DORA metric to view its chart.
To view deployment metrics, you must have a
[production environment configured](../../../ci/environments/index.md#deployment-tier-of-environments).
diff --git a/doc/user/project/merge_requests/img/attention_request_list_v14_10.png b/doc/user/project/merge_requests/img/attention_request_list_v14_10.png
deleted file mode 100644
index 00427a0aa40..00000000000
--- a/doc/user/project/merge_requests/img/attention_request_list_v14_10.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/img/attention_request_sidebar_v14_10.png b/doc/user/project/merge_requests/img/attention_request_sidebar_v14_10.png
deleted file mode 100644
index 174cf01dbb0..00000000000
--- a/doc/user/project/merge_requests/img/attention_request_sidebar_v14_10.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/index.md b/doc/user/project/merge_requests/index.md
index b7cb6030e48..a7a669d3b75 100644
--- a/doc/user/project/merge_requests/index.md
+++ b/doc/user/project/merge_requests/index.md
@@ -251,53 +251,6 @@ This feature works only when a merge request is merged. Selecting **Remove sourc
after merging does not retarget open merge requests. This improvement is
[proposed as a follow-up](https://gitlab.com/gitlab-org/gitlab/-/issues/321559).
-## Request attention to a merge request
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/343528) in GitLab 14.10 [with a flag](../../../administration/feature_flags.md) named `mr_attention_requests`. Disabled by default.
-
-FLAG:
-On self-managed GitLab, by default this feature is not available. To make it available, ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named `mr_attention_requests`.
-On GitLab.com, this feature is dependent on the enablement status of the feature flag. Refer to the [enablement issue](https://gitlab.com/gitlab-org/gitlab/-/issues/343528) for details.
-
-To tell a merge request's assignee or reviewer that their attention is
-needed on a merge request, you can request their attention. If an assignee or a
-reviewer has their attention requested on a merge request, the **Attention request**
-icon (**{attention}**) is displayed as a solid icon (**{attention-solid}**) on
-the merge request list page:
-
-![Attention request icon](img/attention_request_list_v14_10.png)
-
-To view a list of merge requests that need your attention:
-
-1. On the top bar, select **Merge requests** (**{merge-request}**).
-1. Select **Attention requests**.
-
-To request attention from another user, use the `/attention @user`
-[quick action](../quick_actions.md) or:
-
-1. Go to the merge request.
-1. On the right sidebar, identify the user you want to request attention from.
-1. Next to the user's name, select **Request attention** (**{attention}**), and the appearance
- of the icon changes:
-
- ![Attention request toggle](img/attention_request_sidebar_v14_10.png)
-
-### Remove an attention request
-
-If your attention was requested as an assignee or reviewer, it's removed when you:
-
-- Manually remove the attention request by selecting **Remove attention request** (**{attention-solid}**).
-- Approve the merge request.
-- Add a new user as an assignee or reviewer.
-- Request the attention of a different assignee or reviewer.
-- Remove yourself (or are removed by someone else) as an assignee or reviewer.
-- Merge or close the merge request.
-
-If you are both the assignee and a reviewer on a merge request, you receive
-only one attention request, which is synced across both duties. If the
-attention request is removed from you, either as an assignee or a reviewer,
-it is removed from both your duties.
-
## Merge request workflows
For a software developer working in a team:
diff --git a/doc/user/project/merge_requests/reviews/index.md b/doc/user/project/merge_requests/reviews/index.md
index 8f77ce90436..c382a844fc0 100644
--- a/doc/user/project/merge_requests/reviews/index.md
+++ b/doc/user/project/merge_requests/reviews/index.md
@@ -113,12 +113,6 @@ This example shows reviewers and approval rules in a merge request sidebar:
### Request a new review
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/293933) in GitLab 13.9.
-> - [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/357271) in GitLab 14.10.
-
-WARNING:
-This feature is in its end-of-life process. It is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/357271)
-in GitLab 14.10, and is planned for [removal](https://gitlab.com/gitlab-org/gitlab/-/issues/357271) in GitLab 15.0.
-Use [attention requests](../index.md#request-attention-to-a-merge-request) instead.
After a reviewer completes their [merge request reviews](../../../discussions/index.md),
the author of the merge request can request a new review from the reviewer:
diff --git a/doc/user/project/quick_actions.md b/doc/user/project/quick_actions.md
index d5a7058d3d2..96e51b061ee 100644
--- a/doc/user/project/quick_actions.md
+++ b/doc/user/project/quick_actions.md
@@ -55,7 +55,6 @@ threads. Some quick actions might not be available to all subscription tiers.
| `/assign me` | **{check-circle}** Yes | **{check-circle}** Yes | **{dotted-circle}** No | Assign yourself. |
| `/assign_reviewer @user1 @user2` or `/reviewer @user1 @user2` or `/request_review @user1 @user2` | **{dotted-circle}** No | **{check-circle}** Yes | **{dotted-circle}** No | Assign one or more users as reviewers. |
| `/assign_reviewer me` or `/reviewer me` or `/request_review me` | **{dotted-circle}** No | **{check-circle}** Yes | **{dotted-circle}** No | Assign yourself as a reviewer. |
-| `/attention @user1` | **{dotted-circle}** No | **{check-circle}** Yes | **{dotted-circle}** No | [Request attention](merge_requests/index.md#request-attention-to-a-merge-request) to a merge request from a user. |
| `/award :emoji:` | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | Toggle emoji award. |
| `/child_epic <epic>` | **{dotted-circle}** No | **{dotted-circle}** No | **{check-circle}** Yes | Add child epic to `<epic>`. The `<epic>` value should be in the format of `&epic`, `group&epic`, or a URL to an epic ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/7330) in GitLab 12.0). |
| `/clear_health_status` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Clear [health status](issues/managing_issues.md#health-status) ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/213814) in GitLab 14.7). |