Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to migrate from Bitbucket server to cloud without outside access to existing Bitbucket server?

Hi,

I am currently using Bitbucket server v6.3.2 and planning to migrate to Bitbucket cloud. However, my current Bitbucket server is behind the firewall. I only see documents on how to import from an externally accessible Bitbucket server. Is there any way that I can clone the repo from the current Bitbucket server to my local mac laptop, then upload/import the code with all history into the new repo in the Bitbucket cloud? How? Any step-by-step instruction?

Thank you.

Barry

2 answers

1 accepted

2 votes
Answer accepted

from @Mikael Sandberg who is having issues trying to post this reply: 

 

Yes, you can import an existing repository. Here are the steps:
  1. Clone your existing repositories
  2. In Bitbucket Cloud, create a new empty repository for each of the ones you want to import.
  3. Point your local repository to Bitbucket Cloud by changing the URL it uses.
  4. Push everything to Bitbucket Cloud.
The only thing that you cannot import by doing it this way is any Bitbucket specific things, like existing pull requests, permissions and hooks that you currently have. This will only import the repository.
For more information, have a look at this link for the exact commands you need to run: https://confluence.atlassian.com/bitbucket/push-versioned-code-to-an-empty-repository-877177145.html

Monique, thank you for your quick response. Yes, I found that link also. It is not easy to find tho. 

So, I followed the instruction but got the following error with a brand new repo. How can I resolve it? Thanks. 

 

mp-ml-081:master bonnie$ git remote set-url origin https://scm@bitbucket.org/scm/commons.git

mp-ml-081:master bonnie$ git push -u origin -all

error: did you mean `--all` (with two dashes ?)

mp-ml-081:master bonnie$ git push -u origin --all

Password for 'https://scm@bitbucket.org':

To https://bitbucket.org/pscm/commons.git

! [rejected]        master -> master (fetch first)

error: failed to push some refs to 'https://scm@bitbucket.org/scm/commons.git'

hint: Updates were rejected because the remote contains work that you do

hint: not have locally. This is usually caused by another repository pushing

hint: to the same ref. You may want to first integrate the remote changes

hint: (e.g., 'git pull ...') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Mikael Sandberg Community Leader Mar 03, 2021

Hi Barry,

When you created the repository in Bitbucket, did you choose not to add a readme file in it? The error you get indicates that the remote repository, in Bitbucket, isn’t empty.

I used "git push -u origin --all --force" and imported the repo. However, I do not seem to import branches and tags info. What am I missing?

Mikael Sandberg Community Leader Mar 03, 2021

Okay, so try this. Delete the new repository that you just imported to and creat it again, make sure that you do not add the readme file at the end. When you clone the repository on your Bitbucket server, use git clone —mirror, this will create a bare clone which can only be used for backup. Then when you push it to Bitbucket Cloud, make sure you use the —mirror again in the gut push command. This will recreate all the branches and tags.

Mikael,

1) I think the initial issue is caused by .gitignore file being created. Not the Readme file (This may cause it too but I did not choose to create Readme file).

2) "git clone --mirror..." with cloning then using "git push -u origin --mirror" seem to import all the branch and tags information. 

Thank you.

Barry

0 votes
Mikael Sandberg Community Leader Mar 04, 2021

Testing to post an answer here

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

525 views 6 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you