bitbucket災難恢復或者服務遷移指南


 


注意:
本教程適合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

再重啟,正常了。

 

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM