Change database of production version

We did a great mistake and have a production environment with Tomcat7 and MySQL. Now we wan’t to migrate the system to a PostgreSQL database. First I tried the migration on my testsytem on my local windows-computer.

First I imported the MySQL-Data into a PostgreSQL-Database and then I changed my old Mysql-Testsystem:

  • I changed the vendor in the setenv.bat
  • I installed the postgresql-9.4.1207.jar in the lib
  • I changed the bonita.xml and the bitronix-resources.properties to the PostgreSQl-Database

By starting the application I got following error:

org.bonitasoft.console.common.server.utils.DefaultTenantIdException

Node not started. Method ‘org.bonitasoft.engine.api.LoginAPI.login’ cannot be called until node has been started (PlatformAPI.startNode()). Exact class: org.bonitasoft.engine.api.impl.LoginAPIImpl

Can you give me a tip, what I can do?
Many thanks !

Doing it that way will not work…

I think the way to do it is build your new environment on Postgresql, then use the MIGRATE tool to do the migration.

This should be able to sort everything out for you.

regards
Seán

hi Transmit,

as Antoine commented in the previous answer, the migration tool is designed to move from one version to a newer one, without changing anything in your stack. So it is out of scope for your need to move from mysql to postgresql.

I suggest you to test this:

  1. start a postgres bundle (same version as your mysql one)
  2. stop it
  3. disable all foreign keys on your postgresql database
  4. empty all tables
  5. use any ETL you want to transfert data (all tables, one by one) binding field by field from mysql to postgres database. at the end of this step you must have same data on both part, but with some column type differences
  6. enable all foreign keys
  7. copy bonita home folder from mysql bundle to postgresql
  8. apply required modifications to fit new db vendor setup (include copy JDBC drivers)
  9. start postgres instance and check all

the main issue is that even if regardless of db vendor, the bonita SQL schema is the same, some column type have different flavors across supported db vendor. So you need to ensure that postgresql schema is created in the right way: this is the purpose of steps 1-3

purpose of steps 3 and 6 is to avoid A-Z issues when moving data.

and apply same method on business data DB if you use it.

and please share on which version you did this.

regards,

L.

Dear Mr. Leseigneur,

could Bonitasoft send us an offer for the migration from the MySQL to the Postgre-Version, so that we will get an imagination of the costs.

Best regards
Andrea Fellenberg

Can you share (using a solution such as Dropbox or Google Drive) the full Bonita Engine log file?

The error you got might be the consequence of another one that might happen earlier in the startup sequence.

Many thanks for your offer to have a look into the logfile.

Here’s the link: https://cloud.transmit.de/index.php/s/I8lnVBh6t2q1Q5L

best regards

I think you shared the catalinalog file. Can you share the bonita log file?

Most useful information should be in that file.

Thanks

Okay, here’s the new link:

https://cloud.transmit.de/index.php/s/7CptoC9vzwNv4Nk

many thanks for your help!

Migration tool is used to migrate from one version of Bonita BPM to a newer one.

The tool directly update the existing database schema and so would not sure the scenario described here.

hello,

many thanks for your help.
After doing all steps you described I’m able to login and to see all task, processes ect.

Unfortunately I can’t see the process-variables in the administrator view of the case and when I call a task, bonita doesn’t found the connectors of the tasks. I checked the connectors, they are lying in the bonita container in the right path.

Do you have any idea.

The version of Bonita is 7.02.

Here the links to the logfiles:

bonita.log: https://cloud.transmit.de/index.php/s/zWKXd1Uo866J1vv
catalina.log: https://cloud.transmit.de/index.php/s/Ie6BuN6SJSib6HR

With best regards
A.F.

Current error seems to be related to one of your class: de.lehnert.auftrag.CreateAuftragsUebersicht that cannot be found. Do you know in which jar file this class is packaged? Are you sure this jar file is deployed (as part of the process definition .bar file or in application server classloader)?

Hello again,

the class “de.lehnert.auftrag.CreateAuftragsUebersicht” is part of the „lehnert.jar“ lib and when I searched for this file in the bonita directory, I found the „lehnert.jar“ in the two directories:

**directory 1: ** c:\web702_postgr\bonita\client\tenants\1\work\forms\Auftragsbearbeitung–1.6\1450688219494\lib\lehnert.jar
and
directory 2: c:\web702_postgr\bonita\engine-server\work\tenants\1\processes\5780618622248971170\classpath\lehnert.jar

When I have I look into the database into the table process_instance, then it seams that the 2 directories are related to the processDefinitionId (directory 2) and the startDate (directory 1).

The content of the fields are (in both versions MySQL Und PostgreSQL):
processDefinitionId: 5780618622248971170
startDate: 1450688391460

Could it be, that there is a different interpretation of the startDate, which is a bigint-field, in Mysql and the PostgreSql-Version and that is the reason why bonita doesn’t find the jar-file?

Hi A.F. from transmit,

It seems that you may re-deploy your process and ensure deployed connector version is up to date with your process definition.

I’m not sure your problem is related to this officially unsupported db vendor migration you did, considering you may loose some items while coppying needed folders & files from your previous bonita-home folder in order to keep them align with the database

Have you also consider that http://www.bonitasoft.com provides professional support and professional services to help you to solve this kind of issues ?

regards,

L.

Hi there,

You might want to reconsider…as MySQL is now officially supported as of 7.1.5 with MySQL 5.5.27. Still needs to be set up as INNODB. But The migration will probably be much easier than doing the PostgreSQL stuff.

The documentation is still not clear on this but the following post is very easy to understand…

http://community.bonitasoft.com/node/22657#node-22732

regards
Seán

PS: If this reply answers your question, please mark a resolved.