This repository contains platform-specific scripts for backing up and restoring GitLab instances on Windows and Linux systems.
- β Linux (Ubuntu, CentOS, RHEL, etc.)
- β Windows (PowerShell)
/
βββ linux/
β βββ gitlab-backup.bash
β βββ gitlab-restore.bash
βββ windows/
β βββ gitlab-backup.ps1
β βββ gitlab-restore.ps1
βββ README.md-
Navigate to the
linuxdirectory. -
Run the backup script:
sudo bash gitlab-backup.bash
-
Backup files will be stored in
/var/opt/gitlab/backupsby default.
-
Open PowerShell as Administrator.
-
Navigate to the
windowsdirectory. -
Run the script:
.\gitlab-backup.ps1 -
Backup files will be stored in
C:\GitLab\backups(or the path specified in the script).
-
Place your backup
.tarfile in/var/opt/gitlab/backups. -
Run:
sudo bash gitlab-restore.bash
-
The script will restore GitLab to the specified backup version and reconfigure services.
-
Copy the
.tarbackup file toC:\GitLab\backups. -
Run:
.\gitlab-restore.ps1 -
The script will restore the GitLab instance from the backup.
- Ensure GitLab services are stopped before restoring and restarted after.
- Ensure the backup file version matches the GitLab version you are restoring.
- These scripts may require admin/root privileges.
- Always test backups and restores in a staging environment before production use.
Created by Poagesh N.
If you find this useful, give it a βοΈ or contribute!