Delete Camunda Data

I wanted to Reset my camunda to the starting point, and I have alot of processes running,
and the API provided by Camunda to delete instances deletes them one at a time, and for me to do mass Delete I tried to delete directly from DB:

–ACT_RU–
truncate table [Camunda].dbo.ACT_RU_TASK;
truncate table [Camunda].dbo.ACT_RU_METER_LOG;
truncate table [Camunda].dbo.ACT_RU_JOBDEF;
truncate table [Camunda].dbo.ACT_RU_INCIDENT;
truncate table [Camunda].dbo.ACT_RU_IDENTITYLINK;
truncate table [Camunda].dbo.ACT_RU_FILTER;
truncate table [Camunda].dbo.ACT_RU_EXT_TASK;
truncate table [Camunda].dbo.ACT_RU_EXECUTION;
truncate table [Camunda].dbo.ACT_RU_EVENT_SUBSCR;
truncate table [Camunda].dbo.ACT_RU_CASE_SENTRY_PART;
truncate table [Camunda].dbo.ACT_RU_EXECUTION;
truncate table [Camunda].dbo.ACT_RU_BATCH;
truncate table [Camunda].dbo.ACT_RU_AUTHORIZATION;
–histiry–
truncate table [Camunda].dbo.ACT_HI_VARINST;
truncate table [Camunda].dbo.ACT_HI_TASKINST;
truncate table [Camunda].dbo.ACT_HI_PROCINST;
truncate table [Camunda].dbo.ACT_HI_OP_LOG;
truncate table [Camunda].dbo.ACT_HI_JOB_LOG;
truncate table [Camunda].dbo.ACT_HI_INCIDENT;
truncate table [Camunda].dbo.ACT_HI_IDENTITYLINK;
truncate table [Camunda].dbo.ACT_HI_EXT_TASK_LOG;
truncate table [Camunda].dbo.ACT_HI_DETAIL;
truncate table [Camunda].dbo.ACT_HI_DECINST;
truncate table [Camunda].dbo.ACT_HI_DEC_OUT;
truncate table [Camunda].dbo.ACT_HI_DEC_IN;
truncate table [Camunda].dbo.ACT_HI_COMMENT;
truncate table [Camunda].dbo.ACT_HI_CASEACTINST;
truncate table [Camunda].dbo.ACT_HI_BATCH;
truncate table [Camunda].dbo.ACT_HI_ATTACHMENT;
truncate table [Camunda].dbo.ACT_HI_ACTINST;

but even after doing this, inside my Camunda web UI, I can still see the processes even tho they don’t exist in DB.

NOTE: I had an issue with the Camunda account I used (I noticed later because I deleted Authorization DB, so i had to make a new account) and another question, how does this effects the default Camunda user (Demo, Demo)?
Because I noticed it never exists in DB in the first place it existed in yml file, does the authorization for demo demo exist in DB tho? or in some different file maybe?
any advice or knowledge about the situation would be appreciated.

Hello @Hadi_Hoteit1 ,

the easiest way to reset Camunda Platform 7 is to delete the database.

If you however want to delete process definitions, you should remove deployments (and cascade).

If you want to keep the deployments, but want to remove process instances only, you could use a batch:

https://docs.camunda.org/rest/camunda-bpm-platform/7.19/#tag/Process-Instance/operation/deleteProcessInstancesAsyncOperation

I hope this helps

Jonathan