GitLab allows to take backup copy of your repository by using simple command. In this chapter, we will discuss about how to take backup copy in the GitLab −
Step 1 − First, login to your GitLab server using SSH (Secure Shell).
Step 2 − Create the backup of GitLab by using the below command −
sudo gitlab-rake gitlab:backup:create
Step 3 − You can exclude some directories from the backup by adding environment variable SKIP as shown below −
sudo gitlab-rake gitlab:backup:create SKIP = db,uploads
Step 4 − The backup tar file will get created in the default /var/opt/gitlab/backups directory. Navigate to this path and type ls -l to see the created backup file −