gitlab-backup

module
v1.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2025 License: GPL-3.0

README

GitHub release Go Report Card GitHub Downloads Test Coverage GoDoc Linter Release Snapshot License

gitlab-backup

This tool can be used to export project or every projects of a gitlab group. It uses the API of gitlab to get an archive of exported project.

Two options to save the exported projects:

  • local folder
  • s3

There is also the possibility to specify pre/post backup hooks.

Usage by configuration file

Example:

# debuglevel: "info"
gitlabGroupID: XXXX
gitlabProjectID: YYYY
localpath: "/backup"
gitlabtoken: 
# gitlaburi: https://gitlab.com
# tmpdir: /tmp
hooks:
    prebackup: ""
    postbackup: ""
s3cfg:
  endpoint: "http://localhost:9090"
  bucketName: "ephemeralfiles"
  bucketPath: "test"
  region: "us-east-1"
  accesskey: ""
  secretkey: ""

parameters of the configuration file can be override by environment variable

Launch the program: gitlab-backup -c configuration.yaml

Usage by environment variable

  AWS_ACCESS_KEY_ID string
  AWS_SECRET_ACCESS_KEY string
  GITLABGROUPID int
         (default "0")
  GITLABPROJECTID int
         (default "0")
  GITLAB_TOKEN string
  GITLAB_URI string
         (default "https://gitlab.com")
  LOCALPATH string
         (default "")
  POSTBACKUP string
         (default "")
  PREBACKUP string
         (default "")
  S3BUCKETNAME string
         (default "")
  S3BUCKETPATH string
         (default "")
  S3ENDPOINT string
         (default "")
  S3REGION string
         (default "")
  TMPDIR string
         (default "/tmp")

Extended project

Another project can be used to encrypt archives of exported project and send them to s3. It's gitlab-backup2s3 which is using two softwares:

  • gitlab-backup (this project)
  • gocrypt

Installation

Release

Download the latest release from github and install it.

## Brew

brew tap sgaunet/homebrew-tools
brew install sgaunet/tools/gitlab-backup

Development

This project is using :

Use task to compile/create release...

$ task
task: [default] task -a
task: Available tasks for this project:
* build:            Build the binary
* default:          List tasks
* doc:              Start godoc server
* image:            Build/push the docker image
* release:          Create a release
* snapshot:         Create a snapshot release
* update-crt:       Update the crt file

Directories

Path Synopsis
You should have received a copy of the GNU General Public License along with this program.
You should have received a copy of the GNU General Public License along with this program.
pkg
app
Package app provides the main application logic for GitLab backup.
Package app provides the main application logic for GitLab backup.
config
Package config provides configuration management for GitLab backup application.
Package config provides configuration management for GitLab backup application.
gitlab
Package gitlab provides GitLab API client functionality.
Package gitlab provides GitLab API client functionality.
hooks
Package hooks provides pre and post backup hook functionality.
Package hooks provides pre and post backup hook functionality.
storage
Package storage defines the interface for backup storage backends.
Package storage defines the interface for backup storage backends.
storage/localstorage
Package localstorage provides local file system storage implementation.
Package localstorage provides local file system storage implementation.
storage/s3storage
Package s3storage provides AWS S3 storage implementation.
Package s3storage provides AWS S3 storage implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL