Try   HackMD

0. 前置作業

系統環境

新的 BT 需使用 php7,因此新環境使用以下套件安裝指令:

sudo apt update sudo apt install vim apache2 mysql-server php7.0 php7.0-mysql libapache2-mod-php7.0 phpmyadmin

資料轉移

資料進行轉移,匯出原資料庫內容,並從新資料庫匯入。
因為 BT 資料量龐大,因此使用 phpmyadmin 時,可能會遇到上傳檔案會有檔案大小限制,如需修改要到:/etc/php/7.0/apache2/php.ini 中修改 post_max_sizeupload_max_filesize


1. 複製設定檔

由於舊設定檔其實沒有很完全,因此複製新設定檔來做修改。

填入 $g_crypto_master_salt

這項資料如果沒有填入的話就會無法使用 BT,因此手動產生後填入。
使用指令生成隨機字串填入 $g_crypto_master_salt

cat /dev/urandom | head -c 64 | base64

其他的就照原本的填入即可。如:$g_hostname$g_db_username$g_db_password$g_database_name$g_db_type$g_phpMailer_method$g_smtp_host$g_smtp_username$g_smtp_password

有一些新設定我也有做設定,如:

$g_webmaster_email='cmrdb-server@googlegroups.com' $g_from_email='cmrdb-server+noreply@googlegroups.com' $g_return_path_email='cmrdb-server@googlegroups.com' $g_from_name='CMRDB Mantis Bug Tracker'

2. 開始進行資料庫升級

進入網站 base/admin/install.php 這個網址,如:http://bt.newdns.cmrdb.cs.pu.edu.tw/admin/install.php,若設定正確,畫面應如下圖所示:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

此時即可按下 Install/Upgrade Database 按鈕進行資料庫升級,升級後應就完成。