diff options
author | James Lopez <james@jameslopez.es> | 2017-11-03 14:22:54 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-11-06 16:15:11 +0100 |
commit | 7df463019755a7642801ef93ee7a068625cdee46 (patch) | |
tree | 4ea4e751bf34dbfb2a783b0a7569522f606c4d85 | |
parent | bcff9553909f0f26ae238482ecc43738a08899f1 (diff) | |
download | gitlab-ce-7df463019755a7642801ef93ee7a068625cdee46.tar.gz |
update docs
-rw-r--r-- | changelogs/unreleased/feature-hashed-storage-repo-import.yml | 5 | ||||
-rw-r--r-- | doc/raketasks/import.md | 35 |
2 files changed, 20 insertions, 20 deletions
diff --git a/changelogs/unreleased/feature-hashed-storage-repo-import.yml b/changelogs/unreleased/feature-hashed-storage-repo-import.yml new file mode 100644 index 00000000000..73c16a99053 --- /dev/null +++ b/changelogs/unreleased/feature-hashed-storage-repo-import.yml @@ -0,0 +1,5 @@ +--- +title: Improve GitLab Import rake task to work with Hashed Storage and Subgroups +merge_request: +author: +type: changed diff --git a/doc/raketasks/import.md b/doc/raketasks/import.md index 2b305cb5c99..086b3fc120f 100644 --- a/doc/raketasks/import.md +++ b/doc/raketasks/import.md @@ -3,49 +3,44 @@ ## Notes - The owner of the project will be the first admin -- The groups will be created as needed +- The groups will be created as needed, including subroups - The owner of the group will be the first admin - Existing projects will be skipped ## How to use -### Create a new folder inside the git repositories path. This will be the name of the new group. +### Create a new folder to import your Git repositories from. -- For omnibus-gitlab, it is located at: `/var/opt/gitlab/git-data/repositories` by default, unless you changed -it in the `/etc/gitlab/gitlab.rb` file. -- For installations from source, it is usually located at: `/home/git/repositories` or you can see where -your repositories are located by looking at `config/gitlab.yml` under the `repositories => storages` entries -(you'll usually use the `default` storage path to start). - -New folder needs to have git user ownership and read/write/execute access for git user and its group: +The new folder needs to have git user ownership and read/write/execute access for git user and its group: ``` -sudo -u git mkdir /var/opt/gitlab/git-data/repositories/new_group +sudo -u git mkdir /tmp/git_repos/new_group ``` -If you are using an installation from source, replace `/var/opt/gitlab/git-data` -with `/home/git`. - ### Copy your bare repositories inside this newly created folder: +- 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. Example: + +If we copy the repos to `/tmp/git_repos`, and repo A needs to be under the groups G1 and G2, it will +have to be created under those folders: `/tmp/git_repos/G1/G2/A.git`. + + ``` -sudo cp -r /old/git/foo.git /var/opt/gitlab/git-data/repositories/new_group/ +sudo cp -r /old/git/foo.git /tmp/git_repos/new_group/ # Do this once when you are done copying git repositories -sudo chown -R git:git /var/opt/gitlab/git-data/repositories/new_group/ +sudo chown -R git:git /tmp/git_repos ``` `foo.git` needs to be owned by the git user and git users group. -If you are using an installation from source, replace `/var/opt/gitlab/git-data` -with `/home/git`. - ### Run the command below depending on your type of installation: #### Omnibus Installation ``` -$ sudo gitlab-rake gitlab:import:repos +$ sudo gitlab-rake gitlab:import:repos['/tmp/git_repos'] ``` #### Installation from source @@ -54,7 +49,7 @@ Before running this command you need to change the directory to where your GitLa ``` $ cd /home/git/gitlab -$ sudo -u git -H bundle exec rake gitlab:import:repos RAILS_ENV=production +$ sudo -u git -H bundle exec rake gitlab:import:repos['/tmp/git_repos'] RAILS_ENV=production ``` #### Example output |