fix(upgrade): Ensure that `$CONFIG` is always available to upgrade scripts

Fixes #7457