Using the Remove option from settings will free up the sensor, but you will lose access to any historical data. To keep your sensor data history while replacing an existing sensor with new hardware, use the Replace Device feature. To access this feature, visit Settings for the device you want to replace - check out the video to see an example.

Tip: this also releases the old sensor so that it can be reused in another location.