You cannot replace more than one damage type of a spell that has more than one damage type.
Because the feature says you can replace "its damage type", where "type" is singular, you cannot replace multiple damage types with a single use of the feature. That would be allowed if the feature said "its damage types" or "its damage type(s)", but it uses neither of those constructions.
So, you cannot change Ice Knife to both deal bludgeoning damage on a hit and fire damage after it explodes.
Intuitive Example: John has three cats. Animal control has a warrant allowing them to "replace John's cat with a rabbit." They are not allowed to replace three cats with three rabbits.
This includes swapping the damage types within the spell.
Switching Ice Knife to deal cold on a hit and piercing in the explosion is identical to switching both of those types to some other spell whose level matches the level at which you cast Ice Knife. The fact that you're getting those types from the same spell in your spellbook doesn't change the fact that it is two replacements: one for the cold, and one for the piercing.
The GM must rule on whether you can replace one of the damage types of a spell that has more than one damage type.
The Ice Knife spell has two damage types: piercing and cold. Arguments could be made that you could replace piercing or cold with a single use of the feature. An argument for being allowed to replace one of the types is that that fulfills the singular construction of the feature's wording. An argument for not being allowed to replace one of the types is that the singular construction of the feature's wording means there's no matched concept to replace—Ice Knife doesn't have "a damage type" it has "damage types."
Because arguments both for and against this action are possible, the DM must rule whether this is allowed by such ambiguous wording until Sage Advice is updated with a clarification.
Intuitive Example: John has three cats. Animal control has a warrant allowing them to "replace John's cat with a rabbit." They are not allowed to replace one of his three cats with one rabbit without first clarifying the warrant with the judge, because the warrant is unclear.