Where are physically stored the source files pushed to stash repository?

in order to define a proper disaster recovery and contigency procedure I need to know/understabd where/how are phiscally strored the file pushed to a stash repository.

2 answers

1 accepted

Hi Arnaud,

The repositories are stored under the $STASH_HOME/data/repositories directory:

https://confluence.atlassian.com/display/STASH/Stash+home+directory

As of Stash 2.7 we have released a backup client as well which might be useful.

https://confluence.atlassian.com/display/STASH/Data+recovery+and+backups

Cheers,

Charles

Hi Charles,

Thanks a lot for your quick answer.

This is what I thought at the begining (that the files should be somewhere under the stash-home directory). However looking to directories under $STASH_HOME/data I could not find any source file (.java files in my case).

I am using an external dtabase does it make any difference?

I even ran a find / -name "*.java" on my server and got only two files:

/home/stash/.java

/usr/share/atlassian-stash-2.4.2/work/Catalina/localhost/_/org/apache/jsp/fatal_jsp.java

Strange isn't it?

Cheers,

Arnaud

Hi Arnaud,

Not strange at all. The folders under $STASH_HOME/data/repositories are "bare" Git repositories, almost like mini databases, and as such you won't be able to see your files directly. Instead if you switch to any of the repositories you will be able to run git commands (ie git ls-files) as you would if you cloned them locally.

Cheers,

Charles

PS. Just as a word of warning I wouldn't recommend modifying those repositories directly, as that may cause Stash to misbehave.

Charles,

I have the same question on how to see files under stash/data/repositories/1 although I do understand the structure is protected from direct interaction?

If I run git ls-files under stash/data/repositories/1 directory, it shows nothing although I could run other commands such as git branch which shows all the branches.

Hi Kabir,

ls-files is only going to show you working files. You can run 'git ls-tree --name-only -r HEAD' instead to see the same thing for a given branch/commit.

If you're writing a plugin/hook you can use our ContentService.streamDirectory() to achieve the same thing.

Cheers,

Charles

In order to define a proper disaster recovery and contigency procedure, I need to know/understand where and how is the file physically stored that's pushed to a stash repository.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

2,048 views 1 5
Read article

Atlassian User Groups

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!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you