cancel
Showing results for 
Search instead for 
Did you mean: 

How to create the same schema in Mysql, which is present in H2 db connected with activiti enterprise bpm

hiyabasu
Champ in-the-making
Champ in-the-making
Hi All,

I have one issue regarding creation of schema in MySql.
I am using Activiti bpm enterprise edition for designing my process flow which is now connected to the default H2 database.
Now, I want it to get connected to MySQL which I have done by changing the driver, url , username , password in activiti-app.properties file.
But in order to save my data model or process diagram i want the same schema structure present in H2 database in Mysql in order to save my process diagram in MySQL.

Does activiti provides any way to copy the schema structure from one database to other.

I have tried using Squirrel client , Razon SQl but nothing helped as such.

Need a solution urgently regarding this issue.

Thanks in advance.
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
If you boot up with an empty schema, the Bpm Suite will create all the tables for you. No need to do that.
When running H2, boot up the H2 webapp, go to localhost:8082 and log into db.
From there, execute "SCRIPT simple to 'dump.sql'" to get a sql dump that you can use to insert existing data in the mysql db.

hiyabasu
Champ in-the-making
Champ in-the-making
Hi,

Could you please tell me how to execute the "SCRIPT simple to 'dump.sql'" using H2 console.

I want to create a schema in mysql totally similar to that present in h2 db.

I tried running a Sample scripts present in h2 db console but it is just creating a table called Test in H2 db.

Scripts that I executed :

DROP TABLE IF EXISTS TEST;
CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255));
INSERT INTO TEST VALUES(1, 'Hello');
INSERT INTO TEST VALUES(2, 'World');
SELECT * FROM TEST ORDER BY ID;
UPDATE TEST SET NAME='Hi' WHERE ID=1;
DELETE FROM TEST WHERE ID=2;

Can you please help me out. I need that I urgently.

Thanks a lot.

jbarrez
Star Contributor
Star Contributor
"I want to create a schema in mysql totally similar to that present in h2 db."

If it's about the schema, simply configure the BPM Suite to go to an empty schema and it will create all the tables for you.

"Could you please tell me how to execute the "SCRIPT simple to 'dump.sql'" using H2 console."

I assume you're using the default installer of the Activiti BPM Suite? If so, you can log in to it via localhost:8082. Here you can execute that line to get a sql dump that will contain inserts for your data.