Hello,
I am using a windows environment and self hosted "Server" version of bitbucket
I've read several docs on how to do a bitbucket backup but the "Client" looks dated and im not sure how to proceed with that.
Why does bitbucket not have a native backup option like confluence has ?
Documentation is important but you know what is even more important ?
CODE...
Suggestions, help, advice, tutorials...
Essentially what Im looking for is to have a nightly backup made like I have with confluence and store it on another server which is a normal procedure when it comes to data.
Again I am on a pure windows environment with a MSSQL as the database and self hosted "Server" version of bitbucket
Thanks
Hi Siavash,
for backup the bitbucket you need to backup two things
1. data directory
2. database
write batch file to copy your bitbucket data directory to your backup machine every day ,
for database you can write a procedure to backup db every day and copy to backup machine
When you backup any GIT environment (e.g.: Bitbucket) you need to take into account a few things:
1. Decide what you want to backup:
2. Decide on a backup and recovery approach. Depending on the deployment model (SaaS, DC, on-premise) not all of them are available
3. Run tests for both backup and recovery scenarios.
4. Monitor and maintain your solution
Other important areas to decide:
In the beginning, it looks like writing a few scripts but it could also end in a pretty large project that will require additional resources to maintain. You could do everything on your own or use a dedicated Bitbucket backup platform.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Am using Bitbucket Server self host but not using any database,then HOW should i backup and restore????
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I suggest taking a look at SCM Backup tool: https://github.com/christianspecht/scm-backup
We've been using this tool through a Jenkins job to take daily backups of our repositories. It's very convenient and works cross-platform.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Haas, regarding SCM, can you confirm if in fact it doesn’t back up the source files?
In a possible restoration of the data, he will seek the sources from which place?
thank's.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure what you mean by source files. It backs up everything in a given git repository as a bare repository. The restoration is a manual task which is not a function of SCM. You just need to copy the back up to the place you want and then just "git clone bare-repo working-repo". You can see the details in its documentation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I understood, in this case, what I was referring to would be the project's source codes, as these are not saved in the backup file, as described in this part of the documentation:
"Your complete history and your source code are in there - you just don’t see the actual files!
The repository is backed up without a working directory, because it’s not necessary. "
In reality I did not understand very well what it says there, in this case, the source codes are also backed up or when I restore the backup will I have to get the source codes from my local workspace or from my bitbucket repository?
thank you again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see your confusion. That's the "bare repository" concept. It seems strange at first glance, indeed. However, it's very simple and it actually forms the backbone of the whole git system.
A bare repository is basically what we call a remote repository in practice, in our case Bitbucket. It's used for centralizing the code versioning for the developers who share it, as you know. Because no one ever makes edits directly to files in the shared bare repo, a working tree is not needed. That's why I mentioned in my previous post "working-repo". If you think about it, it makes sense: it's "bare" because it does not have a working tree. ;)
What SCM does is simple: it creates a new bare repo for you and it becomes your backup file for that repository. Therefore, to restore your working repository to your local environment, you just need to clone from the backup file, just like cloning from a remote repo. In the end, after restoration, you'll see the source code files in your local. Depending on the type of restoration, there might be some additional things to do, such as changing the remote repo URL or (re)tracking all the remote branches, etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Now I understand, so in this case, even though there are several developers working on the project, I can do the restoration from a previous day for example using the backup made by SCM (daily backup with the same) and with that, I will have all the source code with the changes that day, without relying on bitbucket or any local directory, correct?
Thank you very much again for returning.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You're welcome and yes, what you said is correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Before performing a backup should I stop the bitbucket service ?
Reminder this is a windows environment..
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No need , but you should scheduled backup at night time when server is not busy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI @CenturyX476
Why does bitbucket not have a native backup option like confluence has ?
As you will know the bitbucket has the code and for native backup, it will take a lot of time (depends on data) as well as consume memory.
As @ajeet_singh said, you can sync your <Bitbucket_Home> dir to your backup server every interval time (depends on you how to want to sync at every an hour/day) and you can write a bash script using which you can take the database backup.
For running automatically the Bash script you need to add the corn job accordingly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.