我们需要备份什么?

home directory:contains  repository data, log files, plugins, and so on.

database:contains data about pull requests, comments, users, groups, permissions, and so on.

备份的策略

 
Zero Downtime Backup
DIY Backup
Backup Client
Summary A technique that eliminates downtime completely using internally consistent database snapshots and block-level filesystem snapshots A technique that minimizes downtime using incremental copy or vendor-specific snapshot technology

Simple but unsuitable for use in high availability environments.

An external utility which locks a Bitbucket Server instance and backs up its entire home directory and database in a vendor-independent format.

Downtime  Zero at backup time.

 Low. Only needs to lock Bitbucket briefly to create a consistent snapshot. Downtime can be as low as a few seconds.

 High. Bitbucket is locked for the entire duration of the backup process, which may take several minutes or longer, especially in large organizations.

Minimum product version Bitbucket 4.8+

Stash 2.12+

Bitbucket 4.0+

Stash 2.7+

Bitbucket 4.0+

Bitbucket Server  Supported. Bitbucket tolerates (but does not attempt to resolve) any inconsistencies between the home directory and database after restoring.  Supported  Supported
Bitbucket Data Center  Supported. Bitbucket can perform an integrity check at restore time to scan for inconsistencies between the home directory and database,and resolve them.  Supported  Not supported, even if you are running on one cluster node.
Minimum requirements
  • Requires you to use the snapshot tools of your file system and database vendor. Example scripts are provided.
  • Requires your home directory to be on a file system volume capable of atomic (block level) snapshots, for example, Amazon EBSLVMNetAppXFS, or ZFS.
  • Minimizing the time between database andfilesystem snapshots (or using vendor-specific point-in-time recovery) reduces the chances of inconsistencies occurring

Requires you to use the snapshot tools of your file system and database vendor. Example scripts are provided.

No special requirements. "Just works" out of the box.
Backup format Vendor-specific database snapshot and block level file system snapshot of the entire disk volume. Vendor-specific database dump and file system snapshot.

Database vendor-independent.

Documentation Using Bitbucket zero downtime backup Using Bitbucket Server DIY Backup Using the Bitbucket Server Backup Client

我们这边采用第三种方式进行备份。

备份包括:

  • the database Bitbucket Server is connected to (either the internal or external DB)
  • managed Git repositories
  • the Bitbucket Server audit logs
  • installed plugins and their data

