How to delete duplicate/old device activation data without deactivating a device

We are using Chirpstack V3 and due to some device issue, we have 1.3M entries in device_activation table and in redis. I am planning to only keep last 2 entries of device activation for all devices and delete older ones. And delete all dev_addr, dev_eui mappings from redis which are not present in database after above cleanup.

Is this the recommended approach to clear device activation data? Is there anything else we should consider?

Thank you

@brocaar Could you please provide your inputs on this?
thanks in advance.