備份
需拷貝在以下路徑的數(shù)據(jù):備份/opt/zbox/app/zentao/www/data/upload/1和/opt/zbox/data/mysql/zentao的數(shù)據(jù)
遷移和恢復(fù)
前提條件:在目標(biāo)服務(wù)器上,安裝相同版本的zbox一鍵安裝包
1.安裝相同版本的zbox
具體操作步驟如下:
# 1.從備份服務(wù)器上將對應(yīng)禪道開源版的安裝包拷貝到目標(biāo)服務(wù)器上
$ scp root@xx.xx.xx.xx:/public/install/setup/ZenTaoPMS.12.0.1.zbox_64.tar.gz /data/download
root@dj:/data/download# ls
ZenTaoPMS.12.0.1.zbox_64.tar.gz
# 2.解壓安裝包到/opt目錄下
$ tar -zxvf ZenTaoPMS.12.0.1.zbox_64.tar.gz -C /opt
# 3.修改禪道自帶的apache滓玖、mysql端口坪哄,默認(rèn)的apache和mysql的端口號為80/3306
$ /opt/zbox/zbox -ap 8070 -mp 3308
# 4.啟動禪道服務(wù)并查看禪道服務(wù)的狀態(tài)
$ /opt/zbox/zbox start
Start Apache success
Start Mysql success
$ /opt/zbox/zbox status
Apache is running
Mysql is running
# 5.配置iptables防火墻規(guī)則,允許端口訪問
Ubuntu20.04一般都默認(rèn)安裝了UFW(Uncomplicated Firewall)势篡,它是一款輕量化的工具损姜,主要用于對輸入輸出的流量進(jìn)行監(jiān)控,如果沒有安裝殊霞,執(zhí)行命令安裝:sudo apt install ufw
1)啟用ufw
$ ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startup
2)查看ufw的狀態(tài)是處于active狀態(tài)
$ /opt/zbox/app/zentao/tmp# ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip
3)打開允許外部訪問的端口
$ /opt/zbox/app/zentao/tmp# ufw allow 8070
Rule added
Rule added (v6)
$ /opt/zbox/app/zentao/tmp# ufw allow 3308
Rule added
Rule added (v6)
4)重啟防火墻
$ /opt/zbox/app/zentao/tmp# ufw reload
Firewall reloaded
######ufw其它使用的命令補充######
ufw disable #關(guān)閉防火墻
ufw deny 端口號 #關(guān)閉外部訪問的端口號
# 6.重啟禪道服務(wù)
$ /opt/zbox/zbox restart
Retart Apache success
Retart Mysql success
# 7.驗證禪道服務(wù)已經(jīng)安裝完畢
用瀏覽器進(jìn)行打開http://xx.xx.xx.xx:8070/zentao/login,首次登陸需要求更改密碼
賬號:admin 密碼: #默認(rèn)賬戶密碼
賬號:admin 密碼: #修改后的賬戶密碼
2.恢復(fù)原禪道上的數(shù)據(jù)
具體操作步驟如下:
# 1.停掉原有的禪道服務(wù)摧阅,操作關(guān)閉2次
$ /opt/zbox/zbox stop
Stop Apache fail. You can see the log /opt/zbox/logs/apache_error.log
Stop Mysql success
$ /opt/zbox/zbox stop
Apache is not running
Mysql is not running
# 2.在原服務(wù)器上,將禪道數(shù)據(jù)庫和附件拷貝到目標(biāo)服務(wù)器的相同目錄
數(shù)據(jù)庫目錄:/opt/zbox/data/mysql/zentao
附件目錄:/opt/zbox/app/zentao/www/data/upload/1
$ scp -r xx.xx.xx.xx:/zbox/zentao /opt/zbox/data/mysql/
$ scp -r xx.xx.xx.xx:/zbox/1 /opt/zbox/app/zentao/www/data/upload/
# 3.重啟禪道服務(wù)
$ /opt/zbox/zbox start
Start Apache success
Start Mysql success
# 4.驗證禪道服務(wù)已經(jīng)恢復(fù)
使用瀏覽器打開http://目標(biāo)服務(wù)器ip:8070/zentao,登錄后查看對應(yīng)的項目bug記錄是否與原有的一致
解決禪道admin忘記密碼
進(jìn)行修改禪道admin的密碼绷蹲,禪道數(shù)據(jù)庫root默認(rèn)密碼123456
具體操作如下:
$ /opt/zbox/run/mysql/mysql -uroot -p
Enter password:
# 禪道數(shù)據(jù)庫root默認(rèn)密碼123456
MariaDB [(none)]> show databases;
+--------------------+
| Database? ? ? ? ? |
+--------------------+
| information_schema |
| mysql? ? ? ? ? ? ? |
| performance_schema |
| zentao? ? ? ? ? ? |
+--------------------+
4 rows in set (0.001 sec)
MariaDB [(none)]> use zentao;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [zentao]> select id,account,password from zt_user;
+----+----------+----------------------------------+
| id | account? | password? ? ? ? ? ? ? ? ? ? ? ? |
+----+----------+----------------------------------+
|? 1 | admin? ? | 04eaf212376751a24309e7427fd40ad5 | |
+----+----------+----------------------------------+
20 rows in set (0.000 sec)
MariaDB [zentao]> update zt_user set password='e10adc3949ba59abbe56e057f20f883e' where id=1;
Query OK, 1 row affected (0.001 sec)
Rows matched: 1? Changed: 1? Warnings: 0
# e10adc3949ba59abbe56e057f20f883e即:123456
MariaDB [zentao]> exit
Bye