导航

Jira数据备份

Posted on 2011-06-17 13:58  蝈蝈俊  阅读(1054)  评论(0编辑  收藏  举报

Jira系统管理中自带备份和导入功能,如下图:

image

但是你使用时会报错误:

You have not named a safe backup directory and hence you are not allowed to make backups for security reasons. You must edit jira-application.properties and explicitly set 'jira.paths.safe.backup.path=/to/some/safe/path'. Restart JIRA and then you will be able to make arbitrary backups. NOTE : If you are using Windows, you will need to use double \ characters, for example d:\\some\\safe\\path

解决方法:

我之前安装方法是采用下面方法:

http://www.cnblogs.com/ghj1976/archive/2010/09/27/1837008.html

一、编辑并修改 \edit-webapp\WEB-INF\classes\jira-application.properties 文件

主要是 jira.paths.safe.backup.path 属性设置上。

注意看对应的注释, Window和Linux的写法有差异。

 

二、编译

执行 sudo ./build.sh war

 

三、部署并修改配置文件

我装的是 Tomcat 6 所以我的 war 文件应该是:

/home/jira/dist-tomcat/tomcat-6/  目录下的

copy jira.xml 文件到 tomcat 目录下:

sudo cp /home/jira/dist-tomcat/tomcat-6/jira.xml /opt/apache-tomcat-6.0.29/conf/Catalina/localhost/

并修改这个文件如下:

<Context path="/jira" docBase="path/to/atlassian-jira-4.0.war">
  <Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"
    username="jirauser"
    password="mypassword"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost/jiradb?useUnicode=true&amp;characterEncoding=UTF8&amp;autoReconnect=true&amp;mysqlEncoding=utf8"
    maxActive="20"
    validationQuery="select 1"/>
  <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"
    factory="org.objectweb.jotm.UserTransactionFactory"
    jotm.timeout="60"/>
  <Manager pathname=""/>
</Context>

 

四、重启 jira

启动 Tomcat

通过  bin/startup.sh 启动 tomcat

 

之后这里就可以正常备份了。

 

 

参考资料:

http://hi.baidu.com/iis7/blog/item/3e9dfddaf850e2d7b7fd4866.html

http://www.fangwai.net/bbs/redirect.php?fid=1&tid=5288&goto=nextoldset

http://www.cnblogs.com/ghj1976/archive/2010/09/27/1837008.html

http://hi.baidu.com/tianlu_0_0/blog/item/c20cad341726861991ef3917.html