{"id":3826,"date":"2023-01-25T14:02:29","date_gmt":"2023-01-25T14:02:29","guid":{"rendered":"https:\/\/gitprotect.io\/blog\/?p=3826"},"modified":"2024-11-21T12:22:14","modified_gmt":"2024-11-21T12:22:14","slug":"bitbucket-backup-to-s3","status":"publish","type":"post","link":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/","title":{"rendered":"Bitbucket Backup to S3"},"content":{"rendered":"\n<p><strong>Companies utilizing Bitbucket or other solutions as the primary Git-based source control must repeat a particular truism ad nauseam. Preventing data loss is vital to maintaining business continuity. One of the most crucial aspects in dealing with such a challenge is ensuring data protection in S3-compatible cloud storage.<\/strong>&nbsp;<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>More so, as saving the existing repository alone is not enough. It\u2019s crucial the <a href=\"https:\/\/gitprotect.io\/faq\/what-is-included-in-backups.html\" target=\"_blank\" rel=\"noreferrer noopener\">backup plan includes metadata<\/a>, like pull requests (Git command), history (e.g., comments), and other:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" width=\"640\" height=\"492\" src=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3.png\" alt=\"Bitbucket to S3 - picture 1\" class=\"wp-image-6003\" style=\"width:500px;height:auto\" srcset=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3.png 640w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-300x231.png 300w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-400x308.png 400w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/figure><\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\"><strong>S3 for Bitbucket repositories<\/strong><\/h2>\n\n\n\n<p>Bitbucket Cloud services don&#8217;t inherently offer native backup and restore features, so users must create or implement their own solutions (or tools).<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>We do not use these backups to revert customer-initiated destructive changes, such as fields overwritten using scripts, or deleted issues, projects, or sites. To avoid data loss, we recommend making regular backups.<\/p>\n<\/blockquote>\n\n\n\n<p><em>Source: <a href=\"https:\/\/www.atlassian.com\/trust\/security\/security-practices#continually-improving\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><u>Atlassian security practices<\/u><\/a> under the Shared Responsibility Model.<\/em><\/p>\n\n\n\n<p>A similar problem also affects other Git-based platforms, such as <a href=\"https:\/\/gitprotect.io\/blog\/gitlab-backup-to-s3\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitLab<\/a> or <a href=\"https:\/\/gitprotect.io\/blog\/github-backup-to-s3\/\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a>.<\/p>\n\n\n\n<p>Given the distributed nature of cloud repositories and the need for quick recovery in the case of information loss, S3s (Simple Storage Services) \u2013 at the moment \u2013 create the best possibilities when it comes to:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" width=\"790\" height=\"331\" src=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-2.png\" alt=\"Bitbucket to S3 - picture 2\" class=\"wp-image-6004\" style=\"width:500px;height:auto\" srcset=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-2.png 790w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-2-300x126.png 300w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-2-768x322.png 768w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-2-400x168.png 400w\" sizes=\"(max-width: 790px) 100vw, 790px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Example methods of backing up Bitbucket repository data to S3<\/h2>\n\n\n\n<p>You can list several ways to store Bitbuckets repos in S3, from manual to fully automated methods. It all depends on your scalability and control needs. The most effective approaches include:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Manual backup using AWS CLI<\/strong><\/h3>\n\n\n\n<p>The backup of your Bitbucket instance can be created using the <em>bitbucket.diy-backup.sh.<\/em> You can manually upload it to an S3 bucket with AWS CLI.<\/p>\n\n\n\n<p>To generate a backup, all it takes is to run the command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/bitbucket.diy-backup.sh<\/code><\/pre>\n\n\n\n<p>Then, you can upload the data to S3.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>aws s3 cp \/path\/to\/backup.tar.gz s3:\/\/bucket-name\/<\/code><\/pre>\n\n\n\n<p>The solution is suitable for small setups or occasional backups with no priority on automating activities. However, it lacks scheduling and is prone to human errors.<\/p>\n\n\n\n<p>A more broad example of using Git command and AWS CLI:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n# Configure AWS CLI access\nexport AWS_ACCESS_KEY_ID=your-access-key\nexport AWS_SECRET_ACCESS_KEY=your-secret-key\nexport S3_BUCKET=your-s3-bucket\n\n# Clone the Bitbucket repository\ngit clone https:\/\/bitbucket.org\/your-org\/your-repo.gisdt \/tmp\/your-repo\n\n# Sync the cloned repository with the S3 bucket\naws s3 sync \/tmp\/your-repo s3:\/\/$S3_BUCKET\/backups\/ --delete<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Automated backup with Cron Job and AWS CLI<\/h3>\n\n\n\n<p>The method allows you to automate backup and upload utilizing cron jobs on Linux or macOS operating systems or Task Scheduler on Windows.<\/p>\n\n\n\n<p>It starts with the shell script:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\/path\/to\/bitbucket.diy-backup.sh \naws s3 cp \/path\/to\/backup.tar.gz s3:\/\/bucket-name\/<\/code><\/pre>\n\n\n\n<p>It can be scheduled to run the script regularly (e.g., daily) using cron:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>crontab -e 0 2  * \/path\/to\/backup-script.sh<\/code><\/pre>\n\n\n\n<p>Such an approach is best for teams looking for a fully automated process without a complex setup.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">S3 sync for multiple backups<\/h3>\n\n\n\n<p>The AWS s3 sync command helps upload all directories to S3 storage. It guarantees that the Bitbucket backups are synchronized without uploading data individually.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>aws s3 sync \/path\/to\/backup-directory\/ s3:\/\/bucket-name\/<\/code><\/pre>\n\n\n\n<p>All you have to do is sync the target folder to S3:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>aws s3 sync \/path\/to\/backup-directory\/ s3:\/\/bucket-name\/<\/code><\/pre>\n\n\n\n<p>It&#8217;s a good way to avoid redundant uploads, providing automatic syncs only for new or modified data. Yet, careful storage management is required to avoid high costs.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">CI\/CD pipeline integration<\/h3>\n\n\n\n<p>Backing up Bitbucket repos can be integrated into a CI\/CD pipeline using Jenkins or Bitbucket Pipelines. It provides more control and flexibility over the schedule and upload process.<\/p>\n\n\n\n<p>You can create a Jenkins job or Bitbucket Pipeline to run the Bitbucket backup script and use aws s3 cp to upload the backup to an S3 bucket.<\/p>\n\n\n\n<p>Schedule it to run nightly or based on events, automating backup management and providing centralized lead with logging, but requiring setup and maintenance.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pipelines: \n   default: \n\t- step: \n\t   name: Build artifact \n\t   script: \n\t\t- mkdir artifact \n\t\t- echo \"Pipelines is awesome!\" &gt; artifact\/index.html \n\t   artifacts: \n\t\t- artifact\/* \n \t- step: \n\t   name: Deploy to S3 \n\t   deployment: production \n\t   script: \n\t\t- pipe: atlassian\/aws-s3-deploy:0.3.8 \n\t\t  variables: \n\t\t\tAWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID\n\t\t\tAWS_SECRET_ACCESS_KEY$ AWS_SECRET_ACCESS_KEY\n\t\t\tAWS_DEFAULT_REGION: 'us-east-1' \n\t\t\tS3_BUCKET: 'bbci-example-s3-deploy' \n\t\t\tLOCAL_PATH: 'artifact' \n\t\t\tACL: 'public-read'<\/code><\/pre>\n\n\n\n<p><em>Source: <a href=\"https:\/\/support.atlassian.com\/bitbucket-cloud\/docs\/deploy-to-aws-with-s3\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Atlassian<\/a>.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">AWS SDK for programmatic backup<\/h3>\n\n\n\n<p>A custom AWS SDK script &#8211; such as a Python boto3, Java, or Node.js &#8211; might help you manage the backup and upload process in a broader fashion.<\/p>\n\n\n\n<p>A fine example is the script generating the Bitbucket backup with bitbucket<em>.diy-backup.sh script<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import boto3\ns3 = boto3.client('s3')\ns3.upload_file('\/path\/to\/backup.tar.gz', 'bucket-name', 'backup.tar.gz')<\/code><\/pre>\n\n\n\n<p>It may fit teams looking for highly customizable solutions or complex workflows. The method provides fine-grained control yet requires programming expertise.<\/p>\n\n\n\n<p>Another code may be:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import boto3import os\ns3 = boto3.client('s3',\n   aws_access_key_id=os.getenv('AWS_ACCESS_KEY_ID'),\n   aws_secret_access_key=os.getenv('AWS_SECRET_ACCESS_KEY'))\n\nlocal_repo_path = '\/path\/to\/your\/local\/repository'\n\n   for root, dirs, files in os.walk(local_repo_path):\n      for file in files:\ns3.upload_file(os.path.join(root, file), 'your-s3-bucket', f'backups\/{file}')\n<\/code><\/pre>\n\n\n\n<p>The script recursively uploads all data in the local repository to S3. Therefore, even newly created elements are part of the backup.<\/p>\n\n\n\n<p>Of course, there are other ways to back up Bitbucket instances, like using:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>third-party backup tools<\/li>\n\n\n\n<li>AWS backup service for EC2 instances (Bitbucket hosted on EC2)<\/li>\n\n\n\n<li>AWS Lambda capabilities for event-driven backups (utilizing CloudWatch Event function).<\/li>\n<\/ul>\n\n\n\n<p>Whether you use the Git command, Bitbucket Pipelines, or custom code for automated backups, the main goal is stored data protection, including metadata.<\/p>\n\n\n\n<p>For more convenient and secure data management, consider using the <strong>GitProtect backup platform<\/strong>. It&#8217;s an all-in-one backup and disaster recovery solution for DevOps.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>A backup solution to level up the security and convenience<\/strong><\/h3>\n\n\n\n<p>Among its many advantages, it&#8217;s worth to underline (among others):<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" width=\"618\" height=\"372\" src=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-3.png\" alt=\"Bitbucket to S3 - picture 3\" class=\"wp-image-6005\" style=\"width:500px;height:auto\" srcset=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-3.png 618w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-3-300x181.png 300w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-3-400x241.png 400w\" sizes=\"(max-width: 618px) 100vw, 618px\" \/><\/figure><\/div>\n\n\n<p>With GitProtect, you can restore repositories with metadata directly to your Bitbucket account at any time. You are also free to utilize Xopero&#8217;s unlimited data retention (for archive purposes) and data replication capabilities.<\/p>\n\n\n\n<p>The tool provides you with advanced audit logs and visual statistics. The latter lets you track all actions and quickly spot potential errors. You are ready to perform backup on-demand to react immediately.<\/p>\n\n\n\n<p>The platform keeps you updated with customized emails or Slack notifications (with no log-in needed).<\/p>\n\n\n\n<p>In addition to the above, GitProtect guarantees straightforward and handy backup and restore of your repositories.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Utilizing GitProtect backup solution<\/strong><\/h2>\n\n\n\n<p>The simplest and fastest way to set store Bitbucket backup to S3 is to connect your Bitbucket and AWS S3 accounts. First, you need to <a href=\"https:\/\/helpcenter.gitprotect.io\/backup-plan-possibilities-and-the-data-solutions\/backup-and-recovery\/bitbucket-backup-and-recovery\/adding-bitbucket-organization-to-gitprotect\" target=\"_blank\" rel=\"noreferrer noopener\"><u>add the Bitbucket <\/u><\/a>organization to GitProtect. Then, it\u2019s time to prepare the proper cloud location for your data in S3 (AWS)<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Select the <strong><em>Plans<\/em><\/strong> tab on the right.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"291\" src=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-4-1024x291.png\" alt=\"Bitbucket to S3 - picture 4\" class=\"wp-image-6006\" style=\"width:500px;height:auto\" srcset=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-4-1024x291.png 1024w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-4-300x85.png 300w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-4-768x218.png 768w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-4-1536x437.png 1536w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-4-400x114.png 400w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-4.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Click <strong><em>Add plan<\/em><\/strong> and open the <strong><em>Where to store<\/em><\/strong> section. Select the data you plan to protect.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"431\" src=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-5-1024x431.png\" alt=\"Bitbucket to S3 - picture 5\" class=\"wp-image-6007\" style=\"width:500px;height:auto\" srcset=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-5-1024x431.png 1024w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-5-300x126.png 300w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-5-768x323.png 768w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-5-1536x646.png 1536w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-5-400x168.png 400w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-5.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Now, set the backup storage location to <strong><em>AWS S3<\/em><\/strong> (or any other you prefer and have an account on). You need to configure the connection and then schedule the backups.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"662\" src=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-6-1024x662.png\" alt=\"Bitbucket to S3 - picture 6\" class=\"wp-image-6008\" style=\"width:500px;height:auto\" srcset=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-6-1024x662.png 1024w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-6-300x194.png 300w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-6-768x497.png 768w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-6-400x259.png 400w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-6.png 1256w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>And that&#8217;s it! From now on, you can plan, execute, and reconfigure any setup to tailor the platform to your expectations and needs. It can be done for both DC and Cloud Bitbucket instances, depending on what service you use.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Bitbucket Cloud and Data Center (DC). What to consider?<\/h3>\n\n\n\n<p>Key technical considerations may be worth focusing on when storing backups in S3 using GitProtect between <strong>Bitbucket Cloud<\/strong> and <strong>Bitbucket Data Center<\/strong> (DC).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Backup size and data structure<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cloud<\/strong><br>Stores primarily source code and other data. It&#8217;s easier to backup, but subject to API rate limits.<\/li>\n\n\n\n<li><strong>DC<\/strong><br>Uses large datasets like application logs, large binaries, etc. &#8211; increasing backup complexity.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Bandwidth and network<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cloud<\/strong><br>Backup of repositories rely on internet bandwidth, potentially slower.<\/li>\n\n\n\n<li><strong>DC<\/strong><br>Internal network performances apply, but remote S3 storage requires significant bandwith for large data transfers.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Security and compliance<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cloud<\/strong><br>Atlassian data centers manage the security, however S3 needs proper access control.<\/li>\n\n\n\n<li><strong>DC<\/strong><br>Custom security with in-house encryption and regulatory requirements (compliance).<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Automation and scheduling<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cloud<\/strong><br>Simpler but with rate limits.<\/li>\n\n\n\n<li><strong>DC<\/strong><br>Custom scheduling and resource allocation for handling large backups (repositories) is necessary.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Restore activity<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Cloud<\/strong><br>Straightforward for repositories but needs consideration for restoring details (e.g., pipelines, comments).<\/li>\n\n\n\n<li><strong>DC<\/strong><br>Robust system for restoring large datasets is a necessity.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>A few best practices for backing up Bitbucket repositories<\/strong><\/h3>\n\n\n\n<p>There&#8217;s nothing groundbreaking in saying that securing Bitbucket repositories is not only about using the right solution (S3). It also involves good practices (e.g., versioning, SSH). It&#8217;s trivial, yet vital &#8211; no matter how experienced and technically proficient your team is.<\/p>\n\n\n\n<p>Here are some examples:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" width=\"613\" height=\"376\" src=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-7.png\" alt=\"Bitbucket to S3 - picture 7\" class=\"wp-image-6009\" style=\"width:500px;height:auto\" srcset=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-7.png 613w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-7-300x184.png 300w, https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-to-S3-7-400x245.png 400w\" sizes=\"(max-width: 613px) 100vw, 613px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Bitbucket repositories backup process summary<\/strong><\/h2>\n\n\n\n<p>Backing up Bitbucket repositories to S3 is essential for maintaining data integrity and avoiding downtime. A reliable <a href=\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-best-practices\/\" target=\"_blank\" rel=\"noreferrer noopener\">backup strategy<\/a> covers not only code storage but also the associated details such as pull requests, issue tracking, and pipelines.&nbsp;<\/p>\n\n\n\n<p>That ensures all critical components of your stored repository are secure and you can access and quickly restore when needed. That goes for both cloud and data center Bitbucket data repos.<\/p>\n\n\n\n<p>As the all-in-one backup platform, GitProtect streamlines the Bitbucket repositories backup by automating it and allowing flexible configurations. That includes full, incremental, or differential backups. The tool provides technical teams with:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>better control over<\/li>\n\n\n\n<li>data protection<\/li>\n\n\n\n<li>data replication<\/li>\n\n\n\n<li>support for <a href=\"https:\/\/xopero.com\/blog\/en\/the-evolution-of-data-backup-is-the-3-2-1-backup-rule-a-thing-of-the-past\/\" target=\"_blank\" rel=\"noreferrer noopener\">3-2-1<\/a> (3-2-1-1-0) or 4-3-2 backup rules.<\/li>\n<\/ul>\n\n\n\n<p>It minimizes the risk of information loss and supports business competitiveness.<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#f4fafe\"><a href=\"https:\/\/gitprotect.io\/sign-up.html\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>[FREE TRIAL] Ensure compliant Bitbucket backup and recovery with a 14-day trial<\/strong><\/a><strong> \ud83d\ude80<\/strong><br><br><a href=\"https:\/\/calendly.com\/d\/3s9-n9z-pgc\/gitprotect-live-demo?month=2024-08\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>[CUSTOM DEMO] Let\u2019s talk about how backup &amp; DR software for Bitbucket can help you mitigate the risks<\/strong><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Companies utilizing Bitbucket or other solutions as the primary Git-based source control must repeat a particular truism ad nauseam. Preventing data loss is vital to maintaining business continuity. One of the most crucial aspects in dealing with such a challenge is ensuring data protection in S3-compatible cloud storage.&nbsp;<\/p>\n","protected":false},"author":16,"featured_media":3830,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-3826","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bitbucket","post--single"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Bitbucket Backup to S3 - Blog | GitProtect.io<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Bitbucket Backup to S3 - Blog | GitProtect.io\" \/>\n<meta property=\"og:description\" content=\"Companies utilizing Bitbucket or other solutions as the primary Git-based source control must repeat a particular truism ad nauseam. Preventing data loss is vital to maintaining business continuity. One of the most crucial aspects in dealing with such a challenge is ensuring data protection in S3-compatible cloud storage.&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog | GitProtect.io\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/XoperoSoftware\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-25T14:02:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-21T12:22:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-backup-to-S3.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Wojciech Andryszek, Technical Content Writer at GitProtect.io\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GitProtectio\" \/>\n<meta name=\"twitter:site\" content=\"@GitProtectio\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Wojciech Andryszek, Technical Content Writer at GitProtect.io\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/\"},\"author\":{\"name\":\"Wojciech Andryszek, Technical Content Writer at GitProtect.io\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/967901c0176390b9c3fa15c5da47f37b\"},\"headline\":\"Bitbucket Backup to S3\",\"datePublished\":\"2023-01-25T14:02:29+00:00\",\"dateModified\":\"2024-11-21T12:22:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/\"},\"wordCount\":1384,\"publisher\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-backup-to-S3.jpg\",\"articleSection\":[\"Bitbucket\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/\",\"url\":\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/\",\"name\":\"Bitbucket Backup to S3 - Blog | GitProtect.io\",\"isPartOf\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-backup-to-S3.jpg\",\"datePublished\":\"2023-01-25T14:02:29+00:00\",\"dateModified\":\"2024-11-21T12:22:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#primaryimage\",\"url\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-backup-to-S3.jpg\",\"contentUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-backup-to-S3.jpg\",\"width\":1200,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Strona g\u0142\u00f3wna\",\"item\":\"https:\/\/gitprotect.io\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bitbucket Backup to S3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#website\",\"url\":\"https:\/\/gitprotect.io\/blog\/\",\"name\":\"GitProtect.io Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/gitprotect.io\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#organization\",\"name\":\"GitProtect.io\",\"url\":\"https:\/\/gitprotect.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png\",\"contentUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png\",\"width\":528,\"height\":528,\"caption\":\"GitProtect.io\"},\"image\":{\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/XoperoSoftware\/\",\"https:\/\/x.com\/GitProtectio\",\"https:\/\/www.linkedin.com\/company\/xopero-software\/\",\"https:\/\/www.youtube.com\/channel\/UCiEnl6n0mIO6w7twccz-l2w\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/967901c0176390b9c3fa15c5da47f37b\",\"name\":\"Wojciech Andryszek, Technical Content Writer at GitProtect.io\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/10\/wojciech-andryszek-technical-content-writer-at-gitprotect.io_avatar-96x96.jpg\",\"contentUrl\":\"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/10\/wojciech-andryszek-technical-content-writer-at-gitprotect.io_avatar-96x96.jpg\",\"caption\":\"Wojciech Andryszek, Technical Content Writer at GitProtect.io\"},\"description\":\"Wojtek is a Technical Content Writer at GitProtect. As a science journalist under his belt, he enjoys all kinds of knowledge. When writing about tech, Wojtek plays the role of an IT professional as well as his opposite - like Dr. Jekyll and Mr. Hyde. ;)\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/wojciech-andryszek\/\"],\"url\":\"https:\/\/gitprotect.io\/blog\/author\/wojciech-andryszek\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Bitbucket Backup to S3 - Blog | GitProtect.io","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/","og_locale":"en_US","og_type":"article","og_title":"Bitbucket Backup to S3 - Blog | GitProtect.io","og_description":"Companies utilizing Bitbucket or other solutions as the primary Git-based source control must repeat a particular truism ad nauseam. Preventing data loss is vital to maintaining business continuity. One of the most crucial aspects in dealing with such a challenge is ensuring data protection in S3-compatible cloud storage.&nbsp;","og_url":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/","og_site_name":"Blog | GitProtect.io","article_publisher":"https:\/\/www.facebook.com\/XoperoSoftware\/","article_published_time":"2023-01-25T14:02:29+00:00","article_modified_time":"2024-11-21T12:22:14+00:00","og_image":[{"width":1200,"height":600,"url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-backup-to-S3.jpg","type":"image\/jpeg"}],"author":"Wojciech Andryszek, Technical Content Writer at GitProtect.io","twitter_card":"summary_large_image","twitter_creator":"@GitProtectio","twitter_site":"@GitProtectio","twitter_misc":{"Written by":"Wojciech Andryszek, Technical Content Writer at GitProtect.io","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#article","isPartOf":{"@id":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/"},"author":{"name":"Wojciech Andryszek, Technical Content Writer at GitProtect.io","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/967901c0176390b9c3fa15c5da47f37b"},"headline":"Bitbucket Backup to S3","datePublished":"2023-01-25T14:02:29+00:00","dateModified":"2024-11-21T12:22:14+00:00","mainEntityOfPage":{"@id":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/"},"wordCount":1384,"publisher":{"@id":"https:\/\/gitprotect.io\/blog\/#organization"},"image":{"@id":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#primaryimage"},"thumbnailUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-backup-to-S3.jpg","articleSection":["Bitbucket"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/","url":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/","name":"Bitbucket Backup to S3 - Blog | GitProtect.io","isPartOf":{"@id":"https:\/\/gitprotect.io\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#primaryimage"},"image":{"@id":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#primaryimage"},"thumbnailUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-backup-to-S3.jpg","datePublished":"2023-01-25T14:02:29+00:00","dateModified":"2024-11-21T12:22:14+00:00","breadcrumb":{"@id":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#primaryimage","url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-backup-to-S3.jpg","contentUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/01\/Bitbucket-backup-to-S3.jpg","width":1200,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/gitprotect.io\/blog\/bitbucket-backup-to-s3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Strona g\u0142\u00f3wna","item":"https:\/\/gitprotect.io\/blog\/"},{"@type":"ListItem","position":2,"name":"Bitbucket Backup to S3"}]},{"@type":"WebSite","@id":"https:\/\/gitprotect.io\/blog\/#website","url":"https:\/\/gitprotect.io\/blog\/","name":"GitProtect.io Blog","description":"","publisher":{"@id":"https:\/\/gitprotect.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gitprotect.io\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/gitprotect.io\/blog\/#organization","name":"GitProtect.io","url":"https:\/\/gitprotect.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png","contentUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2023\/05\/favicon-528x528-1.png","width":528,"height":528,"caption":"GitProtect.io"},"image":{"@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/XoperoSoftware\/","https:\/\/x.com\/GitProtectio","https:\/\/www.linkedin.com\/company\/xopero-software\/","https:\/\/www.youtube.com\/channel\/UCiEnl6n0mIO6w7twccz-l2w"]},{"@type":"Person","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/967901c0176390b9c3fa15c5da47f37b","name":"Wojciech Andryszek, Technical Content Writer at GitProtect.io","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/gitprotect.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/10\/wojciech-andryszek-technical-content-writer-at-gitprotect.io_avatar-96x96.jpg","contentUrl":"https:\/\/gitprotect.io\/blog\/wp-content\/uploads\/2024\/10\/wojciech-andryszek-technical-content-writer-at-gitprotect.io_avatar-96x96.jpg","caption":"Wojciech Andryszek, Technical Content Writer at GitProtect.io"},"description":"Wojtek is a Technical Content Writer at GitProtect. As a science journalist under his belt, he enjoys all kinds of knowledge. When writing about tech, Wojtek plays the role of an IT professional as well as his opposite - like Dr. Jekyll and Mr. Hyde. ;)","sameAs":["https:\/\/www.linkedin.com\/in\/wojciech-andryszek\/"],"url":"https:\/\/gitprotect.io\/blog\/author\/wojciech-andryszek\/"}]}},"_links":{"self":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts\/3826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/comments?post=3826"}],"version-history":[{"count":5,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts\/3826\/revisions"}],"predecessor-version":[{"id":6012,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/posts\/3826\/revisions\/6012"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/media\/3830"}],"wp:attachment":[{"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/media?parent=3826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/categories?post=3826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gitprotect.io\/blog\/wp-json\/wp\/v2\/tags?post=3826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}