You must avoid DB history changes as much as possible.

If you found a critical issue and old data calculated wrong you need to recalculate it.

You must done all steps in the same sequence!

Prepare recalculation tool

In the parser tools you can find a lot examples.

Be sure that recalculated data is correct. Make unit tests. Look at data from UI.

Deploy on stage

Deploy bug fix on stage. At this moment data should be calculated correctly and history data should look with a gap. It is normal. Check data in DB and from UI.

Create a dump from stage DB

After deploy create a dump. The data will include wrong period and a bit data with correct totals.

Install the dump on the DB where you will do recalculation.

Recalculation

...

Create update queries

Create a file with queries that update only necessary data.

Run queries on stage DB

...

Announce maintenance and stop the prod ethparser

Also stop ethparser-api

Create a dump from stage DB and prod (as backup)