Configuring a new server datasource - rbeckman-nextgen/test-mc GitHub Wiki
Created by Gerald Bortis, last modified by Jacob Brauer on Oct 08, 2013
Icon
This guide is applicable to Mirth Connect 1.x. Mirth Connect 2.x contains some of the files mentioned in mirth-dbconf.jar, and Mirth Connect 3.x requires additional changes to add a new server datasource.
There are several steps that need to be taken to add support for a new database in Mirth.
Step 1: Add the DDL script. These reside in the %MIRTH_HOME%/conf/database directory with the filename database-database.sql. This file is executed by iBATIS when Mirth Connect is run for the first time only if the CONFIGURATION table is not found. This means that you can skip this step by running the script to create the tables using your preferred DB tool before starting the server for the first time. The code for executing the script can be found in DatabaseUtil.java#executeScript.
The RDBMS is selected by setting the database property in the %MIRTH_HOME%/conf/mirth.properties file. Note that the value of that property must match the subsequent references to database. Some example values are postgres or firebird.
Step 2: Add the connection properties. This is in the %MIRTH_HOME%/conf/database directory in a file named database-SqlMapConfig.properties. This includes a reference to the driver for the database, the URL, and your credentials.
Step 3: Add the iBATIS scripts. These are in a new folder in the %MIRTH_HOME%/conf directory named database. You should copy the files from an existing database and replace/modify the statements for your RDBMS. Each statement is called by the Mirth Connect server.
Step 4: Add your JDBC driver jar file to the server's classpath by placing it in the %MIRTH_HOME%/custom-lib directory and restarting the server.
I'd like to add a practical step-by-step guide to changing the datasource to SQL Server 2008. It took me a while to gather all the information, so I figure it would be useful to others. How to configure Mirth to use SQL Server 2008 1) Back up your Mirth Configuration, if one exists, by using Settings … Backup … from inside of the Mirth Client. If communication is not restored, you may want to check if TCP/IP is enabled in SQL Server. Hope this proves useful to some! ![]() |
Very useful set of steps, Walter. That saved me a lot of effort. After following these steps I noticed that I was unable to save or restore my code templates. In step 11, Shouldn't this read ALTER TABLE CODE_TEMPLATE ADD [ID] varchar(36) NULL, as the Code Templates are saved with a GUID for the ID. (I would have suggested the uniqueidentifier data-type, but wanted to remain consistent with the other tables) ![]() |
I'm glad you found the steps useful. I've not used the Code Templates feature to date, ... I think I came across the need to add the field and assumed the field was numeric because of some other table entries. But if you have found that using varchar(36) works, then I would say to use it. It would probably be best for a Mirth developer to definitively comment, (or better yet, include the field in the script itself), but as is, it should work with varchar(36). hwn ![]() |
Hi Walter I just started working with Mirth Connect today. Everything is fine with your instructions until I get to step 8 C:\Program Files\Mirth Connect\conf\sqlserver\sqlserver-database.sql. On my system, there is no SQL scripts located anywhere in the Mirth Folder. Is there something else I need to install or download?
![]() |
I have the same proble, can someone tell me where to find C:\Program Files\Mirth Connect\conf\sqlserver\sqlserver-database.sql file? I am running Mirth Connect Server 2.2.1.5861 64 bit version on windows 7 64bit.
Thanks ![]() |
Never mind, by trial and error I figured out that that step is not needed anymore. Mirth creates the tables and everything needed after you restart the server. Very smart thing, I absolutely love Mirth !!
Thanks ![]() |
HI, i am currently working on mirth and have been trying to establish a connection between mirth and sql server 2008 and have found no success despite following all the methods given on this forum.kindly suggest me any procedure ![]() |
Document generated by Confluence on Nov 11, 2019 08:40