0

I want to clone all repositories in my Bitbucket Server in order to have backups.

I trying to use Bitbucket rest api but not getting the required list of all repositories.

$ curl -u username:password  https://servername:9090/rest/api/1.0/projects/~username/repos -k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    61    0    61    0     0    230      0 --:--:-- --:--:-- --:--:--   230{"size":0,"limit":25,"isLastPage":true,"values":[],"start":0}

Is anything I am missing in command.

I have gone through the Bitbucket rest api doc but and using same command from there but not getting the required result.

2 Answers2

0

Note that the "projects/~USERNAME/repos" REST resource lists PERSONAL repositories only. Do you have any PERSONAL repository?

0

You might be better off using a supported backup option for the whole instance, then you preserve more than just the repositories.

https://confluence.atlassian.com/bitbucketserver/data-recovery-and-backups-776640050.html

If you're set on cloning each repo, you'll need to iterate over both projects and personal repos as suggested in another answer, and do so as a user with access to all of those repos (eg a sysadmin account).

Rog
  • 4,075
  • 2
  • 24
  • 35
  • The problem is we have bitbucket server on windows and I did not found any batch or powershell script for backup. We do not want to run backup shell script using cygwin. –  Aug 18 '17 at 09:51
  • The backup client is probably the best option for you at the moment. It works on Windows with minimal scripting. We're looking at improving the options here with Powershell scripts at some point. – Rog Aug 20 '17 at 22:51