The backup client backs up and restores two categories of Stash data: database data and filesystem data. It is designed for a full backup and restore but there is some flexibility in the settings which, although not the best fit, might help you in what you need to do.
Database data is always and in full backed up and restored. Now, by default the restore process will restore to the same database it backed up from. Say you didn't care about backing up and restoring the database data (because you already have systems in place to back this up) and only cared about the filesystem data. What you could do is override the target database for the restore so that it is restored to an in-memory database (a HSQL database) which you then discard. You would also have to reinstate the original database settings after restoring. I'll post more details only if you want to go down this route (as its not officially supported).
Filesystem data (managed git repositories, audit logs, plugins and data etc) is also always backed up and restored but you have flexibility in what gets backed up and thus what gets restored by varying the includes and excludes. The backup property that controls includes is stash.home.includes and its default value is "**/*" which is an Ant glob for all files. The property stash.home.excludes controls excludes and its default value is "" (although empty there is a default set of excludes that get added to this which is "export/**,data/db.*,tmp/**,log/*,plugins/.*/**,.lock,metadata.json,system.zip"). Excludes trump includes. You could add excludes to filter out the files you don't care about e.g. stash.home.excludes=data/repositories/29/**
One fly in the ointment with wanting a partial backup / restore of Stash files is that the restore process will refuse to run if the target directory is not empty. So if you wanted to do that you you will not be able to restore straight into a Stash home but rather will have to restore to a separate directory and subsequently move the files and folders to your Stash home.
It would be good to know why you want a partial backup and restore. Most customers who have asked this have pointed to the size of their repositories (hundreds of gigabytes) which may make it impractical for a full filesystem backup in acceptable time (since Stash is put into maintenance mode for the duration of the backup). Most of these customers assume they can rely on their own database and filesystem backup procedures to back their data. We must caution you that it is incredibly easy to make a corrupt snapshot of a Git repository if there are running Git processes writing to it at that time. This is why Stash goes into maintenance mode during the backup.
Thanks for the answer.
The question of partial restore came from an admin who has had to restore parts of repositories from other CM tools than Git when a user accedentally removed files from source control. That may not be an issue with Git, but my experience level with Git is still pretty low, and I didn't have an answer for him.
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot