A backup of our production Stash using the official backup client currently takes about two hours(!), which is much, much more downtime as allowed for the system. As far as I see most of the time is taken for tar-ing all the git repositories, which doesn't make any sense to me at all. (The repositories are already cloned for each developer and also pushed to a second git server, as an official backup.)
Is there a way to backup everything except the actual repositories?
Is there some other way to have some kind of backup of the stash instance without a noteworthy downtime?
Hi Michael,
There is no way to tell the backup client to backup only the database or only repositories. The backup client is intended to backup the entire Stash server and it's crucial that the database and repositories are in-sync with each other.
We investigated a number of backup methods when writing the backup client, including using the Git client to perform a clone. The Git repositories that Stash keeps in the {{data}} directory are configured very specifically for Stash's use. Unfortunately, using Git to backup Stash's repos will:
As a result of the above issues, we decided tarring the files in Java was the fastest, cross-platform way to backup. We anticipated that larger organizations may have faster means available (rsync or file-system snapshots, for example).
If you decide to go your own route, there are two main points to keep in mind:
To ensure the above two points are met, we'd suggest stopping the Stash server during a backup or blocking access to the HTTP and SSH ports.
Lastly, we're aware people aren't happy about the downtime required for a backup. We're looking into other ways to handle backups without downtime (potentially with the use of mirrors or clusters). However, those solutions will take a lot of development and probably won't be released until later this year.
I hope that helps,
-- Brent
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.