Let's assume the oldest 9V locomotive, the one from set 4563-1.
I don't think you can convert that locomotive without dramitically changing it's appearance.
The basic components of a powered-up locomotive are a train motor and a hub, the train motor is basically the same size/shape as the old 9V track powered motor but the hub is a large additional component to accomodate.
There are a few different hubs, but the one included in the train sets is 4 studs wide. That basically means that either the section of the locomotive where the hub is located ends up at least 6 studs wide, or the sides of the hub and possiblly the connectors plugged into the hub will be visible.
It may be possible to put the hub in a wagon pulled behind the locomotive to try and preserve the appearance of the locomotive, but I expect wire management to be a challange.