Announcement

Collapse
No announcement yet.

Moving from derby to MySQL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Moving from derby to MySQL

    Hi. I am using Mirth Connect 3.0.0 with windows server 2008, and I was trying to migrate from the default derby database to MySQL database. According to the forum, it seems that it should be as easy as changing the database in the Mirth Connect Server Manager.

    I set up the appropriate accounts in MySQL and ran mysql-database.sql in the appropriate schema, but when I try to restart the service, I get this error:

    ERROR 2013-12-08 22:07:03,746 [pool-6-thread-1] com.mirth.connect.connectors.tcp.TcpReceiver: Error receiving message (TCP Listener "Source" on channel 01fa8bdb-d4ba-44f0-a451-70971accd0c1).
    java.net.SocketException: socket closed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.io.BufferedInputStream.fill(Unknown Source)
    at java.io.BufferedInputStream.read(Unknown Source)
    at com.mirth.connect.model.transmission.framemode.Fra meStreamHandler.read(FrameStreamHandler.java:121)
    at com.mirth.connect.connectors.tcp.TcpReceiver$TcpRe ader.call(TcpReceiver.java:483)
    at com.mirth.connect.connectors.tcp.TcpReceiver$TcpRe ader.call(TcpReceiver.java:391)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker( Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    ERROR 2013-12-08 22:07:10,725 [Thread-1] com.mirth.connect.server.Mirth: Failed to migrate database schema
    com.mirth.connect.model.util.MigrationException: Failed to execute script: mysql-0-1.sql
    at com.mirth.connect.server.migration.Migrator.execut eScript(Migrator.java:87)
    at com.mirth.connect.server.migration.LegacyMigrator. migrate(LegacyMigrator.java:24)
    at com.mirth.connect.server.migration.ServerMigrator. migrate(ServerMigrator.java:63)
    at com.mirth.connect.server.controllers.DefaultMigrat ionController.migrate(DefaultMigrationController.j ava:85)
    at com.mirth.connect.server.Mirth.startup(Mirth.java: 232)
    at com.mirth.connect.server.Mirth.run(Mirth.java:151)
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorEx ception: Unknown table 'mirth.transport'
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:41 1)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLErro r.java:1054)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:4187)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.ja va:4119)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:25 70)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java :2731)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionIm pl.java:2809)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionIm pl.java:2758)
    at com.mysql.jdbc.StatementImpl.execute(StatementImpl .java:894)
    at com.mysql.jdbc.StatementImpl.execute(StatementImpl .java:732)
    at com.mirth.connect.server.migration.Migrator.execut eScript(Migrator.java:84)


    Is is possible that I have the wrong mysql-database.sql? I do not have a table called "transport". Where should I be getting this file from?

  • #2
    don't need mysql-database.sql

    Thanks Narupley for helping me on IRC.

    For everyone else who has tried to get an answer from reading old forum posts, you DO NOT need to run the mysql-database.sql. The upgrade path is remarkably simple now, at least for 3.0.0.

    1. Export all your channels.
    2. Create a mirth user in mysql
    3. Create a mirthdb schema in mysql
    4. Change the database settings in "Mirth Connect Server Manager" or just edit mirth.properties file.
    5. Restart mirth
    6. Reload and redeply your channels

    Comment


    • #3
      steps #2&3

      some handy sql for the uninitiated:

      CREATE USER 'mirthdb'@'localhost' IDENTIFIED BY 'secret;

      GRANT USAGE ON * . * TO 'mirthdb'@'localhost' IDENTIFIED BY 'secret' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

      CREATE DATABASE IF NOT EXISTS `mirthdb` ;

      GRANT ALL PRIVILEGES ON `mirthdb` . * TO 'mirthdb'@'localhost';

      restarting mirth 3.x creates it's own necessary tables. Step #3 almost sounds like we have to create the mirth schema, Mirth appears to do that.
      EHR Cloud

      www.openhealthshare.com

      Comment

      Working...
      X