Solution for updating variables in completed instances in Camunda Workflow

Dear forum members,

Camunda: 6.8
Java: 8

Recently, I faced a problem with the Camunda workflow tool. In the flow that I have, there are completed instances where I need to change the value of some variables. Unfortunately, the system recorded the name of an entity that we thought was immutable, but over time we realized that it would be ideal to use an ID instead of the name.

When trying to retrieve the data for updating, Camunda informs me that the instance is already completed and no longer allows changes. I would like to know if anyone has faced this problem and if there is a solution for it. Has anyone tried to make the change directly in the database in the history tables? If so, was there any negative impact on the functionality of the tool?

I would like to thank everyone in advance who can help. I am eager to get answers and solutions to this problem.

Sincerely,
Rodrigo Lanes