As far as I recall, the 'upgrade all' button in the space yards window does exactly this. I haven't checked in a while so I might be mis-remembering. Unfortunately, there is no way to make it do ONLY this.

You have to upgrae every possible facility on every planet in your epire to get this 'automatic' substitution. I've ben asking him to let us select planets like we do for multi-build, or maybe even to select which facilities to upgrade.