Migrating config values to new/renamed keys

I renamed some config keys for my add-on and would like to automatically move the old (maybe changed by the user) values from the old key to the new one to make migrating to the new version of my add-on easier.

This is what I’ve tried so far:

I know that config.json is for default values only, so changed config entries live in meta.json. My first approach was to load the config with mw.addonManager.getConfig(__name__)), copying the changed values from the old keys to the new ones, deleting entries with old keys and writing the config with mw.addonManager.writeConfig(__name__, config). Unfortunately, entries with old keys are still present…

Is there an easy way to migrate the old config values from an old key to a new one?
Thanks in advance!

(Re-posting because I managed to put this into the wrong subforum…)

Did you also remove the old keys from config.json?

Yes, the old keys are not present anymore in config.json, I also tried removing them from meta.json, but that didn’t work, they were still there.