upgrade: Add bounds check
Created by: efritz
Fixes #39581 (closed). This PR issues a blocking error (which can be disabled via explicitly set user flag) that will ensure your instance is at the version you are upgrading from.
Test plan
Tested locally.