環境:
- 作業系統為ubuntu13.**版本,非長期支援版。
- 安裝目錄:/opt/redmine-2.3.1-0/
- 所有者使用者:root
安裝過程:
1. 備份2.3.1資料庫
sudo /opt/redmine-2.3.1-0/mysql/bin/mysqldump -u bitnami -p bitnami_redmine > /home/erick/redmineback/2.3.1backup.sql
2. 備份2.3.1的配置檔案和files目錄(上傳檔案)
cp /opt/redmine-2.3.1-0/apps/redmine/htdocs/config/database.yml /home/erick/redmineback/
cp /opt/redmine-2.3.1-0/apps/redmine/conf/redmine.conf /home/erick/redmineback/
cp /opt/redmine-2.3.1-0/apps/phpmyadmin/conf/phpmyadmin.conf /home/erick/redmineback/
cp /opt/redmine-2.3.1-0/apache2/conf/httpd.conf /home/erick/redmineback/
mkdir /home/erick/redmineback/files
cp /opt/redmine-2.3.1-0/apps/redmine/htdocs/files/* /home/erick/redmineback/files
cp /opt/redmine-2.3.1-0/apps/redmine/htdocs/public/favicon.ico /home/erick/redmineback/
3. 下載並安裝最新redmine bitnami3.2.2安裝包,目錄與之前的區分開
/opt/redmine-3.2.2-0/
4. 備份3.2.2的資料庫
sudo /opt/redmine-3.2.2-0/mysql/bin/mysqldump -u bitnami -p bitnami_redmine > /home/erick/redmineback/3.2.2backup.sql
5. 刪除並建立3.2.2的資料庫
sudo /opt/redmine-3.2.2-0/mysql/bin/mysql -u bitnami -p
DROP DATABASE bitnami_redmine;
CREATE DATABASE bitnami_redmine;
quit
6. 用2.3.1的備份資料恢復到3.2.2的資料庫中
通過phpmyadmin的匯入功能實現
7. 遷移3.2.2的資料庫
cd /opt/redmine-3.2.2-0/apps/redmine/htdocs
sudo /opt/redmine-3.2.2-0/ruby/bin/ruby bin/rake db:migrate RAILS_ENV=production
8. 修改3.2.2的配置檔案
設定apache,啟用gogs,修改apache引數檔案:
/opt/redmine-3.2.2-0/apache2/conf/httpd.conf
在最後增加以下配置資訊:
<VirtualHost *:80> DocumentRoot "/opt/redmine-3.2.2-0/apps/redmine/htdocs/public/" ServerName qa.yncic.com ServerAlias qa.yncic.com </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@domain.tld ServerName git.yncic.com ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://localhost:3000/ ProxyPassReverse / http://localhost:3000/ </VirtualHost>
9. 拷貝files目錄到3.2.2中
sudo cp -r /opt/redmine-2.3.1-0/apps/redmine/htdocs/files/* /opt/redmine-3.2.2-0/apps/redmine/htdocs/files/
sudo chown -R daemon:daemon /opt/redmine-3.2.2-0/apps/redmine/htdocs/files/*
10. 拷貝icon圖示
sudo cp /opt/redmine-2.3.1-0/apps/redmine/htdocs/public/favicon.ico /opt/redmine-3.2.2-0/apps/redmine/htdocs/public/favicon.ico
參考資料
https://wiki.bitnami.com/Applications/BitNami_Redmine#How_to_upgrade_Redmine.3f
https://wiki.bitnami.com/Components/MySQL#How_to_create_a_database_backup.3f
http://fableking.iteye.com/blog/1395366
http://blog.csdn.net/shishuo365/article/details/45999053