Whenever I upgrade to a newer version of Mediaportal it seems to remove any custom keys added, for instance have to re-add the custom AtmoLight keyboard shortcut even if I assign it to a non-existent shortcut key (screenshot below)
Think this is because the keymap xml is getting overwritten with a default one on upgrades but not sure, would be great if this could somehow be migrated during upgrades

Don't get me wrong, because I do want this feature too, but won't this prevent new shortcuts to be added if new functionality is developed?
I think the safest (but also the hardest) way is to somehow merge the old and the new settings...

Agree, even the upcoming HID replacement doesn't allow for merging yet so would be better suited there as well but can get complex with multiple device types / updates as you can't easily do a side by side comparison and merge without user intervention.
So for now this probably the only short term solution especially since the shortcuts have been static for a while now