Corrupt Drive Recovery

Sachin Kumar January 12, 2018

Hi,

The drive that our Bitbucket Server runs on became corrupted. We found a way to access data on the drive via recovery tools, but the drive is *not mountable* from the OS.

Therefore, we can only use the recovery tool to browse the drive and copy specific files / directories.

We would like to copy all necessary files for Bitbucket Server so that we can restore its state on another server.

Could you please advise on what needs to be copied? I unfortunately don't remember the exact version of Bitbucket Server we're running (and I can't check for obvious reason), but it's 4.x for sure.

1 answer

0 votes
Jeremy Price
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 12, 2018

Hello Sachin, 

All you would need to recover Bitbucket to a new installation is the Bitbucket home directory and the database itself.  Provided you're running on an external database, you'd just need the home directory off of the failed drive.  You can refer to the Backup and Recovery documentation for those specifics.  Generally, I'd recommend doing a fresh install of Bitbucket server, making sure it works, then shutting it down, copying the contents of the old home directory in to the new directory, adding the database information to bitbucket.properties, then starting it back up.

Good luck with your recovery!

Sachin Kumar January 13, 2018

Hi,

Thanks for the info.

It turns out that we had an extra complication -- the database we were using for the corrupted Bitbucket instance is no longer accessible either. But we managed to copy everything from the Bitbucket Home directory out.

Our current state is this: We have installed the latest Bitbucket Server instance. It's empty -- has no repositories or users (besides the admin user).

The only thing we really need is to be able to populate the new Bitbucket with the old projects/repositories (some of which use Git LFS). We don't care about old pull-requests, personal or user git repositories, etc... just need the projects and the repositories within each project.

I see the individual git repositories are maintained as git bare remotes in shared/data/repositories. One option is for me to clone each one locally and push to a new repository in our new Bitbucket. However, we have hundreds of repos and some use Git LFS -- is there an easier way?

Can I simply copy the contents of shared/data/repositories from the old to the new? 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events