Device Activation Cleanup

We are running ChirpStack v3 with about 100K devices and have noticed multiple device activation keys in the device_activation table in the network server database, as well as in Redis (lora->ns->devaddr).

I understand that there is an API to delete device activations, but it removes all activations from both the database and Redis. Our goal is to keep only the latest activation key and remove all older ones from both the DB and Redis.

We’ve also noticed cases where records exist in Redis (lora->ns->devaddr) but the corresponding devaddr entry is missing in the database.

My questions are:

  1. Is it safe to manually delete(using script) all older activations from the DB and Redis while keeping only the latest one, instead of using the API?
  2. Does Redis (lora->ns->devaddr) store any information other than device activations? Specifically, is it safe to delete Redis records for devaddr values that do not have a corresponding entry in the device_activation table in the DB?