Before 2023.4 you could give a new entity the same entity_id as an old one and it would automatically pick up the old data. However 2023.4 introduced a database change where internally each entity now has a “metadata_id”, and the state data is recorded against this id. You can see the impact of this on the updated documentation for the SQL Sensor, which now includes “metadata_id”. A new entity will get a new “metadata_id”, and therefore new history. I don’t know of any way to connect the old history to the new without tinkering in the database.
EDIT: Actually you’re referring to long-term data, but the principle still applies, as that also uses “metadata_id” (different values than those for states I think though).