Is there a way to replace Smite with Sharpness on a weapon?

You can use an anvil to combine the enchants of two similar items. When you try to combine two mutually exclusive enchants, the enchant in the left input slot will overwrite the enchant in the right input slot.

To solve your issue you will need to get another sword of the same type with only sharpness on it. Then, put the sword with sharpness in the left slot of the anvil and your fully enchanted sword in the right slot. This should generate a new sword with sharpness instead of smite, while preserving the rest of your enchantments.