summaryrefslogtreecommitdiff
path: root/doc/raketasks
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-19 01:45:44 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-19 01:45:44 +0000
commit85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch)
tree9160f299afd8c80c038f08e1545be119f5e3f1e1 /doc/raketasks
parent15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff)
downloadgitlab-ce-85dc423f7090da0a52c73eb66faf22ddb20efff9.tar.gz
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'doc/raketasks')
-rw-r--r--doc/raketasks/README.md2
-rw-r--r--doc/raketasks/backup_restore.md66
-rw-r--r--doc/raketasks/import.md24
3 files changed, 77 insertions, 15 deletions
diff --git a/doc/raketasks/README.md b/doc/raketasks/README.md
index 54b504bbfe8..523486d5137 100644
--- a/doc/raketasks/README.md
+++ b/doc/raketasks/README.md
@@ -24,7 +24,7 @@ The following are available Rake tasks:
| [Elasticsearch](../integration/elasticsearch.md#gitlab-elasticsearch-rake-tasks) **(STARTER ONLY)** | Maintain Elasticsearch in a GitLab instance. |
| [Enable namespaces](features.md) | Enable usernames and namespaces for user projects. |
| [General maintenance](../administration/raketasks/maintenance.md) | General maintenance and self-check tasks. |
-| [Geo maintenance](../administration/raketasks/geo.md) **(PREMIUM ONLY)** | [Geo](../administration/geo/replication/index.md)-related maintenance. |
+| [Geo maintenance](../administration/raketasks/geo.md) **(PREMIUM ONLY)** | [Geo](../administration/geo/index.md)-related maintenance. |
| [GitHub import](../administration/raketasks/github_import.md) | Retrieve and import repositories from GitHub. |
| [Import repositories](import.md) | Import bare repositories into your GitLab instance. |
| [Import large project exports](../development/import_project.md#importing-via-a-rake-task) | Import large GitLab [project exports](../user/project/settings/import_export.md). |
diff --git a/doc/raketasks/backup_restore.md b/doc/raketasks/backup_restore.md
index 2163cf22944..68b076258ce 100644
--- a/doc/raketasks/backup_restore.md
+++ b/doc/raketasks/backup_restore.md
@@ -16,7 +16,7 @@ remember to enable backups with your object storage provider if desired.
## Requirements
-In order to be able to backup and restore, you need two essential tools
+In order to be able to backup and restore, you need one essential tool
installed on your system.
- **Rsync**: If you installed GitLab:
@@ -295,6 +295,24 @@ For installations from source:
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.
@@ -516,6 +534,44 @@ For installations from source:
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
+
+See [the table of Azure parameters](../administration/object_storage.md#azure-blob-storage) for more details.
+
##### Specifying a custom directory for backups
Note: This option only works for remote storage. If you want to group your backups
@@ -725,7 +781,7 @@ from source). This file contains the database encryption key,
[CI/CD variables](../ci/variables/README.md#gitlab-cicd-environment-variables), 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 Runners will
+backup, users with two-factor authentication enabled and GitLab Runner will
lose access to your GitLab server.
You may also want to restore any TLS keys, certificates, or [SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079).
@@ -1005,14 +1061,14 @@ including (but not restricted to):
- [Project mirroring](../user/project/repository/repository_mirroring.md)
- [Web hooks](../user/project/integrations/webhooks.md)
-In cases like CI/CD variables and Runner authentication, you might
+In cases like CI/CD variables and runner authentication, you might
experience some unexpected behavior such as:
- Stuck jobs.
- 500 errors.
In this case, you are required to reset all the tokens for CI/CD variables
-and Runner Authentication, which is described in more detail below. After
+and runner authentication, which is described in more detail below. After
resetting the tokens, you should be able to visit your project and the jobs
will have started running again. Use the information in the following sections at your own risk.
@@ -1069,7 +1125,7 @@ and then users will have to reactivate 2FA from scratch.
1. You may need to reconfigure or restart GitLab for the changes to take
effect.
-#### Reset Runner registration tokens
+#### Reset runner registration tokens
1. Enter the DB console:
diff --git a/doc/raketasks/import.md b/doc/raketasks/import.md
index 263f9e54a20..c8ca92b4bae 100644
--- a/doc/raketasks/import.md
+++ b/doc/raketasks/import.md
@@ -1,6 +1,9 @@
# Import bare repositories **(CORE ONLY)**
Rake tasks are available to import bare repositories into a GitLab instance.
+When migrating from an existing GitLab instance,
+and to preserve ownership by users and their namespaces,
+please use [our project-based import/export](../user/project/settings/import_export.md).
Note that:
@@ -14,11 +17,14 @@ Note that:
To import bare repositories into a GitLab instance:
-1. Create a new folder to import your Git repositories from. The new folder needs to have Git user
- ownership and read/write/execute access for Git user and its group:
+1. Create a new folder to import your Git repositories from.
+ You can also import projects into a (sub)group's namespace,
+ instead of the administrator's namespace. To do so, create subfolders and
+ give ownership and read/write/execute permissions of those subfolders to the
+ `git` user and its group:
```shell
- sudo -u git mkdir -p /var/opt/gitlab/git-data/repository-import-<date>/new_group
+ sudo -u git mkdir -p /var/opt/gitlab/git-data/repository-import-$(date "+%Y-%m-%d")/<optional_groupname>/<optional_subgroup>
```
1. Copy your bare repositories inside this newly created folder. Note:
@@ -26,15 +32,15 @@ To import bare repositories into a GitLab instance:
- Any `.git` repositories found on any of the subfolders will be imported as projects.
- Groups will be created as needed, these could be nested folders.
- For example, if we copy the repositories to `/var/opt/gitlab/git-data/repository-import-<date>`,
+ For example, if we copy the repositories to `/var/opt/gitlab/git-data/repository-import-2020-08-22`,
and repository `A` needs to be under the groups `G1` and `G2`, it must be created under those folders:
- `/var/opt/gitlab/git-data/repository-import-<date>/G1/G2/A.git`.
+ `/var/opt/gitlab/git-data/repository-import-2020-08-22/G1/G2/A.git`.
```shell
- sudo cp -r /old/git/foo.git /var/opt/gitlab/git-data/repository-import-<date>/new_group/
+ sudo cp -r /old/git/foo.git /var/opt/gitlab/git-data/repository-import-$(date "+%Y-%m-%d")/<optional_groupname>/<optional_subgroup>
# Do this once when you are done copying git repositories
- sudo chown -R git:git /var/opt/gitlab/git-data/repository-import-<date>
+ sudo chown -R git:git /var/opt/gitlab/git-data/repository-import-$(date "+%Y-%m-%d")
```
`foo.git` needs to be owned by the `git` user and `git` users group.
@@ -46,7 +52,7 @@ To import bare repositories into a GitLab instance:
- Omnibus Installation
```shell
- sudo gitlab-rake gitlab:import:repos['/var/opt/gitlab/git-data/repository-import-<date>']
+ sudo gitlab-rake gitlab:import:repos['/var/opt/gitlab/git-data/repository-import-$(date "+%Y-%m-%d")']
```
- Installation from source. Before running this command you need to change to the directory where
@@ -54,7 +60,7 @@ To import bare repositories into a GitLab instance:
```shell
cd /home/git/gitlab
- sudo -u git -H bundle exec rake gitlab:import:repos['/var/opt/gitlab/git-data/repository-import-<date>'] RAILS_ENV=production
+ sudo -u git -H bundle exec rake gitlab:import:repos['/var/opt/gitlab/git-data/repository-import-$(date "+%Y-%m-%d")'] RAILS_ENV=production
```
## Example output