Rename MQTT sensor - history

Hello,
i need to rename a MQTT sensor, trying not to lose its history.
I’m wondering if having created it without setting an explicit unique entity_id could help me.
I mean, this is the yaml for the sensor:

    - name: "ikea_pm25"
      device_class: "pm25"
      state_class: "measurement"
      state_topic: "devices/data/ikeaAir"
      unit_of_measurement: "µg/m³"
      availability_topic: "devices/availability/ikeaAir"
      suggested_display_precision: 0
      value_template: "{{ value_json.pm }}"  

i’d need to change the topics (but this should be transparent to HA history) and the name, but i’m quite sure this would break up all the history.
I was wondering if adding an explicit unique_id in yaml could fix the issue, so letting me change the name without loosing the data (hoping this is linked to the id).
But at the same time, i’m wondering what is gonna happen if i set a unique_id now when the data is linked to the id assigned automatically by HA (“sensor.ikea_pm25”)
thanks