This script is to migrate Bitbucket server repository only (not user and permission) to Bitbucket cloud
- Add a SSH Key into your bitbucket server user account
- Have all the repository names that you want to migrate in repo.txt
./bitbucket-migration-script.sh repos.txt
This script will git clone all the repositories from the list in repo.txt and push it (including all the branches and history) to the new repository in Bitbucket Cloud one by one after creating the repository using the Bitbucket Cloud RESTful Api
- git clone a repo using ssh
- create a new repo (using the same name) in Bitbucket Cloud using RESTful api
- git push to the new repo in Bitbucket Cloud
- Clean up the directory
https://developer.atlassian.com/bitbucket/api/2/reference/search?q=repositories