GitLab Backup

Copy ssh key to the second computer

Create the Password File

Create a secure password file that restic will use to encrypt your backups. Run this on both computers.

sudo mkdir -p /etc/restic
sudo nvim /etc/restic/password
sudo chown mikaelweiss:mikaelweiss /etc/restic/password
sudo chmod 600 /etc/restic/password

Initialize the Restic Repositories

Remote repository (elm via SFTP)

First, create the backup directory on elm

ssh mikaelweiss@elm
mkdir -p /home/mikaelweiss/backups/gitlab-backup

Then initialize the repository. Run this on oak.

restic init -r sftp:mikaelweiss@elm:/home/mikaelweiss/backups/gitlab-backup --password-file /etc/restic/password
mkdir /backups/gitlab-backup
restic init -r /home/mikaelweiss/backups/gitlab-backup --password-file /etc/restic/password
restic backup -r /home/mikaelweiss/backups/gitlab-backup /var/opt/gitlab/backups /etc/gitlab --password-file /etc/restic/password