Migration of h2 database data to another database

We started out using Camunda with the default h2 database but would now like to change to using Postgres. It is quite easy to reconfigure our application server to use another database and all the process engine and history tables get created automatically. But is there a way to copy the in-flight processes and process history data from the old h2 database into the new Postgres one?

Hi Gary,

i think no , i moved database from h2 oracle few days ago , in h2 to database i have created several users which is exists in h2 then after moving my database , i lost my all users , currently i am evaluating it , is there any possibilities then definitely let you know , am i tracked your problem or not ?

thanks.

Thanks for the reply Rahul. I have swapped databases over successfully on a test system and since we have Camunda setup to use active directory / ldap I still have my users and groups.
But, not surprisingly, all uncomplete processes in tasklist are lost as well as process history (which I can see using the REST API) and authorisations disappear from the admin app.

I can see there are scripts available for migrating the database from one version of Camunda to another and was hoping there might be something similar available to copy the data from our h2 database to a new Postgres one.

1 Like

Hi Gary,
Would you mind to do me a favor? I want to use another database like postgre.How to change the default h2 database for camunda bpm platform ?

thanks!

Hi Zhangsir,

It is quite easy to switch to Postgres say. I think it just required me to create a new database in pgadmin and then change the jdbc settings in Glassfish to point to the new database.
Then the next time the server is restarted Camunda creates all the tables it needs in the new database.

What is more difficult is to migrate your in flight processes, history and authorisations from the old database. I managed to do this by writing a bit of Java code which reads from all the tables in the old database and copies the data to the new ones using jdbc.

Hi GaryRich,
Share your Java code, please

With export from H2 (* .sql) to imports PostgreSQL- login occurs, but not everything works correctly.

Hi,

I want to stop using H2 for the Process Engine database but use a PostgreSQL database.
I ran the create script from my 7.8 distribution but I realized that the table act_ru_resource was not created.
I realized it because the example-invoice.war failed to deploy.

Any idea?

Edit: My bad, that was a manually created table by a plugin that I had forgot to load.