Skip to content

This repository provides PowerShell scripts to automate the backup and restoration of a GitLab Docker container on Windows and Linux systems. It handles GitLab configuration, data, logs, and Docker images, making disaster recovery and migration straightforward.

License

Notifications You must be signed in to change notification settings

Poagesh/gitlab-backup-restore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitLab Backup and Restore Scripts

This repository contains platform-specific scripts for backing up and restoring GitLab instances on Windows and Linux systems.


πŸ–₯️ Platforms Supported

  • βœ… Linux (Ubuntu, CentOS, RHEL, etc.)
  • βœ… Windows (PowerShell)

πŸ“ Directory Structure

/
β”œβ”€β”€ linux/
β”‚   β”œβ”€β”€ gitlab-backup.bash
β”‚   └── gitlab-restore.bash
β”œβ”€β”€ windows/
β”‚   β”œβ”€β”€ gitlab-backup.ps1
β”‚   └── gitlab-restore.ps1
└── README.md

πŸ“¦ Backup Instructions

πŸ”§ Linux

  1. Navigate to the linux directory.

  2. Run the backup script:

    sudo bash gitlab-backup.bash
  3. Backup files will be stored in /var/opt/gitlab/backups by default.

πŸͺŸ Windows

  1. Open PowerShell as Administrator.

  2. Navigate to the windows directory.

  3. Run the script:

    .\gitlab-backup.ps1
  4. Backup files will be stored in C:\GitLab\backups (or the path specified in the script).


πŸ” Restore Instructions

πŸ”§ Linux

  1. Place your backup .tar file in /var/opt/gitlab/backups.

  2. Run:

    sudo bash gitlab-restore.bash
  3. The script will restore GitLab to the specified backup version and reconfigure services.

πŸͺŸ Windows

  1. Copy the .tar backup file to C:\GitLab\backups.

  2. Run:

    .\gitlab-restore.ps1
  3. The script will restore the GitLab instance from the backup.


⚠️ Important Notes

  • 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.

πŸ§‘β€πŸ’» Author

Created by Poagesh N.
If you find this useful, give it a ⭐️ or contribute!

About

This repository provides PowerShell scripts to automate the backup and restoration of a GitLab Docker container on Windows and Linux systems. It handles GitLab configuration, data, logs, and Docker images, making disaster recovery and migration straightforward.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published