web stats
Mirth Derby switch to PostgreSQL - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 06-07-2016, 05:48 PM
fchang888 fchang888 is offline
Mirth Newb
 
Join Date: Mar 2015
Posts: 19
fchang888 is on a distinguished road
Default Mirth Derby switch to PostgreSQL

Mirth 3.2.0.7628

I have Mirth Connect in production already.
I had thought PostgreSQL was used in production but when I checked
the Mirth Connect Server Manager on the Database tab, it shows derby.

Can I just change the DB from Derby to PostgreSQL?
If so, what is the best way to do this?

My logs are increasing daily and I need to setup Data Pruning to keep
the disk space in check.

Thanks in advance
Reply With Quote
  #2  
Old 06-07-2016, 06:56 PM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

Backup your server config, then switch the database using the Server Manager or by editing mirth.properties. After installing it into the new database, restore your server config. Note that messages will not be carried over.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 06-08-2016, 02:23 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 277
AlexNeiva is on a distinguished road
Default

Hello... is there a way to carry over the message from Derby to Postgres?
Like you said making a backup export all config and channels but none of the messages.

Thanks you
Reply With Quote
  #4  
Old 06-08-2016, 03:11 AM
hugosoares2 hugosoares2 is offline
OBX.2 Kenobi
 
Join Date: May 2011
Posts: 64
hugosoares2 is on a distinguished road
Default

You should be able to export database table rows from derby database and import them into postgres tables.

Since you are importing the config the database model and any metadata should be "mirrored" on postgres.

The tables that have message content that you should export/import are:
d_mXXX - message header
d_maXXX - message attachments
d_mcXXX - message content
d_mcmXXX - message content metadata
d_mmXXX - message statuses
d_msXXX - message statistics
d_msqXXX - I dont know

XXX is an internal channel id that you can find on table "d_channels"
I have never done this before but it should be fine....
Reply With Quote
  #5  
Old 06-08-2016, 03:27 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 277
AlexNeiva is on a distinguished road
Default

Yes, i understand that... but i was thinking that on Mirth Interface there was possible to do that... something...!

But thanks anyway
Reply With Quote
  #6  
Old 06-08-2016, 06:39 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

You can export messages in XML format for each individual channel. Go into the message browser, and there is an Export Results option. Make sure that Content is set to "XML serialized message". Check "Include Attachments" if you want, and export to a folder specific to that channel. After you set up your new database and restore your server config, you can go into each channel and import those messages.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #7  
Old 06-08-2016, 10:22 AM
fchang888 fchang888 is offline
Mirth Newb
 
Join Date: Mar 2015
Posts: 19
fchang888 is on a distinguished road
Default

Quote:
Originally Posted by narupley View Post
Backup your server config, then switch the database using the Server Manager or by editing mirth.properties. After installing it into the new database, restore your server config. Note that messages will not be carried over.
Thanks narupley! Just a followup, then.
So do I need to stop the Mirth Connect services when I do that in order
for the change to the new postgreSQL DB?

Thanks
Reply With Quote
  #8  
Old 06-08-2016, 12:50 PM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

Quote:
Originally Posted by fchang888 View Post
Thanks narupley! Just a followup, then.
So do I need to stop the Mirth Connect services when I do that in order
for the change to the new postgreSQL DB?

Thanks
Yep. After you change the DB connection settings, you'll need to restart the service.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

Tags
database, derby, postgres, pruning

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:51 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation