stash-restore-client.jar only restored main branch?


I tried restored production stash (3.1.3) to my stage stash (3.1.3) with stash-backup-client.jar and stash-restore-client.jar from stash-backup-client-1.9.1. It went OK except that all repos only show main branch. Can someone help? Thanks!

Commands I used to restore

java -Djdbc.override=true      -Djdbc.url="jdbc:sqlserver://...;databaseName=..."          -Djdbc.user=...  -Djdbc.password=...         -Dstash.home=...  -jar .../stash-backup-client-1.9.1/stash-restore-client.jar ./stash-20171019-041823-113.tar 


1 answer

0 vote
Andrew Er Atlassian Team Dec 26, 2017

Hey Qiang,


This is fairly an odd one. Usually repositories should be intact as long as everything is backed up correctly and that the file is not corrupted. A few things that you can check:

  • Are you backing up and restoring using the same client version (i.e. 1.9.1)? If you're not try, try backing up and restoring using the same client version
  • Have you tried to perform the backup and restore again? Was there any particular error that you could see on the command line while backing up or restoring even if the process is successful?
  • Stash 3.1 is fairly old and it falls under our End Of Life version. Perhaps upgrading your instance and using a later version of the  Backup Client compatible with the version of Bitbucket Server that you are using. This could potentially help solve the problem
  • Lastly, you could also verify if the branches are actually at the present on the bare repositories. Navigate to your $STASH_HOME/data/repositories/{id} from a terminal for both the original instance and the restored instance of on the repositories and perform a {{git branch}} to see if the original instance repository has more than just the {{master}} branch.



Andrew Er 


Thanks for your answer. 

. Yes, I used 1.9.1 for both backup and restore. I also made sure backup/restore both ran with jdk1.7.0_141.

. I did backup/restore again. I did not see any errors. It took pretty long time, about 4 hours to restore to my testing instance.

. git command can list various branches, not just master.

. I did not try the new version backup/restore tools. What versions work with both Stash 3.1.3 and Bitbucket? My production was running with Stash 3.1.3. And I cannot upgrade production before I can restore data to my testing server yet.

Thanks again.

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
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...

706 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot