公司的Redmine需要从0.8.3升级到最新版本并从Windows服务器迁移到Linux服务器。

Redmine异构环境迁移:

 

迁移前的环境:

Windows 2003 InstantRails集成环境(2007的版本) redmine 0.8.3

注:没有安装插件。如果有插件,可能本迁移方法可能行不通。

迁移后的环境:

CentOS 5.2 x86 Ruby 1.9.3 Redmine 2.0 Mysql

 

我是参考官网升级的方法来做的迁移:

http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade

 

一、准备迁移环境

 

1,按照之前的文章准备Linux的环境,做到3.4创建Session存储脚本这一步就可以了。

 

2,在Windows 服务器上将Redmine的数据库备份出来,并拷贝到Linux环境下

mysqldump -u <username> -p<password> <redmine_database> > redmine.sql

Linux环境下恢复数据库:

Mysql –u username –p password redmine < redmine.sql

 

些时Linux环境数据库中已经有原来的数据库了。

 

1,  Windows服务器上Redmine目录中的File目录内的文件拷贝到Linux环境中的相同目录下。

 

2,  Linux Redmine 目录中:

 

copy config/configuration.yml.example config/configuration.yml

 

参照Windows服务器中config/email.yml的配置内容编辑configruation.yml

vim config/configuration.yml

这里配置好邮件

 

3,  相关准备都做好了,开始更新数据库

 

rake db:migrate RAILS_ENV=production

 

如果此步没有出错,基本没有问题了。

 

4,  清除缓存与Session

 

rake tmp:cache:clear

rake tmp:sessions:clear

 

5,  启动测试系统是否能正常访问:

 

ruby script/rails server webrick -e production

 

9,通过Aapche访问redmine

 

后台运行Redmine

nohup ruby script/rails server webrick -e production &

 

Apache配置文件中添加一个虚拟主机

 

<VirtualHost *:80>

       ServerName redmine.company.com

       ProxyPass / http://localhost:3000/

       ProxyPa***everse / http://localhost:3000/

</VirtualHost>

 

重启Aapche 就可以通过域名访问Redmine

 

注:官网提供了相关Redmine集成到Apache的启动方式,但是那样比较复杂,上面处理方式比较简单。

http://www.redmine.org/search?wiki_pages=1&q=apache