之前很多朋友在问我,为什么要做元数据?前篇博客已经说到报表服务器的安装以及配置,报表服务器元数据库的迁移主要是针对如登录的用户表,拥有没有资源的访问等等的管理。这篇文章将着重讲怎么去迁移. 在进行数据库迁移之前,我们必须保证元数据库存在,因此我们首先要在目标服务器上跑BiServer\biserver-ce-6.0.1.0-386\biserver-ce\data下相应的脚本。这里以元数据迁移至mysql为例说明,因此我需要先跑mysql5 下的所有脚本。之后我们能看到如下几个数据库;(sampledata可有可无)
)
其中hibernate数据库的user表代表用户,authorities 代表角色。granted_authorities 是所有能访问biserver的用户以及其对应的角色。其它表不再一一说明。
然后,怎么迁移已经跨出来了第一步。接下来需要将mysql的驱动拷贝到biserver-ce\tomcat\lib 下,以让biserver找到mysql的驱动。接下来就是继续修改Pentaho 的xml配置文件。
文档位置:biserver-ce\tomcat\webapps\pentaho\META-INF\context.xml示例如下:
打开biserver-ce\pentaho-solutions\system\hibernate中的hibernate-settings.xml配置文件,并启用mysql5.hibernate.cfg.xml配置文件,配置示例如下。
biserver-ce\pentaho-solutions\system\applicationContext-spring-security-hibernate.properties,下面给出了配置示例。
biserver-ce\pentaho-solutions\system\applicationContext-spring-security-jdbc.xml
修改JNDI biserver-ce\pentaho-solutions\system\simple-jndi
biserver-ce\tomcat\webapps\pentaho\META-INF\context.xml中的内容到biserver-ce\tomcat\conf\Catalina\localhost\pentaho.xml
8.注释web.xml中默认的hsqldb数据库
\biserver-ce\tomcat\webapps\pentaho\WEB-INF的web ,删除如下内容
附件为修改后的上传文件。