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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

29,626 views 26 12
Join discussion

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