惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
G
Google Developers Blog
博客园 - 三生石上(FineUI控件)
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
V
V2EX
Vercel News
Vercel News
U
Unit 42
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
J
Java Code Geeks
WordPress大学
WordPress大学
罗磊的独立博客
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
M
MIT News - Artificial intelligence
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Apple Machine Learning Research
Apple Machine Learning Research
Martin Fowler
Martin Fowler
云风的 BLOG
云风的 BLOG

博客园 - 一望无际的南

wps转PDF-解决IPAD中PDF乱码问题 thinkserver TS250 虚拟化主机部署 小微企业的数据备份方案 mac idea 修改git账号 coder,不要做计算机,好吗? mac 同一应用多实例的切换 沙雕的git Plugin 一行命令完成linux对文件的授权 jira 8.x 性能调优 NODEJS npm build 中哪些乱码是什么? DT 还是IT 混乱的docker swarm 版本在运维的重要性 nginx 在linux下端口被禁用问题 2020年服务器迁移 当,规范什么都不是 记阿里云SLB后配置Nginx反向代理百度地图API的坑 gradle介绍 Centos7 改名问题
bitbucket灾难恢复或者服务迁移指南
一望无际的南 · 2020-01-31 · via 博客园 - 一望无际的南


注意:
本教程适合bitbucket的灾难恢复或者服务迁移

前提条件
已经使用bitbucket backup client 做了备份

环境说明

* centos 7
* SQL Server 2012
* Java 1.8
* Bitbucket

old edition - Atlassian Bitbucket v6.3.0
new edition - Atlassian Bitbucket v6.10.0

术语
bitbucket.home 指bitbucket的数据目录
例如: /var/atlassian/application-data/bitbucket
bitbucket 运行目录,指应用目录
例如: /opt/atlassian/bitbucket/[version]


参考文档:
[Using the Bitbucket Server Backup Client](https://confluence.atlassian.com/bitbucketserver/using-the-bitbucket-server-backup-client-776640064.html)

操作步骤:

> 1 - Create a new empty home directory using the user account that will be used to run Bitbucket Server.
```shell
chown atlbitbucket:atlbitbucket /path/to/[bitbucket.home]
```
> 2 - Create the 2 emtpy databases for importing old database and the new one
It should have the configuration described in the ' Create the Bitbucket Server database' section of the relevant page here:
MySQL
Oracle
PostgreSQL
SQL Server

**Even the new one will be retird but it will be used in restore process.**

> 3 - Run the Restore Client. See the following section for details.

here is an exmaple,
```shell
java -Djdbc.override=true -Djdbc.driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" -Djdbc.url="jdbc:sqlserver://192.168.0.22:1433;databaseName=bit2_db;" -Djdbc.user="bit_user" -Djdbc.password="*****" -Dbitbucket.home="/disk2/atlassian/application-data/bitbucket" -jar bitbucket-restore-client.jar /root/bitbucket-20200130-225735-289.tar
```

> 4 - starting to install toally new one of bitbucket

*Install Bitbucket server on the new server by following the instructions on Running the Bitbucket Server installer. Point the installation to an empty directory and install it as a service in case you used to have that in your previous server.*

Make sure your new installation is up and running - refer to Starting and stopping Bitbucket Server. At this stage you should see Bitbucket server guiding you for a configuration from scratch (i.e. it will ask you for license details, admin user etc.) and that's expected.

> 5 -Stop the newly installed instance.

```shell
su - atlbitbucket
cd /opt/atlassian/bitbucket/[version]/bin
sh stop-bitbucket.sh

```
> 6 - rename the new installed HOME directory & rename the old one to the HOME

be careful, change the owner of the HOME directory
```shell
chown atlbitbucket:atlbitbucket /path/to/HOME
```

> 7 - start bitbucket seeing step 5th;

sh start-bitbucket.sh


> 启动后,可能有多种原因无法启动:

1. 在HOME下面的shared bitbucket.properties 数据库连接需要配置为登录到老的数据库
2. 注意: app_property表,与新建的实例的数据库比较,更新为新的实例的一样。
* instance.home
* license
* server.id

再重启,正常了。