sudo gitlab-rake gitlab:backup:create,默认在/var/opt/gitlab/backups生成备份文件。/etc/gitlab/gitlab.rb,设置gitlab_rails['backup_path'],再运行sudo gitlab-ctl reconfigure。crontab设置定时任务,如每天凌晨2点备份,示例脚本可参考相关文档。sudo gitlab-ctl stop unicorn和sudo gitlab-ctl stop sidekiq。sudo gitlab-rake gitlab:backup:restore BACKUP=备份编号,按提示操作。sudo gitlab-ctl start。