我们需要备份什么?

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 EBS, LVM, NetApp, XFS, 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

转载于:https://www.cnblogs.com/imcati/p/9634870.html

Bitbucket备份恢复相关推荐

  1. 备份集过期时间_TiDB备份恢复方式你知多少?

    背景 学习一款数据库,要学会备份和恢复.备份是一个严谨的工作,作为一个dba,掌握数据库备份.恢复的各种手段. 下面让我们一起来看看TiDB的备份恢复有那些手段吧. 基于MVCC的恢复方式 相关原理已 ...

  2. 虚拟桌面的备份恢复最佳实践 第一部分

    摘要 VMware View 是目前虚拟桌面市场的旗舰产品.借助它,企业可以将办公系统.应用和基础架构以高性能.高度可扩展的集中式托管服务形式交付给用户.View 还可提供保护它所支持的系统和应用以及 ...

  3. mysql备份数据库语句6_13.4 MySQL用户管理;13.5 常用sql语句;13.6 MySQL数据库备份恢复...

    扩展 : SQL语句教程 什么是事务?事务的特性有哪些? 根据binlog恢复指定时间段的数据 mysql字符集调整 使用xtrabackup备份innodb引擎的数据库  innobackupex  ...

  4. mysql用户管理,常用sql语句,mysql数据库备份恢复

    2019独角兽企业重金招聘Python工程师标准>>> mysql用户管理 grant all on . to 'user1' identified by 'passwd'; gra ...

  5. 什么鬼!基于备份恢复的实例数据还能变多?

    此文已由作者温正湖授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 对数据库进行数据备份无非两种方式,一种是逻辑备份,也就是直接连上数据库导出所有的数据,对于MySQL,就是通 ...

  6. mysql 数据库 xtrabackup (完全备份恢复,恢复后重启失败总结)

    一. 完全备份恢复说明 xtrabackup二进制文件有一个xtrabackup --copy-back选项,它将备份复制到服务器的datadir目录下.下面是通过 --target-dir 指定完全 ...

  7. RDS for MySQL 5.7 备份恢复为本地实例

    RDS for MySQL 5.7 备份恢复为本地实例 1. 本地环境 2. 恢复步骤 3. 后记 近期同学咨询反馈 RDS for MySQL 5.7 备份恢复本地实例的问题比较多,提供一个恢复样例 ...

  8. 完整恢复模式下的备份/恢复

    SQL SERVER 2005 支持三种方式的备份/恢复 1.简单恢复模式下的备份/恢复模 2.完整恢复模式下的备份/恢复 3.大容量日志恢复模式下的备份/恢复   [注]Microsoft关于备份/ ...

  9. mysql备份恢复实验

    内容大纲: 一 mysqldump备份 二 sql语句备份 三 mysqlbinlog备份恢复 一 mysqldump数据文件备份恢复 mysql> use cw_d; Database cha ...

最新文章

  1. linux网络命名空间详解,Linux Network Namespace (netns) 详解
  2. 杨薇天津大学计算机专业,高考志愿报得好,一生幸福少不了,遇到问题怎么办?静海一中校友来支招儿~...
  3. PHP的void mixed
  4. android 能调用gcc_如何在命令行下使用Android NDK交叉编译工具
  5. 新三国 雷人台词----雷死一群程序员
  6. 什么是Redis?简述它的优缺点?
  7. SQL Server 2012安装配置(Part2 )
  8. 京东金融回应用户遭盗刷:系用户点击假冒链接 输短信验证码致密码泄露
  9. 分布式监控系统Zabbix3.2给异常添加邮件报警
  10. 获取输入数组的最小值(含界面)例子详细分析
  11. Layer表格复选框,禁止勾选某行
  12. Scrapy:爬取豆瓣图书
  13. 每日一题 - 微博系统崩溃,如何解决 ?
  14. Logback设置property参数
  15. 个人支付免费开通支付宝付款功能(免费签约)支付宝当面付开通集成到网站教程
  16. 程序员面试被问,有没有别家的offer?这个问题怎么回答?
  17. 线程池系列三:动态修改线程池队列大小
  18. 全网各编程语言的爱心代码合集
  19. 顶级摄影师镜头下的世界美景(组图)
  20. 详解DNS(理论篇)

热门文章

  1. 使用python多线程下载网络小说并结合calibre制作电子书
  2. 苹果手机怎么解屏幕锁_小米手机刷机第1步:解BL锁教程
  3. IOS - iPhoneX 怎么进入 DFU 模式(刷机必备)?
  4. [读书笔记]结绳记事
  5. Python哔哩哔哩弹幕爬取+词云生成
  6. Django和Flask区别
  7. 区块链治理框架总结,从Telos实践说起
  8. 在CMD下使用sc命令,报openservice failed 1060错误
  9. 验证wireshark追踪qq图片
  10. 在windows 10中新建文本文档,只有txt文件双击打不开,但右键点编辑可以打开。