The following page describes an example of a possible backup script for your gitbucket installation.
Feel free to inspire from it.
The backup of a gitbucket installation should be consistent between the database state and the state of the git repositories.
Of course the most important to keep is probably the git repositories, but hey if you need sometime to recover it would be cool that all PRs, issues, references and so on are in synch with the backups of the repositories no?
The provided backup script tries to minimise as much as possible the time between the database backup and a clean stage of all repositories by doing the following steps:
How to use the provided backup script?
bash backup.sh [-v] GITBUCKET_HOME BACKUP_FOLDER [Database backup URL]
where
~/.gitbucket
I tested this script on windows using a msysgit installation (one copy of one coming bundled with Sourcetree git client).
Here is a backup.bat
file that could be launched on the server hosting gitbucket
@echo off REM Go to script directory CD /D %~dp0 REM Add all msyggit commands in the path (bash, git, SET PATH=D:\tools\portable-git-1.9.5\bin;%PATH% bash backup.sh d:\gitbucket\work e:\backup\gitbucket http://localhost:8080/database/backup