Open gimler opened 6 years ago
I found this https://gitlab.com/gitlab-org/gitlab-ce/issues/44003 and it works when making sure that gitly (and gitlab) is running during manual restore. I haven't been able to make it work in our deployment pipeline yet.
As a short-term solution, you can create a backup file by executing the following command.
docker exec -it gitlab_container_name bash
bundle exec rake gitlab:backup:create RAILS_ENV=production
Or in one line :
docker exec -it gitlab bash -c 'supervisorctl stop unicorn sshd ; source ${GITLAB_RUNTIME_DIR}/functions ; execute_raketask gitlab:backup:create SKIP=$GITLAB_BACKUP_SKIP ; supervisorctl start sshd unicorn'
For me, this seems to work
docker-compose exec gitlab su -c 'bundle exec rake gitlab:backup:create' git
I haven't figured out yet how to restore from the backup that that generates yet :unamused:
@paddy-hack i can confirm it works as expected.
The documentation should be updated.
Same issue here.
@gimler I think the solution from @LordFPL is to be preferred if working, as unicorn and sshd are stopped during the backup process. For what I understand from official Gitlab documentation and the docker image one, backups should not be created on a running instance, or at least not by this way. If there is, even with low probability, any chance of corruptions of the backup'ed data, it should not be recommended at all.
I am not skilled enough to know what is the safest way to do the backups under these conditions. But if someone here is, it would be great if the documentation could be updated. Maybe, at least, a simple warning to say that the current explanations are not correct anymore with a link to this issue?
Did anybody get the restore process to work? edit: nevermind, finally got it working.
Oops! Sorry for not reporting back on that :flushed: Here's what has been working for me, since 10.8.3 at the very least, possibly also 10.7.x.
docker-compose exec gitlab supervisorctl stop unicorn
docker-compose exec gitlab supervisorctl stop sidekiq
docker-compose exec gitlab su -c 'bundle exec rake gitlab:backup:restore' git
docker-compose exec gitlab supervisorctl start sidekiq
docker-compose exec gitlab supervisorctl start unicorn
Can confirm that it is issue in 11.1.4 as well and @paddy-hack workaround works here.
Great Job ! Thanks @paddy-hack It's Work!!
Windows 10 / docker for windows 18.06.1-ce / ameersbn/gitlab:11.3.0
I have run into the problem...
I used the last @paddy-hack
sequence of commands also for backup:create
and it worked.
This may be useful for #1744 and #1539 as well.
I recently tested created and restoring with 11.4.3 using
docker-compose exec gitlab su -c 'bundle exec rake gitlab:backup:create' git
to create the backup and
docker-compose exec gitlab su -c 'bundle exec rake gitlab:backup:restore' git
to restore. No more need to stop and start unicorn
and sidekiq
.
This issue has been automatically marked as stale because it has not had any activity for the last 60 days. It will be closed if no further activity occurs during the next 7 days. Thank you for your contributions.
i have actual 10.5.6 backup works.
in booth repos bla and docker i have diabled the wiki.
when i try to upgrade to 10.6.3 or 10.6.4 i get the follwing error