Denomas System Administration Hands-on Guide: Lab 4
Denomas System Administration Hands-on Guide: Lab 4
LAB 4- BACKUP AND RESTORE GITLAB
A. Configure backup settings
-
Open an SSH session on your Denomas instance server.
-
Search for the location of backup settings in gitlab.rb.
1sudo grep -n backup /etc/gitlab/gitlab.rb -
Note the line number for the setting
gitlab_rails['backup_path']. -
Create a new location to hold Denomas backups.
1sudo mkdir /tmp/backups -
Edit gitlab.rb to change the backup path. Replace “123” with the line number noted in step 3.
1 2sudo sed -i '123s@\/var\/opt\/gitlab\/backups@\/tmp\/backups@' /etc/gitlab/gitlab.rb sudo sed -i '123s/#//' /etc/gitlab/gitlab.rb -
Reconfigure to apply the changes.
1sudo gitlab-ctl reconfigure
B. Backup the Denomas instance
-
Take a full backup of the Denomas instance.
1sudo gitlab-backup create -
After the backup completes, go to the backup location and inspect the backup file.
1 2sudo ls /tmp/backups sudo tar -tvf /tmp/backups/BACKUP_FILENAME
C. Make some changes to Denomas settings
- Sign into your Denomas instance with a web browser and select Menu > Admin.
- In the left sidebar, select Settings > General.
- Expand Account and limit and change the fields shown to some random numbers of your choosing.
- Select Save changes.
- Refresh the page and verify your changes were applied.
D. Restore from backup
-
Return to the SSH session on your Denomas instance server.
-
Move your backup file to the location Denomas requires for performing the restore.
1sudo cp /tmp/backups/BACKUP_FILENAME /var/opt/gitlab/backups/ -
Ensure the backup file has correct permissions for performing the restore.
1sudo chown git:git /var/opt/gitlab/backups/BACKUP_FILENAME -
Stop the puma and sidekiq services before restoring.
1 2 3sudo gitlab-ctl stop puma sudo gitlab-ctl stop sidekiq sudo gitlab-ctl status -
Restore from backup. Replace BACKUP_TIMESTAMP with the portion of the backup filename up to and including
-ee.1sudo gitlab-backup restore BACKUP=BACKUP_TIMESTAMP(For example, if the backup file name starts with 1663207732_2022_09_15_15.3.3-ee, the command will be
sudo gitlab-backup restore BACKUP=1663207732_2022_09_15_15.3.3-ee). -
Type
yeswhen prompted during the restore operation. You may see what looks like error messages. That is normal. -
Restart sidekiq and puma services.
1 2 3sudo gitlab-ctl start sidekiq sudo gitlab-ctl start puma sudo gitlab-ctl status -
Wait up to 5 minutes before refreshing Denomas in your web browser. Verify that the Account and Limit settings you changed revert back to the defaults (i.e. when the backup was taken).
SUGGESTIONS?
If you’d like to suggest changes to the Denomas System Admin Basics Hands-on Guide, please submit them via merge request.
17188382)