不包括:

  • export/*
  • log/* (except for the audit logs)
  • shared/data/db* (HSQL data in the DB is backed up, but the files on disk are not)
  • tmp
  • the plugins directory (except for the installed-plugins directory)  

下载指定备份插件: release of the Bitbucket Server Backup Client that is compatible with your Bitbucket Server instance

解压下载的插件包,进行相关配置(编辑 backup-config.properties 文件)

#备份

bitbucket.home=/var/atlassian/application-data/Bitbucket  #bitbucket家目录

bitbucket.user=bitbucket # bitbucker备份的账户

bitbucket.password=xxxxx #账户密码

bitbucket.baseUrl=http://localhost:7990 #bitbucket地址

backup.home=/S3/bitbucket #  备份的路径

#恢复

jdbc.override=true

jdbc.driver=org.postgresql.Driver #配置引擎为postgresql

jdbc.url=jdbc:postgresql://localhost:5432/bitbucket    #postgresql 中Bitbucket 仓库数据库地址

jdbc.user=bitbucket # postgresql 中 Bitbucket 账户

jdbc.password=xxxxx  #密码

#备份命令

java -jar /path/to/bitbucket-backup-client.jar

#恢复命令  需先清空数据库和bitbucket家目录中的数据

停掉Bitbucket服务

rm -rf /var/atlassian/application-data/bitbucket

su - postgres ; psql ; drop database Bitbucket

java -jar /path/to/bitbucket-restore-client.jar  /S3/bitbucket/backup/bitbucket-xxxxx.tar

参考链接:https://confluence.atlassian.com/bitbucketserver0414/using-the-bitbucket-server-backup-client-895368009.html

Bitbucket备份恢复的更多相关文章

  1. MySQL 系列(四)主从复制、备份恢复方案生产环境实战

    第一篇:MySQL 系列(一) 生产标准线上环境安装配置案例及棘手问题解决 第二篇:MySQL 系列(二) 你不知道的数据库操作 第三篇:MySQL 系列(三)你不知道的 视图.触发器.存储过程.函数 ...

  2. 基于MySQL MEB的备份恢复

    MEB(MySQL Enterprise Backup)是MySQL商业版中提供的备份工具,属于物理备份. 同XtraBackup一样,mysqlbackup的使用过程同样包含如下三个步骤: 备份(- ...

  3. Xtrabackup原理及使用innobackupex进行MySQL数据库备份恢复

    Xtrabackup是由percona提供的mysql数据库备份工具,据官方介绍,这也是世界上惟一一款开源的能够对innodb和xtradb数据库进行热备的工具. Xtrabackup中主要包含两个工 ...

  4. 在Linux操作系统下备份恢复技术的应用 转自https://yq.aliyun.com/articles/50205?spm=5176.100239.blogcont24250.9.CfBYE9

    摘要: 安全防护:在Linux操作系统下备份恢复技术的应用  原文参见:http://linux.chinaunix.net/techdoc/system/2005/12/19/925898.shtm ...

  5. mongodb 的备份恢复导入与导出

    导入导出 use hndb; db.s.save({name:'李四',age:18,score:80,address:'郑州'}); db.s.save({name:'李三',age:8,score ...

  6. [转]PLSQL Developer备份恢复oracle数据

    本文转自:http://www.cnblogs.com/iampkm/archive/2013/06/09/3128273.html 使用PL sql提供的功能可以快速的备份恢复oracle数据. 1 ...

  7. MongoDB学习(三)数据导入导出及备份恢复

    这几天想着公司要用MongoDB,自然就要用到数据导入导出,就自己学习了一下. 在Mongo学习(二)中就讲到了在bin目录下有一些工具,本篇就是使用这些工具进行数据的导入导出及备份恢复. 注意:以下 ...

  8. Oracle RMAN备份恢复指导书

    目 录 1 目的与范围... 1 2 术语和定义... 1 3 角色和职责... 2 4 使用RMAN备份数据库... 2 4.1.1 检查数据库模式... 2 4.1.2 连接到target数据库. ...

  9. 中小型数据库 RMAN CATALOG 备份恢复方案(二)

    中小型数据库呈现的是数据库并发少,数据库容量小,版本功能受限以及N多单实例等特点.尽管如此,数据库的损失程度也会存在零丢失的情形.企业不愿意花太多的钱又要保证数据库的可靠稳定,可是苦煞了我这些搞DB的 ...

随机推荐

  1. [pat]1007 Maximum Subsequence Sum

    经典最大连续子序列,dp[0]=a[0],状态转移dp[i]=max(dp[i-1]+a[i],a[i])找到最大的dp[i]. 难点在于记录起点,这里同样利用动态规划s[i],如果dp[i]选择的是 ...

  2. Go linux 实践 1

    引言: 如果,曾经,你以作为一名C语言应用开发者而自豪,那么后来你应该以用C++来开发为时髦,当JAVA出现时,你可能会说“这小子,有两下子嘛!” 但是,当你以JAVA专家出厂时,哈哈,返过头来面对J ...

  3. 使用dynamic引发的异常:无法对 null 引用执行运行时绑定

    今天上午运营反映有商户的账单没有生成. 查看日志,在批量生成账单服务执行过程中,因为如下异常而中断了: 跑批异常 Microsoft.CSharp.RuntimeBinder.RuntimeBinde ...

  4. struts2实现jQuery的异步交互

    struts2中jQuery的异步交互有两种方式: 1)是利用构造字符串的方式来实现: 使用该方法主要是在服务器端根据前端的请求,返回一个字符串信息,然后前端的jQuery通过解析该字符串信息得到对应 ...

  5. C# 基于DocumentFormat.OpenXml的数据导出到Excel

    using DocumentFormat.OpenXml; using DocumentFormat.OpenXml.Packaging; using DocumentFormat.OpenXml.S ...

  6. 导入转储文件的时候:Error Code: 1406. Data too long for column - MySQL

    MySQL will truncate any insert value that exceeds the specified column width. to make this without e ...

  7. d'jang基础

    1,建立一个名为guest的django项目,django-admin startproject  guest 生成一个guest文件夹,包含一个guest文件夹和一个manage.py cd gue ...

  8. UML之组件图

    基本概念:组件图即是用来描述组件与组件之间关系的一种UML图.组件图在宏观层面上显示了构成系统某一个特定方面的实现结构. 组件图中主要包含三种元素,即组件.接口和关系. 组件图通过这些元素描述了系统的 ...

  9. 【转】HTTP429

    转载:http://codewa.com/question/45600.html Q:How to avoid HTTP error 429 (Too Many Requests) python Q: ...

  10. 解释器模式 Interpreter

    代码例子 参考 1.解释器模式定义 给定一个语言,定义它的文法的一种表示,并定义一个解释器,这个解释器使用该表示来解释语言中的句子. 说明:解释器模式设计到文法规则和抽象语法树. 2.解释器模式的结构 ...