How to change id of a key meanwhile keep quota and quota_remaing

@bomb_magical

Found the answer to it. Currently there is a bug where import existing keys does not add the quota already used.

Like the keys which have an apikey- prefix, quotas already used also have a quota- prefix as well. The quota- prefix contains the amount of the used quotas. For example

quota-40dcaf04=175

This value is used to calculate the quota remining in the key.

So, to mitigate and solve your issue, you would need to create a key using the Create Custom Key / Import Key as earlier suggested. Then add a quota-{KEY_HASH} in the RedisDB. So for example, if the hash created for the key is 40dcaf04, then you would need to run the SET Redis command

SET quota-40dcaf04 "75"

Note: The value must be the currently used quota.

Once this is done. You can now make your requests and the quota of the key should update as normal.

Let us know if you got this working.