after restoring a backup, empty wikis must be recreated manually
Summary
When migrating a GitLab instance between servers: An empty wiki will be (correctly) skipped on backup and (incorrectly) not created on restore, even if the project's wiki is enabled.
This may not be a bug as such. It may be instead a matter of documentation (see "Possible Fixes", below).
Steps to reproduce
- Create a project with an enabled, but empty, wiki repository.
- Back up the GitLab instance (e.g.,
gitlab-rake gitlab:backup:create
). - Restore the backup to another GitLab instance.
What is the current bug behavior?
During restore, project.wiki.git
is not recreated (as empty).
What is the expected correct behavior?
During restore, project.wiki.git
is recreated (as empty.)
Relevant logs and/or screenshots
Attempting to clone project.wiki.git
as an administrator:
GitLab: A repository for this project does not exist yet.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Attempting to clone project.wiki.git
as a non-administrator:
GitLab: The project you were looking for could not be found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
gitlab-shell.log
(redacted):
time="2018-05-07T23:02:55+00:00" level=warn msg="Access denied" command="git-upload-pack 'project/project.wiki.git'" pid=531 user="user with key key-231"
Possible fixes
In the gitlab-rails console
1:
Project.find_each { |p| puts p; p.wiki.ensure_repository }
-
Adapted from gitlab-org/gitlab-ce#4173.
↩
Edited by Cory Myers