GitLab Basics
- GitLab - Squashing Commits
- GitLab - Rebase Operation
- GitLab - Add a File
- GitLab - Create a Branch
- GitLab - Fork a Project
- GitLab - Create Project
- GitLab - SSH Key Setup
- GitLab - Git Commands
- GitLab - Installation
- GitLab - Introduction
GitLab Users and Groups
GitLab Issue Tracker
- GitLab - Wiki Pages
- GitLab - Milestones
- GitLab - Referencing Issues
- GitLab - Merge Requests
- GitLab - Create Issue
GitLab Instance Management
GitLab Continuous Integration
- GitLab CI - Container Registry
- GitLab CI - Cycle Analytics
- GitLab CI - Advanced usage of CI
- Configuring GitLab Runners
- GitLab CI - Permissions
- GitLab - CI/CD Variables
- GitLab - CI/CD
- GitLab CI - Introduction
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
GitLab - Restore Backup
GitLab allows restoring the backup copy of your repository. In this chapter, we will discuss about how to restore the backup copy in the GitLab −
Step 1 − First, login to your GitLab server using SSH (Secure Shell).
Step 2 − Before restoring the backup copy, first make sure backup copy is in the /var/opt/gitlab/backups directory.
Step 3 − You can check the backup copy by using the ls -l command which is described in the
job chapter.Step 4 − Now, stop the processes which are related to the database by using the below commands −
sudo gitlab-ctl stop unicorn sudo gitlab-ctl stop sidekiq

The above commands can also be used to free up some memory temporarily by shutting down them.
Step 5 − You can verify status of the GitLab services by using the below command −
sudo gitlab-ctl status
Step 6 − Now, restore the backup by using the timestamp of the backup copy −
sudo gitlab-rake gitlab:backup:restore BACKUP = 1521884424_2018_03_24_10.5.3

Step 7 − Restart the GitLab components by using the below command −
sudo gitlab-ctl restart

Step 8 − Now check the GitLab by sanitizing the database as shown below −
sudo gitlab-rake gitlab:check SANITIZE = true

The SANITIZE = true flag removes all email addresses because they are confidential, removes the CI variables and access tokens as they can be used in the production instance.
Advertisements