Process engine database auto-creation disabling

Hi.

I want to disable database auto-creation, because i need to create SQL migration baseline script manually using changesets. So, is it possible?

@Sland you can disable schema creation by setting property: camunda.bpm.database.schema-update = false.

For more information refer this page:
https://docs.camunda.org/manual/7.12/user-guide/spring-boot-integration/configuration/#camunda-engine-properties

1 Like

@aravindhrs What if i will use databaseSchemaUpdate("false")?

Docs.

@Sland both serves the same purpose. So you can set it via Java api also. :slight_smile:

@aravindhrs :slight_smile:

Also, next question about published SQl scripts. I am just trying to execute create scripts for postgresql, and get:

Error: ERROR: relation \"act_ru_variable\" does not exist [Failed SQL: -- create foreign key constraints on ACT_RU_VARIABLE --\ncreate index ACT_IDX_VAR_CASE_EXE on ACT_RU_VARIABLE (CASE_EXECUTION_ID_)]

Is it a bug?

@Sland in camunda schema, process data stored in db was categorized as history and runtime.

History tables doesn’t have any foreign key constraints, but runtime tables (act_ru_*) has foreign key constraints. So to avoid foreign key violation,

  • You need to execute the scripts in order.
  • Disable the constraints check at schema level, then run the script and enable the constraints check later.

@aravindhrs How can i define right order? According on description?

Because in github repo there are no runtime tables DDL scripts…
Or this rule was for non runtime tables only? (And also there is no way to create runtime table in another way).

Because my goal - create all major stuff for sql migration without process engine.

@Sland you can find the DDL scripts in camunda Nexus Repository. You can find the script in create folder. I would suggest disable the constraints and enable the constraints once schema was created.

https://app.camunda.com/nexus/service/rest/repository/browse/public/org/camunda/bpm/distro/camunda-sql-scripts/?__hstc=12929896.ca1dc40d5492728b473f67e014092e79.1576942255887.1579064934699.1579101455521.167&__hssc=12929896.6.1579101455521&__hsfp=3725146161

@aravindhrs Yes, found DDL script. Name of zip file - camunda-sql-scripts-7.11.0.zip.

And in this zip file there are two sql scripts for postgres:

  1. postgres_engine_7.11.0.sql
  2. postgres_identity_7.11.0.sql

All this stuff must create all tables (include runtime tables), yep?

yes. you need to execute both the scripts

Hi @Sland , Can you please share the DDL scripts for postgres. Not able to find as the URL is changed. We are trying to migrate the Camunda DB from Oracle to postgreSQL with all deployments, running and history processes instances. Please help us with the step by step process . Thanks.

Hi @suresh.barika,

you can find the links to download the scripts here in the docs: Install the Database Schema | docs.camunda.org

Hope this helps, Ingo

1 Like