Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

recover bitbucket from old backup


Simple background....

Due to heat issues we (me) is recovering a bitbucket server back to operations on some new metal.  I guess some servers just don't like 120 degree temp spike when the room a/c failed.  The backup local NAS went south for the winter taking all of the current data with it.

The last off site backup was 30 days old.  I did have  a fresh backup (git clone) of the project a few hours before the server got toasted. 

I obtained access to a new VM, installed the same version of bitbucket, moved the data directory back over the fresh install.  The system came up, showed all the projects as valid but 30 days out of sync.

I patched up the OS, bitbucket (7.2), and git to current.

Now to stuff (update) bitbucket with my git clones that I managed to capture right before all the fun happened.

My goal would like to keep all the branches, etc intact so history is preserved based off that git clone of the project.


right now I am thinking git push origin master might do the trick for normal git, might have to mess with pull requests?




2 answers

2 accepted

0 votes
Answer accepted

I had some fun on some of the fixes - I had two project types that this impacted:


The first my standalone 'git clone' was using the original myproject.git.  However, one of the people thought how nice; lets change it to something else  Odd part was that the backups continue to collect data and it was stale.  No use restoring a old git clone backup.  So this project will end up with oh a few weeks of lost data.  Lucky it was after a major release so the impact was small.  I did notice that this bug within bitbucket failing to remove dead projects was fixed in the current major release.


The second project did have valid project.git so the backups were fine.  I went online to the project to let me do a full level push with my user ID to avoid the pull request.


The push seemed to have worked, the diff -r between new and old project directories  only showed some deltas within the '.git' directory so the push was good. 


I also had a fork(ish) of this project after the server was toasted.  I did take the approach of a new project name  to indicate that parts of the history were gone.  It was a fork but not a fork.  A lot of the middle non-release branches were trimmed out so some history was lost, but not a big deal.  If old history is needed I have the original project which will go read only.  For new work I will use the new project name.

0 votes
Answer accepted

Hi Bradley,

I think in the interest of consistency I would start over. Create a new install of BB (or just delete the current home directory), then create the projects and repos and push the content into the repos from the file system backup you have (see for details).



Premier Support Engineer


I did take this approach when I found a project and a back up version that had removed some of the historical data.  They had trimmed out some of the dead wood for updates that were / will never be accepted.

For me one of the keys was using git config --list between the projects to notice that the remote project "myproject.git" had changed.   This made that project a dead end for upgrades by me.

The second key was to allow me to do a full push back into the project.  This worked fine and did capture the current status of the server before it was 'retired'.


Suggest an answer

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

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,850 views 10 16
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